JBoss Tools SVN: r35229 - trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-09-30 11:21:21 -0400 (Fri, 30 Sep 2011)
New Revision: 35229
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java
Log:
https://issues.jboss.org/browse/JBIDE-9715 : default page options should be selectable and possible to copy
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java 2011-09-30 15:20:10 UTC (rev 35228)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java 2011-09-30 15:21:21 UTC (rev 35229)
@@ -217,10 +217,12 @@
}
private void updateFieldsForOverrideDefaultPath() {
- for (Control control : new Control[] {pathLabel, pathText, browseButton,
+ pathText.setEditable(overrideDefaultPath);
+ for (Control control : new Control[] {pathLabel, browseButton,
scopeLabel, scopeCombo}) {
control.setEnabled(overrideDefaultPath);
}
+
if (!overrideDefaultPath) {
pathText.setText(defaultReference.getLocation());
setScopeComboValue(defaultReference.getScope());
13 years, 5 months
JBoss Tools SVN: r35228 - trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-09-30 11:20:10 -0400 (Fri, 30 Sep 2011)
New Revision: 35228
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java
Log:
https://issues.jboss.org/browse/JBIDE-8719 : Show default root folder in Page Desigh Options Dialog on top of the Actual Run-Time Folders tab content
- reverted, because of wrong comment
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java 2011-09-30 15:17:10 UTC (rev 35227)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java 2011-09-30 15:20:10 UTC (rev 35228)
@@ -217,12 +217,10 @@
}
private void updateFieldsForOverrideDefaultPath() {
- pathText.setEditable(overrideDefaultPath);
- for (Control control : new Control[] {pathLabel, browseButton,
+ for (Control control : new Control[] {pathLabel, pathText, browseButton,
scopeLabel, scopeCombo}) {
control.setEnabled(overrideDefaultPath);
}
-
if (!overrideDefaultPath) {
pathText.setText(defaultReference.getLocation());
setScopeComboValue(defaultReference.getScope());
13 years, 5 months
JBoss Tools SVN: r35227 - trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-09-30 11:17:10 -0400 (Fri, 30 Sep 2011)
New Revision: 35227
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java
Log:
https://issues.jboss.org/browse/JBIDE-8719 : Show default root folder in Page Desigh Options Dialog on top of the Actual Run-Time Folders tab content
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java 2011-09-30 14:34:32 UTC (rev 35226)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java 2011-09-30 15:17:10 UTC (rev 35227)
@@ -217,10 +217,12 @@
}
private void updateFieldsForOverrideDefaultPath() {
- for (Control control : new Control[] {pathLabel, pathText, browseButton,
+ pathText.setEditable(overrideDefaultPath);
+ for (Control control : new Control[] {pathLabel, browseButton,
scopeLabel, scopeCombo}) {
control.setEnabled(overrideDefaultPath);
}
+
if (!overrideDefaultPath) {
pathText.setText(defaultReference.getLocation());
setScopeComboValue(defaultReference.getScope());
13 years, 5 months
JBoss Tools SVN: r35226 - trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-30 10:34:32 -0400 (Fri, 30 Sep 2011)
New Revision: 35226
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/ObservableUIPojo.java
Log:
[JBIDE-9805] corrected jdk1.6 annotations on ObservbleUIPojo
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/ObservableUIPojo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/ObservableUIPojo.java 2011-09-30 14:33:09 UTC (rev 35225)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/ObservableUIPojo.java 2011-09-30 14:34:32 UTC (rev 35226)
@@ -23,7 +23,6 @@
public void firePropertyChange(final String propertyName, final Object oldValue, final Object newValue) {
Display.getDefault().syncExec(new Runnable() {
- @Override
public void run() {
ObservableUIPojo.super.firePropertyChange(propertyName, oldValue, newValue);
}
@@ -35,7 +34,6 @@
final Object newValue) {
Display.getDefault().syncExec(new Runnable() {
- @Override
public void run() {
ObservableUIPojo.super.fireIndexedPropertyChange(propertyName, index, oldValue, newValue);
}
13 years, 5 months
JBoss Tools SVN: r35225 - trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-30 10:33:09 -0400 (Fri, 30 Sep 2011)
New Revision: 35225
Added:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/Status2BooleanConverter.java
Log:
[JBIDE-9793] implemented Status2BooleanConverter
Added: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/Status2BooleanConverter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/Status2BooleanConverter.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/Status2BooleanConverter.java 2011-09-30 14:33:09 UTC (rev 35225)
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.ui.databinding;
+
+import org.eclipse.core.databinding.conversion.Converter;
+import org.eclipse.core.runtime.IStatus;
+
+/**
+ * Converts an IStatus to a boolean.
+ *
+ * @author André Dietisheim
+ *
+ * @see IStatus
+ *
+ */
+public class Status2BooleanConverter extends Converter {
+
+ private int severity;
+
+ public Status2BooleanConverter(int severity) {
+ super(IStatus.class, Boolean.class);
+ this.severity = severity;
+ }
+
+ /**
+ * Compares the given IStatus to the status that was given at construction
+ * time. Returns <code>true</code> if they're <b>not</b> equal, <code>false</code>
+ * otherwise.
+ *
+ * @see IStatus#ERROR
+ * @see IStatus#WARNING
+ * @see IStatus#INFO
+ * @see IStatus#OK
+ */
+ public Object convert(Object fromObject) {
+ if (!(fromObject instanceof IStatus)) {
+ return Boolean.FALSE;
+ }
+
+ int current = ((IStatus) fromObject).getSeverity();
+ switch (severity) {
+ default:
+ case IStatus.ERROR:
+ return current != IStatus.ERROR;
+ case IStatus.WARNING:
+ return current != IStatus.WARNING;
+ case IStatus.INFO:
+ return current != IStatus.INFO;
+ case IStatus.OK:
+ return current != IStatus.OK;
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/Status2BooleanConverter.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 5 months
JBoss Tools SVN: r35224 - trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-30 10:11:35 -0400 (Fri, 30 Sep 2011)
New Revision: 35224
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserIntegrationTest.java
Log:
[JBIDE-9811] added IOpenshiftService#isValid(User) and IUser#isValid()
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserIntegrationTest.java 2011-09-30 14:08:35 UTC (rev 35223)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserIntegrationTest.java 2011-09-30 14:11:35 UTC (rev 35224)
@@ -32,7 +32,6 @@
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationUtils;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -66,7 +65,6 @@
badUrlUser.isValid();
}
- @Ignore
@Test
public void canGetUserUUID() throws OpenshiftException {
String uuid = user.getUUID();
@@ -74,7 +72,6 @@
assertTrue(uuid.length() > 0);
}
- @Ignore
@Test
public void canGetPublicKey() throws OpenshiftException {
ISSHPublicKey key = user.getSshKey();
@@ -83,7 +80,6 @@
assertTrue(key.getPublicKey().length() > 0);
}
- @Ignore
@Test
public void canGetDomain() throws OpenshiftException {
IDomain domain = user.getDomain();
@@ -94,7 +90,6 @@
assertTrue(domain.getNamespace().length() > 0);
}
- @Ignore
@Test(expected=OpenshiftEndpointException.class)
public void cannotCreateDomainIfAlreadyExists() throws OpenshiftException {
IDomain domain = user.getDomain();
@@ -104,7 +99,6 @@
user.createDomain("newDomain", key);
}
- @Ignore
@Test
public void canGetCartridges() throws OpenshiftException {
Collection<ICartridge> cartridges = user.getCartridges();
@@ -112,14 +106,12 @@
assertTrue(cartridges.size() >= 5);
}
- @Ignore
@Test
public void canGetApplications() throws OpenshiftException {
Collection<IApplication> applications = user.getApplications();
assertNotNull(applications);
}
- @Ignore
@Test
public void canCreateApplication() throws OpenshiftException {
String applicationName = ApplicationUtils.createRandomApplicationName();
@@ -135,7 +127,6 @@
}
}
- @Ignore
@Test
public void canGetApplicationByName() throws OpenshiftException, DatatypeConfigurationException {
String applicationName = ApplicationUtils.createRandomApplicationName();
13 years, 5 months
JBoss Tools SVN: r35223 - in trunk/as: plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-30 10:08:35 -0400 (Fri, 30 Sep 2011)
New Revision: 35223
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/NotFoundOpenshiftException.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/InvalidCredentialsOpenshiftException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/User.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/TestUser.java
Log:
[JBIDE-9811] added IOpenshiftService#isValid(User) and IUser#isValid()
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-30 13:59:16 UTC (rev 35222)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-30 14:08:35 UTC (rev 35223)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.core;
+import java.net.MalformedURLException;
import java.util.List;
import org.jboss.ide.eclipse.as.openshift.core.internal.ApplicationInfo;
@@ -29,7 +30,7 @@
/**
* The path (url path addition) to the service
*/
- public static final String SERVICE_PATH = "/com/broker";
+ public static final String SERVICE_PATH = "/broker";
/**
* Returns the url at which the service is reachable.
@@ -46,20 +47,14 @@
public String getPlatformUrl();
/**
- * Returns <code>true</code> if the service is reachable. Returns
+ * Returns <code>true</code> if given user has valid credentials. Returns
* <code>false</code> otherwise.
*
- * @return true if the service is reachable.
- */
- public boolean isReachable();
-
- /**
- * Returns <code>true</code> if the service is reachable and the credentials
- * are valid. Returns <code>false</code> otherwise.
- *
* @return
+ * @throws OpenshiftException
+ * @throws MalformedURLException
*/
- public boolean areCredentialsValid();
+ public boolean isValid(InternalUser user) throws OpenshiftException;
/**
* List all cartridges that are available on the Openshift Express platform.
@@ -68,6 +63,7 @@
* the user account that shall be used
* @return the list of cartridges available on the platform
* @throws OpenshiftException
+ * @throws MalformedURLException
*
* @see InternalUser
*/
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java 2011-09-30 13:59:16 UTC (rev 35222)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IUser.java 2011-09-30 14:08:35 UTC (rev 35223)
@@ -22,6 +22,8 @@
public String getPassword();
+ public boolean isValid() throws OpenshiftException;
+
public String getUUID() throws OpenshiftException;
public IDomain createDomain(String name, ISSHPublicKey key) throws OpenshiftException;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/InvalidCredentialsOpenshiftException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/InvalidCredentialsOpenshiftException.java 2011-09-30 13:59:16 UTC (rev 35222)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/InvalidCredentialsOpenshiftException.java 2011-09-30 14:08:35 UTC (rev 35223)
@@ -18,7 +18,7 @@
private static final long serialVersionUID = 1L;
- public InvalidCredentialsOpenshiftException(String url, Throwable cause, String message, Object... arguments) {
- super(url, cause, message);
+ public InvalidCredentialsOpenshiftException(String url, Throwable cause) {
+ super(url, cause, "Your credentials are not authorized to access \"{0}\"", url);
}
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/NotFoundOpenshiftException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/NotFoundOpenshiftException.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/NotFoundOpenshiftException.java 2011-09-30 14:08:35 UTC (rev 35223)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.core;
+
+
+/**
+ * @author André Dietisheim
+ */
+public class NotFoundOpenshiftException extends OpenshiftEndpointException {
+
+ private static final long serialVersionUID = 1L;
+
+ public NotFoundOpenshiftException(String url, Throwable cause) {
+ super(url, cause, "Could not find any Openshift Express resource at \"{0}\"", url);
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/NotFoundOpenshiftException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftService.java 2011-09-30 13:59:16 UTC (rev 35222)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftService.java 2011-09-30 14:08:35 UTC (rev 35223)
@@ -18,6 +18,7 @@
import org.jboss.ide.eclipse.as.openshift.core.internal.InternalUser;
import org.jboss.ide.eclipse.as.openshift.core.internal.UserInfo;
import org.jboss.ide.eclipse.as.openshift.core.internal.httpclient.HttpClientException;
+import org.jboss.ide.eclipse.as.openshift.core.internal.httpclient.NotFoundException;
import org.jboss.ide.eclipse.as.openshift.core.internal.httpclient.UnauthorizedException;
import org.jboss.ide.eclipse.as.openshift.core.internal.httpclient.UrlConnectionHttpClient;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.AbstractDomainRequest;
@@ -51,15 +52,26 @@
this(BASE_URL);
}
- protected OpenshiftService(String baseUrl) {
+ public OpenshiftService(String baseUrl) {
this.baseUrl = baseUrl;
}
+ @Override
public String getServiceUrl() {
return baseUrl + SERVICE_PATH;
}
-
+
@Override
+ public String getPlatformUrl() {
+ return baseUrl;
+ }
+
+ @Override
+ public boolean isValid(InternalUser user) throws OpenshiftException {
+ return getUserInfo(user) != null;
+ }
+
+ @Override
public UserInfo getUserInfo(InternalUser user) throws OpenshiftException {
UserInfoRequest request = new UserInfoRequest(user.getRhlogin(), true);
String url = request.getUrlString(getServiceUrl());
@@ -74,17 +86,21 @@
return response.getOpenshiftObject();
} catch (MalformedURLException e) {
throw new OpenshiftEndpointException(
- url, e, "Could not get user info for user \"{0}\" at \"{1}\"", user.getRhlogin(), url, e);
+ url, e, "Could not get user info for user \"{0}\" at \"{1}\"", user.getRhlogin(), url);
+ } catch (UnauthorizedException e) {
+ throw new InvalidCredentialsOpenshiftException(url, e);
+ } catch (NotFoundException e) {
+ throw new NotFoundOpenshiftException(url, e);
} catch (HttpClientException e) {
throw new OpenshiftEndpointException(
- url, e, "Could not get user info for user \"{0}\" at \"{1}\"", user.getRhlogin(), url, e);
+ url, e, "Could not get user info for user \"{0}\" at \"{1}\"", user.getRhlogin(), url);
}
}
@Override
public List<ICartridge> getCartridges(InternalUser user) throws OpenshiftException {
ListCartridgesRequest listCartridgesRequest = new ListCartridgesRequest(user.getRhlogin(), true);
- String url = listCartridgesRequest.getUrlString(BASE_URL);
+ String url = listCartridgesRequest.getUrlString(getServiceUrl());
try {
String listCartridgesRequestString =
new ListCartridgesRequestJsonMarshaller().marshall(listCartridgesRequest);
@@ -95,8 +111,13 @@
OpenshiftResponse<List<ICartridge>> response =
new ListCartridgesResponseUnmarshaller().unmarshall(listCatridgesReponse);
return response.getOpenshiftObject();
+ /**
+ * always allowed to list cartridges, even with invalid credentials
+ */
} catch (MalformedURLException e) {
throw new OpenshiftEndpointException(url, e, "Could not list available cartridges at \"{0}\"", url);
+ } catch (NotFoundException e) {
+ throw new NotFoundOpenshiftException(url, e);
} catch (HttpClientException e) {
throw new OpenshiftEndpointException(url, e, "Could not list available cartridges at \"{0}\"", url);
}
@@ -127,33 +148,42 @@
return response.getOpenshiftObject();
} catch (MalformedURLException e) {
throw new OpenshiftEndpointException(url, e, "Could reach openshift platform at \"{0}\"", url);
+ } catch (UnauthorizedException e) {
+ throw new InvalidCredentialsOpenshiftException(url, e);
+ } catch (NotFoundException e) {
+ throw new NotFoundOpenshiftException(url, e);
} catch (HttpClientException e) {
throw new OpenshiftEndpointException(url, e, "Could not {0}", request.toHumanReadable());
}
}
@Override
- public Application createApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
- Application application = requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.CONFIGURE,
+ public Application createApplication(String name, ICartridge cartridge, InternalUser user)
+ throws OpenshiftException {
+ Application application = requestApplicationAction(new ApplicationRequest(name, cartridge,
+ ApplicationAction.CONFIGURE,
user.getRhlogin(), true), user);
return application;
}
@Override
public void destroyApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
- IApplication application = requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.DECONFIGURE,
+ IApplication application = requestApplicationAction(new ApplicationRequest(name, cartridge,
+ ApplicationAction.DECONFIGURE,
user.getRhlogin(), true), user);
- user.remove(application);
+ user.remove(application);
}
@Override
- public IApplication startApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+ public IApplication startApplication(String name, ICartridge cartridge, InternalUser user)
+ throws OpenshiftException {
return requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.START,
user.getRhlogin(), true), user);
}
@Override
- public IApplication restartApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+ public IApplication restartApplication(String name, ICartridge cartridge, InternalUser user)
+ throws OpenshiftException {
return requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.RESTART,
user.getRhlogin(), true), user);
}
@@ -184,11 +214,9 @@
e, "Could not {0} application \"{1}\" at \"{2}\": Invalid url \"{2}\"",
applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url);
} catch (UnauthorizedException e) {
- throw new InvalidCredentialsOpenshiftException(
- url, e,
- "Could not {0} application \"{1}\" at \"{2}\": Invalid credentials user \"{3}\", password \"{4}\"",
- applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url,
- user.getRhlogin(), user.getPassword());
+ throw new InvalidCredentialsOpenshiftException(url, e);
+ } catch (NotFoundException e) {
+ throw new NotFoundOpenshiftException(url, e);
} catch (HttpClientException e) {
throw new OpenshiftEndpointException(
url, e, "Could not {0} application \"{1}\" at \"{2}\"",
@@ -215,12 +243,9 @@
e, "Could not {0} application \"{1}\" at \"{2}\": Invalid url \"{2}\"",
applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url);
} catch (UnauthorizedException e) {
- throw new InvalidCredentialsOpenshiftException(
- url, e,
- "Could not {0} application \"{1}\" at \"{2}\": Invalid credentials user \"{3}\", password \"{4}\"",
- applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url,
- user.getRhlogin(),
- user.getPassword());
+ throw new InvalidCredentialsOpenshiftException(url, e);
+ } catch (NotFoundException e) {
+ throw new NotFoundOpenshiftException(url, e);
} catch (HttpClientException e) {
throw new OpenshiftEndpointException(
url, e, "Could not {0} application \"{1}\" at \"{2}\"",
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/User.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/User.java 2011-09-30 13:59:16 UTC (rev 35222)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/User.java 2011-09-30 14:08:35 UTC (rev 35223)
@@ -20,4 +20,8 @@
public User(String rhlogin, String password) {
super(rhlogin, password);
}
+
+ protected User(String rhlogin, String password, String url) {
+ super(rhlogin, password, url);
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java 2011-09-30 13:59:16 UTC (rev 35222)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java 2011-09-30 14:08:35 UTC (rev 35223)
@@ -21,6 +21,7 @@
import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
import org.jboss.ide.eclipse.as.openshift.core.IUser;
+import org.jboss.ide.eclipse.as.openshift.core.InvalidCredentialsOpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
@@ -43,6 +44,10 @@
this(rhlogin, password, (ISSHPublicKey) null, new OpenshiftService());
}
+ public InternalUser(String rhlogin, String password, String url) {
+ this(rhlogin, password, (ISSHPublicKey) null, new OpenshiftService(url));
+ }
+
public InternalUser(String rhlogin, String password, IOpenshiftService service) {
this(rhlogin, password, (ISSHPublicKey) null, service);
}
@@ -53,6 +58,15 @@
this.sshKey = sshKey;
this.service = service;
}
+
+ @Override
+ public boolean isValid() throws OpenshiftException {
+ try {
+ return service.isValid(this);
+ } catch(InvalidCredentialsOpenshiftException e) {
+ return false;
+ }
+ }
@Override
public IDomain createDomain(String name, ISSHPublicKey key) throws OpenshiftException {
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserIntegrationTest.java 2011-09-30 13:59:16 UTC (rev 35222)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserIntegrationTest.java 2011-09-30 14:08:35 UTC (rev 35223)
@@ -12,6 +12,7 @@
import static org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationAsserts.assertApplication;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -23,6 +24,7 @@
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.IDomain;
import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
+import org.jboss.ide.eclipse.as.openshift.core.NotFoundOpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftEndpointException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
@@ -30,6 +32,7 @@
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationUtils;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
/**
@@ -38,19 +41,40 @@
public class UserIntegrationTest {
private User user;
+ private TestUser invalidUser;
+ private TestUser badUrlUser;
@Before
public void setUp() throws OpenshiftException, DatatypeConfigurationException {
this.user = new TestUser();
+ this.invalidUser = new TestUser("bogusPassword");
+ this.badUrlUser = new TestUser(TestUser.RHLOGIN, TestUser.PASSWORD, "http://www.redhat.com");
}
+ @Test
+ public void canCheckIfUserIsValid() throws OpenshiftException {
+ assertTrue(user.isValid());
+ }
+
@Test
+ public void throwsExceptionIfInvalidCredentials() throws OpenshiftException {
+ assertFalse(invalidUser.isValid());
+ }
+
+ @Test(expected=NotFoundOpenshiftException.class)
+ public void throwsExceptionIfBadUrl() throws OpenshiftException {
+ badUrlUser.isValid();
+ }
+
+ @Ignore
+ @Test
public void canGetUserUUID() throws OpenshiftException {
String uuid = user.getUUID();
assertNotNull(uuid);
assertTrue(uuid.length() > 0);
}
+ @Ignore
@Test
public void canGetPublicKey() throws OpenshiftException {
ISSHPublicKey key = user.getSshKey();
@@ -59,6 +83,7 @@
assertTrue(key.getPublicKey().length() > 0);
}
+ @Ignore
@Test
public void canGetDomain() throws OpenshiftException {
IDomain domain = user.getDomain();
@@ -69,6 +94,7 @@
assertTrue(domain.getNamespace().length() > 0);
}
+ @Ignore
@Test(expected=OpenshiftEndpointException.class)
public void cannotCreateDomainIfAlreadyExists() throws OpenshiftException {
IDomain domain = user.getDomain();
@@ -78,6 +104,7 @@
user.createDomain("newDomain", key);
}
+ @Ignore
@Test
public void canGetCartridges() throws OpenshiftException {
Collection<ICartridge> cartridges = user.getCartridges();
@@ -85,12 +112,14 @@
assertTrue(cartridges.size() >= 5);
}
+ @Ignore
@Test
public void canGetApplications() throws OpenshiftException {
Collection<IApplication> applications = user.getApplications();
assertNotNull(applications);
}
+ @Ignore
@Test
public void canCreateApplication() throws OpenshiftException {
String applicationName = ApplicationUtils.createRandomApplicationName();
@@ -106,6 +135,7 @@
}
}
+ @Ignore
@Test
public void canGetApplicationByName() throws OpenshiftException, DatatypeConfigurationException {
String applicationName = ApplicationUtils.createRandomApplicationName();
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/TestUser.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/TestUser.java 2011-09-30 13:59:16 UTC (rev 35222)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/TestUser.java 2011-09-30 14:08:35 UTC (rev 35223)
@@ -21,8 +21,8 @@
*/
public class TestUser extends User {
- private static final String RHLOGIN = "toolsjboss(a)gmail.com";
- private static final String PASSWORD = "1q2w3e";
+ public static final String RHLOGIN = "toolsjboss(a)gmail.com";
+ public static final String PASSWORD = "1q2w3e";
public TestUser() {
super(RHLOGIN, PASSWORD);
@@ -32,6 +32,10 @@
super(RHLOGIN, password);
}
+ public TestUser(String rhlogin, String password, String url) {
+ super(rhlogin, password, url);
+ }
+
public IApplication createTestApplication() throws OpenshiftException {
return createApplication(ApplicationUtils.createRandomApplicationName(), Cartridge.JBOSSAS_7);
}
13 years, 5 months
JBoss Tools SVN: r35222 - trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-30 09:59:16 -0400 (Fri, 30 Sep 2011)
New Revision: 35222
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/UrlString2BooleanConverter.java
Log:
[JBIDE-9805] corrected jdk1.6 annotations on UrlString2BooleanConverter
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/UrlString2BooleanConverter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/UrlString2BooleanConverter.java 2011-09-30 13:50:51 UTC (rev 35221)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/UrlString2BooleanConverter.java 2011-09-30 13:59:16 UTC (rev 35222)
@@ -29,7 +29,6 @@
super(String.class, Boolean.class);
}
- @Override
public Object convert(Object fromObject) {
if (!(fromObject instanceof String)) {
return Boolean.FALSE;
13 years, 5 months
JBoss Tools SVN: r35221 - trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2011-09-30 09:50:51 -0400 (Fri, 30 Sep 2011)
New Revision: 35221
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/OpenOnUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-9808 , logic were updated.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/OpenOnUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/OpenOnUtil.java 2011-09-30 13:42:03 UTC (rev 35220)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/OpenOnUtil.java 2011-09-30 13:50:51 UTC (rev 35221)
@@ -82,9 +82,8 @@
public static final void checkOpenOnInEditor(IEditorInput editorInput,String editorId,int lineNumber, int lineOffset, String openedOnFileName) throws Throwable {
StructuredTextEditor textEditor = getStructuredTextEditorPart(editorInput, editorId);
-
- int openOnPosition = TestUtil.getLinePositionOffcet(textEditor
- .getTextViewer(),lineNumber, lineOffset);
+ int openOnPosition = TestUtil.getLinePositionOffcet(
+ textEditor.getTextViewer(), lineNumber, lineOffset);
// hack to get hyperlinks detectors, no other was have been founded
Method method = AbstractTextEditor.class
.getDeclaredMethod("getSourceViewerConfiguration"); //$NON-NLS-1$
@@ -106,8 +105,8 @@
}
IEditorPart activeEditor = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- assertEquals(
- "Active page should be ", openedOnFileName, activeEditor.getEditorInput().getName()); //$NON-NLS-1$
+ assertEquals("Active page should be ", //$NON-NLS-1$
+ openedOnFileName, activeEditor.getEditorInput().getName());
}
private static StructuredTextEditor getStructuredTextEditorPart(IEditorInput editorInput,String editorId) throws PartInitException{
@@ -115,20 +114,26 @@
.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.openEditor(editorInput, editorId);
StructuredTextEditor textEditor = null;
- if(editorPart instanceof MultiPageEditorPart){
- StructuredTextEditor structuredTextEditor = findStructEditor((MultiPageEditorPart)editorPart, editorInput);
- ((MultiPageEditorPart)editorPart).setActiveEditor(structuredTextEditor);
+ /*
+ * https://issues.jboss.org/browse/JBIDE-9808
+ * After "JSPMultiPageEditorPart extends MultiPageEditorPart"
+ * the comparison condition should be updated.
+ */
+ if (editorPart instanceof JSPMultiPageEditor) {
+ textEditor = ((JSPMultiPageEditor) editorPart).getSourceEditor();
+ } else if (editorPart instanceof MultiPageEditorPart) {
+ StructuredTextEditor structuredTextEditor = findStructEditor((MultiPageEditorPart) editorPart, editorInput);
+ ((MultiPageEditorPart) editorPart).setActiveEditor(structuredTextEditor);
textEditor = structuredTextEditor;
- } else if(editorPart instanceof JSPMultiPageEditor) {
- textEditor = ((JSPMultiPageEditor)editorPart).getSourceEditor();
- } else if(editorPart instanceof EditorPartWrapper
- &&(((EditorPartWrapper)editorPart).getEditor()) instanceof MultiPageEditorPart) {
- StructuredTextEditor structuredTextEditor = findStructEditor((MultiPageEditorPart)((EditorPartWrapper)editorPart).getEditor(), editorInput);
- ((MultiPageEditorPart)((EditorPartWrapper)editorPart).getEditor()).setActiveEditor(structuredTextEditor);
+ } else if (editorPart instanceof EditorPartWrapper
+ && (((EditorPartWrapper) editorPart).getEditor()) instanceof MultiPageEditorPart) {
+ StructuredTextEditor structuredTextEditor = findStructEditor((MultiPageEditorPart)
+ ((EditorPartWrapper) editorPart).getEditor(), editorInput);
+ ((MultiPageEditorPart) ((EditorPartWrapper) editorPart).getEditor()).setActiveEditor(structuredTextEditor);
textEditor = structuredTextEditor;
- } else if(editorPart instanceof EditorPartWrapper &&
- (((EditorPartWrapper)editorPart).getEditor()) instanceof StructuredTextEditor){
- textEditor = (StructuredTextEditor) (((EditorPartWrapper)editorPart).getEditor());
+ } else if (editorPart instanceof EditorPartWrapper
+ && (((EditorPartWrapper) editorPart).getEditor()) instanceof StructuredTextEditor) {
+ textEditor = (StructuredTextEditor) (((EditorPartWrapper) editorPart).getEditor());
}
return textEditor;
}
13 years, 5 months
JBoss Tools SVN: r35220 - trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-09-30 09:42:03 -0400 (Fri, 30 Sep 2011)
New Revision: 35220
Added:
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/BrowserInitializer.java
Log:
JBIDE-9231 Create patched SWT plugins for Linux GTK x86 and x86_64
Added: trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/BrowserInitializer.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/BrowserInitializer.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/BrowserInitializer.java 2011-09-30 13:42:03 UTC (rev 35220)
@@ -0,0 +1,13 @@
+package org.eclipse.swt.browser;
+
+public class BrowserInitializer {
+
+ private static final String PROPERTY_DEFAULTTYPE = "org.eclipse.swt.browser.DefaultType"; //$NON-NLS-1$
+
+ static {
+ String defaultType = System.getProperty(PROPERTY_DEFAULTTYPE);
+ if (defaultType == null) {
+ System.setProperty(PROPERTY_DEFAULTTYPE, "mozilla"); //$NON-NLS-1$
+ }
+ }
+}
13 years, 5 months