JBoss Tools SVN: r26627 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-16 11:27:02 -0500 (Tue, 16 Nov 2010)
New Revision: 26627
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstancePropertySource.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java
Log:
[JBIDE-7597] load images / instances now throw of DeltaCloudExceptions (exceptions are not swallowed any longer), errors while loading images/instances are now reported (exceptions are not swallowed any longer)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-16 16:22:05 UTC (rev 26626)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-16 16:27:02 UTC (rev 26627)
@@ -1,5 +1,12 @@
2010-11-16 André Dietisheim <adietish(a)redhat.com>
+ * src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java (inputChanged):
+ * src/org/jboss/tools/deltacloud/ui/views/InstancePropertySource.java (getKey):
+ [JBIDE-7597] errors while loading images/instances are now reported (exceptions are not swallowed any longer)
+ * src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java (inputChanged):
+ [JBIDE-7597] using ErrorUtils now (removed code duplication)
+ * src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java (getChildren):
+ [JBIDE-7597] errors while loading images/instances are now reported (exceptions are not swallowed any longer)
* src/org/jboss/tools/deltacloud/ui/RSEUtils.java (createHostName):
[JBIDE-7603] added null check
* src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java (run):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-11-16 16:22:05 UTC (rev 26626)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-11-16 16:27:02 UTC (rev 26627)
@@ -13,10 +13,12 @@
import java.util.ArrayList;
import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.widgets.Display;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.core.IInstanceFilter;
import org.jboss.tools.deltacloud.core.IInstanceListListener;
+import org.jboss.tools.deltacloud.ui.ErrorUtils;
public class CVInstancesCategoryElement extends CVCategoryElement implements IInstanceListListener {
@@ -67,11 +69,18 @@
public Object[] getChildren() {
if (!initialized) {
DeltaCloud cloud = (DeltaCloud) getElement();
- cloud.removeInstanceListListener(this);
- DeltaCloudInstance[] instances = filter(cloud.getCurrInstances());
- addInstances(instances);
- initialized = true;
- cloud.addInstanceListListener(this);
+ try {
+ cloud.removeInstanceListListener(this);
+ DeltaCloudInstance[] instances = filter(cloud.getCurrInstances());
+ addInstances(instances);
+ initialized = true;
+ cloud.addInstanceListListener(this);
+ } catch (Exception e) {
+ ErrorUtils.openErrorDialog(
+ "Error",
+ "Colud not get instances from cloud " + cloud.getName(),
+ e, Display.getDefault().getActiveShell());
+ }
}
return super.getChildren();
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java 2010-11-16 16:22:05 UTC (rev 26626)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java 2010-11-16 16:27:02 UTC (rev 26627)
@@ -15,18 +15,16 @@
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.BaseLabelProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.log.StatusFactory;
+import org.eclipse.swt.widgets.Display;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
import org.jboss.tools.deltacloud.core.IImageFilter;
-import org.jboss.tools.deltacloud.ui.Activator;
+import org.jboss.tools.deltacloud.ui.ErrorUtils;
public class ImageViewLabelAndContentProvider extends BaseLabelProvider implements IStructuredContentProvider,
ITableLabelProvider {
@@ -90,19 +88,14 @@
if (newInput instanceof DeltaCloudImage[]) {
images = filter((DeltaCloudImage[]) newInput);
} else {
+ cloud = (DeltaCloud) newInput;
try {
- cloud = (DeltaCloud) newInput;
images = filter(cloud.getCurrImages());
} catch (Exception e) {
- IStatus status = StatusFactory.getInstance(
- IStatus.ERROR,
- Activator.PLUGIN_ID,
- e.getMessage(),
- e);
- // TODO: internationalize strings
- ErrorDialog.openError(viewer.getControl().getShell(),
+ ErrorUtils.openErrorDialog(
"Error",
- "Cloud not get images from cloud " + cloud.getName(), status);
+ "Could not get images for cloud " + cloud.getName(),
+ e, Display.getDefault().getActiveShell());
}
}
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstancePropertySource.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstancePropertySource.java 2010-11-16 16:22:05 UTC (rev 26626)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstancePropertySource.java 2010-11-16 16:27:02 UTC (rev 26627)
@@ -12,19 +12,22 @@
import java.util.List;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.ui.ErrorUtils;
import org.jboss.tools.internal.deltacloud.ui.utils.CloudViewElementUtils;
public class InstancePropertySource implements IPropertySource {
private static final String PROPERTY_NAME = "deltacloud.views.instance.name"; //$NON-NLS-1$
private static final String PROPERTY_ID = "deltacloud.views.instance.id"; //$NON-NLS-1$
- public static final String PROPERTY_OWNER = "deltacloud.views.instance.owner"; //$NON-NLS-1$
- public static final String PROPERTY_STATE = "deltacloud.views.instance.state"; //$NON-NLS-1$
+ public static final String PROPERTY_OWNER = "deltacloud.views.instance.owner"; //$NON-NLS-1$
+ public static final String PROPERTY_STATE = "deltacloud.views.instance.state"; //$NON-NLS-1$
private static final String PROPERTY_HOSTNAME = "deltacloud.views.instance.hostname"; //$NON-NLS-1$
private static final String PROPERTY_KEYNAME = "deltacloud.views.instance.keyname"; //$NON-NLS-1$
private static final String PROPERTY_PROFILEID = "deltacloud.views.instance.profileid"; //$NON-NLS-1$
@@ -39,15 +42,16 @@
private static final String PROPERTY_PROFILEID_TITLE = "PropertyProfileId.title"; //$NON-NLS-1$
private static final String PROPERTY_REALMID_TITLE = "PropertyRealmId.title"; //$NON-NLS-1$
private static final String PROPERTY_IMAGEID_TITLE = "PropertyImageId.title"; //$NON-NLS-1$
-
+
private IPropertyDescriptor[] propertyDescriptors;
private DeltaCloudInstance instance;
private DeltaCloud cloud;
+
public InstancePropertySource(CVInstanceElement element, Object o) {
cloud = CloudViewElementUtils.getCloud(element);
- instance = (DeltaCloudInstance)o;
+ instance = (DeltaCloudInstance) o;
}
-
+
@Override
public Object getEditableValue() {
return null;
@@ -56,25 +60,25 @@
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
if (propertyDescriptors == null) {
- PropertyDescriptor nameDescriptor = new PropertyDescriptor(PROPERTY_NAME,
+ PropertyDescriptor nameDescriptor = new PropertyDescriptor(PROPERTY_NAME,
CVMessages.getString(PROPERTY_NAME_TITLE));
- PropertyDescriptor idDescriptor = new PropertyDescriptor(PROPERTY_ID,
+ PropertyDescriptor idDescriptor = new PropertyDescriptor(PROPERTY_ID,
CVMessages.getString(PROPERTY_ID_TITLE));
- PropertyDescriptor ownerDescriptor = new PropertyDescriptor(PROPERTY_OWNER,
+ PropertyDescriptor ownerDescriptor = new PropertyDescriptor(PROPERTY_OWNER,
CVMessages.getString(PROPERTY_OWNER_TITLE));
- PropertyDescriptor stateDescriptor = new PropertyDescriptor(PROPERTY_STATE,
+ PropertyDescriptor stateDescriptor = new PropertyDescriptor(PROPERTY_STATE,
CVMessages.getString(PROPERTY_STATE_TITLE));
- PropertyDescriptor hardwareDescriptor = new PropertyDescriptor(PROPERTY_PROFILEID,
+ PropertyDescriptor hardwareDescriptor = new PropertyDescriptor(PROPERTY_PROFILEID,
CVMessages.getString(PROPERTY_PROFILEID_TITLE));
- PropertyDescriptor realmDescriptor = new PropertyDescriptor(PROPERTY_REALMID,
+ PropertyDescriptor realmDescriptor = new PropertyDescriptor(PROPERTY_REALMID,
CVMessages.getString(PROPERTY_REALMID_TITLE));
- PropertyDescriptor imageDescriptor = new PropertyDescriptor(PROPERTY_IMAGEID,
+ PropertyDescriptor imageDescriptor = new PropertyDescriptor(PROPERTY_IMAGEID,
CVMessages.getString(PROPERTY_IMAGEID_TITLE));
- PropertyDescriptor hostnameDescriptor = new PropertyDescriptor(PROPERTY_HOSTNAME,
+ PropertyDescriptor hostnameDescriptor = new PropertyDescriptor(PROPERTY_HOSTNAME,
CVMessages.getString(PROPERTY_HOSTNAME_TITLE));
- PropertyDescriptor keyDescriptor = new PropertyDescriptor(PROPERTY_KEYNAME,
+ PropertyDescriptor keyDescriptor = new PropertyDescriptor(PROPERTY_KEYNAME,
CVMessages.getString(PROPERTY_KEYNAME_TITLE));
-
+
propertyDescriptors = new IPropertyDescriptor[] {
nameDescriptor,
idDescriptor,
@@ -105,14 +109,30 @@
if (id.equals(PROPERTY_IMAGEID))
return instance.getImageId();
if (id.equals(PROPERTY_KEYNAME)) {
- // At present (Deltacloud 0.0.7), the keyname is omitted
- // in the data passed back from a listInstances request.
- // If an instance is running and the keyname is missing,
- // we can refresh the instance by its id and this will give us
- // the full data. We can then replace the instance so that
- // it will be complete for future requests until a refresh gets the
- // entire list again.
- String key = instance.getKey();
+ return getKey();
+ }
+ if (id.equals(PROPERTY_STATE)) {
+ return instance.getState();
+ }
+ if (id.equals(PROPERTY_HOSTNAME)) {
+ List<String> hostnames = instance.getHostNames();
+ if (hostnames.size() >= 1)
+ return hostnames.get(0);
+ }
+ return null;
+ }
+
+ private Object getKey() {
+ // At present (Deltacloud 0.0.7), the keyname is omitted
+ // in the data passed back from a listInstances request.
+ // If an instance is running and the keyname is missing,
+ // we can refresh the instance by its id and this will give us
+ // the full data. We can then replace the instance so that
+ // it will be complete for future requests until a refresh gets the
+ // entire list again.
+ String key = null;
+ try {
+ key = instance.getKey();
if (!cloud.getType().equals(DeltaCloud.MOCK_TYPE)) {
if (instance.getState().equals(DeltaCloudInstance.RUNNING) && (key == null || key.length() == 0)) {
instance = cloud.refreshInstance(instance.getId());
@@ -123,17 +143,12 @@
}
}
}
- return key;
+ } catch (DeltaCloudException e) {
+ ErrorUtils.openErrorDialog(
+ "Error", "Could not get key for instance " + instance.getName(),
+ e, Display.getDefault().getActiveShell());
}
- if (id.equals(PROPERTY_STATE)) {
- return instance.getState();
- }
- if (id.equals(PROPERTY_HOSTNAME)) {
- List<String> hostnames = instance.getHostNames();
- if (hostnames.size() >= 1)
- return hostnames.get(0);
- }
- return null;
+ return key;
}
@Override
@@ -141,7 +156,6 @@
return false;
}
-
@Override
public void resetPropertyValue(Object id) {
// do nothing
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java 2010-11-16 16:22:05 UTC (rev 26626)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java 2010-11-16 16:27:02 UTC (rev 26627)
@@ -20,11 +20,13 @@
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.core.IInstanceFilter;
+import org.jboss.tools.deltacloud.ui.ErrorUtils;
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
public class InstanceViewLabelAndContentProvider extends BaseLabelProvider implements IStructuredContentProvider,
@@ -83,7 +85,14 @@
instances = filter((DeltaCloudInstance[]) newInput);
} else {
cloud = (DeltaCloud) newInput;
- instances = filter(cloud.getCurrInstances());
+ try {
+ instances = filter(cloud.getCurrInstances());
+ } catch (Exception e) {
+ ErrorUtils.openErrorDialog(
+ "Error",
+ "Could not get instances for cloud " + cloud.getName(),
+ e, Display.getDefault().getActiveShell());
+ }
}
}
}
15 years, 5 months
JBoss Tools SVN: r26626 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-16 11:22:05 -0500 (Tue, 16 Nov 2010)
New Revision: 26626
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java
Log:
[JBIDE-7597] used ErrorUtils now (slicker code, no duplication)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java 2010-11-16 16:21:11 UTC (rev 26625)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java 2010-11-16 16:22:05 UTC (rev 26626)
@@ -56,12 +56,8 @@
try {
cloud.loadChildren();
} catch (Exception e) {
- IStatus status = StatusFactory.getInstance(
- IStatus.ERROR,
- Activator.PLUGIN_ID,
- e.getMessage(),
- e);
- // TODO: internationalize strings
+ IStatus status = StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
+ e.getMessage(), e);
return status;
}
return Status.OK_STATUS;
15 years, 5 months
JBoss Tools SVN: r26625 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core: src/org/jboss/tools/deltacloud/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-16 11:21:11 -0500 (Tue, 16 Nov 2010)
New Revision: 26625
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
[JBIDE-7597] load images / instances now throw of DeltaCloudExceptions (exceptions are not swallowed any longer)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-16 16:09:11 UTC (rev 26624)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-16 16:21:11 UTC (rev 26625)
@@ -24,6 +24,11 @@
(waitWhilePending):
(waitForState):
[JBIDE-7603] moved (duplicate) instance state waiting code to delta cloud and removed duplication
+ (loadChildren):
+ (loadInstances):
+ (getCurrInstances):
+ (refreshInstance):
+ [JBIDE-7597] load images / instances now throw of DeltaCloudExceptions (exceptions are not swallowed any longer)
2010-11-11 André Dietisheim <adietish(a)redhat.com>
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-16 16:09:11 UTC (rev 26624)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-16 16:21:11 UTC (rev 26625)
@@ -61,7 +61,7 @@
public static interface IInstanceStateMatcher {
public boolean matchesState(DeltaCloudInstance instance, String instanceState);
}
-
+
public DeltaCloud(String name, String url, String username, String passwd) throws MalformedURLException {
this(name, url, username, passwd, null, false, IImageFilter.ALL_STRING, IInstanceFilter.ALL_STRING);
}
@@ -279,20 +279,21 @@
}
}
- public DeltaCloudInstance waitWhilePending(String instanceId, IProgressMonitor pm) throws InterruptedException {
+ public DeltaCloudInstance waitWhilePending(String instanceId, IProgressMonitor pm) throws InterruptedException, DeltaCloudException {
IInstanceStateMatcher differsFromPending = new IInstanceStateMatcher() {
-
+
@Override
public boolean matchesState(DeltaCloudInstance instance, String instanceState) {
return !DeltaCloudInstance.PENDING.equals(instanceState);
}
};
- return waitForState(instanceId, differsFromPending , pm);
+ return waitForState(instanceId, differsFromPending, pm);
}
- public DeltaCloudInstance waitForState(String instanceId, final String expectedState, IProgressMonitor pm) throws InterruptedException {
+ public DeltaCloudInstance waitForState(String instanceId, final String expectedState, IProgressMonitor pm)
+ throws InterruptedException, DeltaCloudException {
IInstanceStateMatcher stateMatcher = new IInstanceStateMatcher() {
-
+
@Override
public boolean matchesState(DeltaCloudInstance instance, String instanceState) {
return expectedState != null && expectedState.equals(instanceState);
@@ -301,17 +302,18 @@
return waitForState(instanceId, stateMatcher, pm);
}
- public DeltaCloudInstance waitForState(String instanceId, IInstanceStateMatcher stateMatcher, IProgressMonitor pm) throws InterruptedException {
+ public DeltaCloudInstance waitForState(String instanceId, IInstanceStateMatcher stateMatcher, IProgressMonitor pm)
+ throws InterruptedException, DeltaCloudException {
DeltaCloudInstance instance = getInstance(instanceId);
- while(!pm.isCanceled()) {
- if (stateMatcher.matchesState(instance, instance.getState())
+ while (!pm.isCanceled()) {
+ if (stateMatcher.matchesState(instance, instance.getState())
|| instance.getState().equals(DeltaCloudInstance.TERMINATED)) {
return instance;
}
Thread.sleep(400);
instance = refreshInstance(instance.getId());
}
- return instance;
+ return instance;
}
public void removeInstanceJob(String id, Job j) {
@@ -326,10 +328,11 @@
* Furthermore listeners get informed.
*
* @return the instances
+ * @throws DeltaCloudException
*
* @see #notifyInstanceListListeners(DeltaCloudInstance[])
*/
- public DeltaCloudInstance[] loadInstances() {
+ public DeltaCloudInstance[] loadInstances() throws DeltaCloudException {
synchronized (instanceLock) {
instances = new ArrayList<DeltaCloudInstance>();
try {
@@ -338,18 +341,18 @@
DeltaCloudInstance instance = new DeltaCloudInstance(this, i.next());
instances.add(instance);
}
+ // TODO: remove notification with all instances, replace by
+ // notifying the changed instance
+ DeltaCloudInstance[] instancesArray = instances.toArray(new DeltaCloudInstance[instances.size()]);
+ notifyInstanceListListeners(instancesArray);
+ return instancesArray;
} catch (DeltaCloudClientException e) {
- Activator.log(e);
+ throw new DeltaCloudException(e);
}
- // TODO: remove notification with all instances, replace by
- // notifying the changed instance
- DeltaCloudInstance[] instancesArray = instances.toArray(new DeltaCloudInstance[instances.size()]);
- notifyInstanceListListeners(instancesArray);
- return instancesArray;
}
}
- public DeltaCloudInstance[] getCurrInstances() {
+ public DeltaCloudInstance[] getCurrInstances() throws DeltaCloudException {
synchronized (instanceLock) {
if (instances == null) {
return loadInstances();
@@ -412,7 +415,7 @@
}
}
- public DeltaCloudInstance refreshInstance(String instanceId) {
+ public DeltaCloudInstance refreshInstance(String instanceId) throws DeltaCloudException {
DeltaCloudInstance retVal = null;
try {
Instance instance = client.listInstances(instanceId);
15 years, 5 months
JBoss Tools SVN: r26624 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-16 11:09:11 -0500 (Tue, 16 Nov 2010)
New Revision: 26624
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ErrorUtils.java
Log:
removed bogus commet
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ErrorUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ErrorUtils.java 2010-11-16 16:08:22 UTC (rev 26623)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ErrorUtils.java 2010-11-16 16:09:11 UTC (rev 26624)
@@ -19,7 +19,6 @@
public class ErrorUtils {
public static IStatus openErrorDialog(final String title, final String message, Exception e, final Shell shell) {
final IStatus status = StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
- // TODO: internationalize strings
Display.getDefault().syncExec(new Runnable() {
public void run() {
ErrorDialog.openError(shell, title, message, status);
15 years, 5 months
JBoss Tools SVN: r26623 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-16 11:08:22 -0500 (Tue, 16 Nov 2010)
New Revision: 26623
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java
Log:
corrected typo
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-11-16 15:36:05 UTC (rev 26622)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-11-16 16:08:22 UTC (rev 26623)
@@ -72,9 +72,8 @@
public Object[] getChildren() {
if (!initialized) {
DeltaCloud cloud = (DeltaCloud)getElement();
- DeltaCloudImage[] images;
try {
- images = filter(cloud.getCurrImages());
+ DeltaCloudImage[] images = filter(cloud.getCurrImages());
cloud.removeImageListListener(this);
addImages(images);
initialized = true;
@@ -88,7 +87,7 @@
// TODO: internationalize strings
ErrorDialog.openError(Display.getDefault().getActiveShell(),
"Error",
- "Cloud not get images from cloud " + cloud.getName(), status);
+ "Colud not get images from cloud " + cloud.getName(), status);
}
}
return super.getChildren();
15 years, 5 months
JBoss Tools SVN: r26622 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core: src/org/jboss/tools/deltacloud/core and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-16 10:36:05 -0500 (Tue, 16 Nov 2010)
New Revision: 26622
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Image.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java
Log:
[JBIDE-7617] removed equals and hash code since it resulted in odd behaviors towards selection
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-16 15:34:20 UTC (rev 26621)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-16 15:36:05 UTC (rev 26622)
@@ -1,6 +1,11 @@
2010-11-16 André Dietisheim <adietish(a)redhat.com>
+ * src/org/jboss/tools/deltacloud/core/client/Image.java:
+ * src/org/jboss/tools/deltacloud/core/DeltaCloudImage.java:
+ * src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
* src/org/jboss/tools/deltacloud/core/client/Instance.java
+ [JBIDE-7617] removed equals and hash code since it resulted in odd behaviors towards selection
+ * src/org/jboss/tools/deltacloud/core/client/Instance.java
(canStart):
(canStop):
(canReboot):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImage.java 2010-11-16 15:34:20 UTC (rev 26621)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImage.java 2010-11-16 15:36:05 UTC (rev 26622)
@@ -42,36 +42,4 @@
public String getId() {
return image.getId();
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((image == null) ? 0 : image.hashCode());
- return result;
- }
-
- /**
- * The current strategy regarding instances is to create new instances (and
- * not update instances). We therefore need equals to be able to match
- * domain objects. We might have to change that since in my experience it is
- * not a good choice to create new instances, better is to update the ones
- * that are available in the client.
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- DeltaCloudImage other = (DeltaCloudImage) obj;
- if (image == null) {
- if (other.image != null)
- return false;
- } else if (!image.equals(other.image))
- return false;
- return true;
- }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java 2010-11-16 15:34:20 UTC (rev 26621)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java 2010-11-16 15:36:05 UTC (rev 26622)
@@ -128,42 +128,4 @@
}
return client.performInstanceAction(action);
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((givenName == null) ? 0 : givenName.hashCode());
- result = prime * result + ((instance == null) ? 0 : instance.hashCode());
- return result;
- }
-
- /**
- * The current strategy regarding instances is to create new instances (and
- * not update instances). We therefore need equals to be able to match
- * domain objects. We might have to change that since in my experience it is
- * not a good choice to create new instances, better is to update the ones
- * that are available in the client.
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- DeltaCloudInstance other = (DeltaCloudInstance) obj;
- if (givenName == null) {
- if (other.givenName != null)
- return false;
- } else if (!givenName.equals(other.givenName))
- return false;
- if (instance == null) {
- if (other.instance != null)
- return false;
- } else if (!instance.equals(other.instance))
- return false;
- return true;
- }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Image.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Image.java 2010-11-16 15:34:20 UTC (rev 26621)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Image.java 2010-11-16 15:36:05 UTC (rev 26622)
@@ -87,49 +87,4 @@
s += "Arch:\t\t" + getArchitecture() + "\n";
return s;
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((architecture == null) ? 0 : architecture.hashCode());
- result = prime * result + ((description == null) ? 0 : description.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Image other = (Image) obj;
- if (architecture == null) {
- if (other.architecture != null)
- return false;
- } else if (!architecture.equals(other.architecture))
- return false;
- if (description == null) {
- if (other.description != null)
- return false;
- } else if (!description.equals(other.description))
- return false;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- if (ownerId == null) {
- if (other.ownerId != null)
- return false;
- } else if (!ownerId.equals(other.ownerId))
- return false;
- return true;
- }
-
-
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java 2010-11-16 15:34:20 UTC (rev 26621)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java 2010-11-16 15:36:05 UTC (rev 26622)
@@ -266,77 +266,4 @@
return s;
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((cpu == null) ? 0 : cpu.hashCode());
- result = prime * result + ((imageId == null) ? 0 : imageId.hashCode());
- result = prime * result + ((keyname == null) ? 0 : keyname.hashCode());
- result = prime * result + ((memory == null) ? 0 : memory.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode());
- result = prime * result + ((profileId == null) ? 0 : profileId.hashCode());
- result = prime * result + ((realmId == null) ? 0 : realmId.hashCode());
- result = prime * result + ((storage == null) ? 0 : storage.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Instance other = (Instance) obj;
- if (cpu == null) {
- if (other.cpu != null)
- return false;
- } else if (!cpu.equals(other.cpu))
- return false;
- if (imageId == null) {
- if (other.imageId != null)
- return false;
- } else if (!imageId.equals(other.imageId))
- return false;
- if (keyname == null) {
- if (other.keyname != null)
- return false;
- } else if (!keyname.equals(other.keyname))
- return false;
- if (memory == null) {
- if (other.memory != null)
- return false;
- } else if (!memory.equals(other.memory))
- return false;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- if (ownerId == null) {
- if (other.ownerId != null)
- return false;
- } else if (!ownerId.equals(other.ownerId))
- return false;
- if (profileId == null) {
- if (other.profileId != null)
- return false;
- } else if (!profileId.equals(other.profileId))
- return false;
- if (realmId == null) {
- if (other.realmId != null)
- return false;
- } else if (!realmId.equals(other.realmId))
- return false;
- if (storage == null) {
- if (other.storage != null)
- return false;
- } else if (!storage.equals(other.storage))
- return false;
- return true;
- }
}
15 years, 5 months
JBoss Tools SVN: r26621 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-11-16 10:34:20 -0500 (Tue, 16 Nov 2010)
New Revision: 26621
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java
Log:
JBIDE-7615
https://jira.jboss.org/browse/JBIDE-7615
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java 2010-11-16 14:52:15 UTC (rev 26620)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java 2010-11-16 15:34:20 UTC (rev 26621)
@@ -82,6 +82,12 @@
ISeamComponent c = seamProject.getComponent("authenticator");
assertNotNull("War project must see component 'authenticator' declared in ejb project", c);
+
+ c = seamProject.getComponent("org.jboss.seam.core.interpolator");
+ assertNotNull("War project must see component 'org.jboss.seam.core.interpolator' declared in ejb project", c);
+
+ c = seamProject.getComponent("org.jboss.seam.security.credentials");
+ assertNotNull("War project must see component 'org.jboss.seam.security.credentials' declared in ejb project", c);
}
/**
15 years, 5 months
JBoss Tools SVN: r26620 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-11-16 09:52:15 -0500 (Tue, 16 Nov 2010)
New Revision: 26620
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
Log:
JBIDE-7615
https://jira.jboss.org/browse/JBIDE-7615
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2010-11-16 14:43:55 UTC (rev 26619)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2010-11-16 14:52:15 UTC (rev 26620)
@@ -155,10 +155,10 @@
}
if(root == null) {
root = javaProject.findPackageFragmentRoot(new Path(location));
- if(root != null) {
- process(root, ds);
- }
}
+ if(root != null) {
+ process(root, ds);
+ }
}
}
15 years, 5 months
JBoss Tools SVN: r26619 - in trunk: tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-11-16 09:43:55 -0500 (Tue, 16 Nov 2010)
New Revision: 26619
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/ManipulatingELValueTest.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotTableExt.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/PageDesignTestCase.java
Log:
Added Manipulating EL Value Test
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotTableExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotTableExt.java 2010-11-16 14:35:12 UTC (rev 26618)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotTableExt.java 2010-11-16 14:43:55 UTC (rev 26619)
@@ -16,6 +16,7 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem;
import org.jboss.tools.ui.bot.ext.Timing;
/**
@@ -53,5 +54,37 @@
bot.text(oldValue, 0).setText(newValue);
}
+ /**
+ * Returns first Table Item from table which has column values specified by columns parameter
+ * @param columns
+ * @return
+ */
+ public SWTBotTableItem getTableItem (String... columns){
+
+ SWTBotTableItem result = null;
+
+ int rowIndex = 0;
+ while (result == null && rowIndex < swtBotTable.rowCount()) {
+ int columnIndex = 0;
+ boolean isEqual = true;
+ while (isEqual && columnIndex < columns.length){
+ if (columns[columnIndex] == null ||
+ swtBotTable.cell(rowIndex, columnIndex).trim().equals(columns[columnIndex].trim())){
+ columnIndex++;
+ }
+ else{
+ isEqual = false;
+ }
+ }
+ if (isEqual) {
+ result = swtBotTable.getTableItem(rowIndex);
+ } else {
+ rowIndex++;
+ }
+ }
+
+ return result;
+
+ }
}
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-11-16 14:35:12 UTC (rev 26618)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-11-16 14:43:55 UTC (rev 26619)
@@ -608,6 +608,12 @@
public static final String SUBSTITUTED_EL_EXPRESSIONS_TAB = "Substituted EL expressions";
public static final String SUBSTITUTED_EL_EXPRESSIONS_EL_NAME = "El Name*";
public static final String SUBSTITUTED_EL_EXPRESSIONS_VALUE = "Value";
+
+ public static final String SUBSTITUTED_EL_EXPRESSIONS_SCOPE_PAGE = "Page: Only This Page";
+ public static final String SUBSTITUTED_EL_EXPRESSIONS_SCOPE_FOLDER = "Folder: Any Page at the Same Folder";
+ public static final String SUBSTITUTED_EL_EXPRESSIONS_SCOPE_PROJECT = "Project: Any Page at the Same Project";
+ public static final String SUBSTITUTED_EL_EXPRESSIONS_FOLDER_SCOPE_TABLE_LABEL = "Folder";
+
}
public static class AddTaglibReferenceDialog{
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-11-16 14:35:12 UTC (rev 26618)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-11-16 14:43:55 UTC (rev 26619)
@@ -17,6 +17,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.AddSubstitutedELExpressionFolderScopeTest;
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.EditingELValueTest;
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.IncludedTagLibsTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.ManipulatingELValueTest;
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.SubstitutedELExressionsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.ToolbarTextFormattingTest;
import org.jboss.tools.vpe.ui.bot.test.editor.preferences.AlwaysHideSelectionBarWithoutPromptTest;
@@ -82,6 +83,7 @@
suite.addTestSuite(SubstitutedELExressionsTest.class);
suite.addTestSuite(MinMaxPanesTest.class);
suite.addTestSuite(EditingELValueTest.class);
+ suite.addTestSuite(ManipulatingELValueTest.class);
return new TestSetup(suite);
}
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2010-11-16 14:35:12 UTC (rev 26618)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2010-11-16 14:43:55 UTC (rev 26619)
@@ -3,6 +3,7 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import org.eclipse.core.runtime.FileLocator;
@@ -445,13 +446,20 @@
/**
* Creates new empty JSP page within test project
* @param pageName
+ * @param subDirs - complete path to page location within workspace
*/
- protected void createJspPage (String pageName){
- SWTBotTreeItem tiPages = packageExplorer.selectTreeItem("pages", new String[] {VPEAutoTestCase.JBT_TEST_PROJECT_NAME,"WebContent"});
- tiPages.expand();
+ protected void createJspPage (String pageName , String... subDirs){
+ SWTBotTreeItem tiPageParent = null;
+ if (subDirs == null || subDirs.length == 0) {
+ tiPageParent = packageExplorer.selectTreeItem("pages", new String[] {VPEAutoTestCase.JBT_TEST_PROJECT_NAME,"WebContent"});
+ }
+ else{
+ String[] subPath = Arrays.copyOfRange(subDirs, 0, subDirs.length - 1);
+ tiPageParent = packageExplorer.selectTreeItem(subDirs[subDirs.length - 1], subPath);
+ }
+ tiPageParent.expand();
try {
- tiPages.getNode(pageName);
- openPage(pageName);
+ tiPageParent.getNode(pageName).doubleClick();
} catch (WidgetNotFoundException e) {
open.newObject(ActionItem.NewObject.WebJSP.LABEL);
bot.shell(IDELabel.Shell.NEW_JSP_FILE).activate();
@@ -459,8 +467,9 @@
bot.button(IDELabel.Button.NEXT).click();
bot.table().select(IDELabel.NewJSPFileDialog.JSP_TEMPLATE);
bot.button(IDELabel.Button.FINISH).click();
- bot.sleep(Timing.time2S());
}
+ bot.sleep(Timing.time2S());
+
}
/**
* Deletes page pageName
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/ManipulatingELValueTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/ManipulatingELValueTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/ManipulatingELValueTest.java 2010-11-16 14:43:55 UTC (rev 26619)
@@ -0,0 +1,125 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2010 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.pagedesign;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.vpe.ui.bot.test.tools.SWTBotWebBrowser;
+/**
+ * Tests manipulating of EL value
+ * @author vlado pakan
+ *
+ */
+public class ManipulatingELValueTest extends PageDesignTestCase {
+
+ private SWTBotExt botExt = null;
+ private static final String TEST_IN_PAGE_FOLDER_PAGE_NAME = "testInPageFolder.jsp";
+ private static final String TEST_IN_MAIN_FOLDER_PAGE_NAME = "testInMainFolder.jsp";
+ private static final String EL_VARIABLE_NAME = "test.variable";
+ private static final String EL_IN_PAGE_FOLDER_VARIABLE_VALUE = "EL test value in Page folder";
+ private static final String EL_IN_MAIN_FOLDER_VARIABLE_VALUE = "EL test value in main folder";
+ private static final String PAGE_TEXT = "<%@ taglib uri=\"http://java.sun.com/jsf/html\" prefix=\"h\" %>\n" +
+ "<html>\n" +
+ " <body>\n" +
+ " <h:outputText value = \"#{" + ManipulatingELValueTest.EL_VARIABLE_NAME + "}\"/>\n" +
+ " </body>\n" +
+ "</html>";
+ private SWTBotEclipseEditor testInPageFolderEditor;
+ private SWTBotEclipseEditor testInMainFolderEditor;
+
+ public ManipulatingELValueTest() {
+ super();
+ botExt = new SWTBotExt();
+ }
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ eclipse.maximizeActiveShell();
+ }
+ /**
+ * Tests manipulating of EL value
+ */
+ public void testManipulatingELValue(){
+ createJspPage(ManipulatingELValueTest.TEST_IN_PAGE_FOLDER_PAGE_NAME);
+ testInPageFolderEditor = botExt.editorByTitle(ManipulatingELValueTest.TEST_IN_PAGE_FOLDER_PAGE_NAME).toTextEditor();
+ testInPageFolderEditor.setText(ManipulatingELValueTest.PAGE_TEXT);
+ createJspPage(ManipulatingELValueTest.TEST_IN_MAIN_FOLDER_PAGE_NAME , JBT_TEST_PROJECT_NAME , "WebContent");
+ testInMainFolderEditor = botExt.editorByTitle(ManipulatingELValueTest.TEST_IN_MAIN_FOLDER_PAGE_NAME).toTextEditor();
+ testInMainFolderEditor.setText(ManipulatingELValueTest.PAGE_TEXT);
+ testInPageFolderEditor.show();
+ addELSubstitution(ManipulatingELValueTest.EL_VARIABLE_NAME, ManipulatingELValueTest.EL_IN_PAGE_FOLDER_VARIABLE_VALUE,
+ IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_SCOPE_FOLDER);
+ testInPageFolderEditor.save();
+ bot.sleep(Timing.time2S());
+ SWTBotWebBrowser webBrowserInPageFolder = new SWTBotWebBrowser(ManipulatingELValueTest.TEST_IN_PAGE_FOLDER_PAGE_NAME, botExt);
+ assertVisualEditorContainsNodeWithValue(webBrowserInPageFolder,
+ ManipulatingELValueTest.EL_IN_PAGE_FOLDER_VARIABLE_VALUE,
+ ManipulatingELValueTest.TEST_IN_PAGE_FOLDER_PAGE_NAME);
+ testInMainFolderEditor.show();
+ addELSubstitution(ManipulatingELValueTest.EL_VARIABLE_NAME, ManipulatingELValueTest.EL_IN_MAIN_FOLDER_VARIABLE_VALUE,
+ IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_SCOPE_FOLDER);
+ testInMainFolderEditor.save();
+ bot.sleep(Timing.time2S());
+ SWTBotWebBrowser webBrowserInMainFolder = new SWTBotWebBrowser(ManipulatingELValueTest.TEST_IN_MAIN_FOLDER_PAGE_NAME, botExt);
+ assertVisualEditorContainsNodeWithValue(webBrowserInMainFolder,
+ ManipulatingELValueTest.EL_IN_MAIN_FOLDER_VARIABLE_VALUE,
+ ManipulatingELValueTest.TEST_IN_MAIN_FOLDER_PAGE_NAME);
+ // Edit EL value from Main Folder Page
+ testInMainFolderEditor.show();
+ editELSubstitution(ManipulatingELValueTest.EL_VARIABLE_NAME,
+ IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_FOLDER_SCOPE_TABLE_LABEL,
+ ManipulatingELValueTest.EL_IN_MAIN_FOLDER_VARIABLE_VALUE,
+ IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_SCOPE_PROJECT);
+ assertVisualEditorContainsNodeWithValue(webBrowserInMainFolder,
+ ManipulatingELValueTest.EL_IN_MAIN_FOLDER_VARIABLE_VALUE,
+ ManipulatingELValueTest.TEST_IN_MAIN_FOLDER_PAGE_NAME);
+ testInPageFolderEditor.show();
+ assertVisualEditorContainsNodeWithValue(webBrowserInPageFolder,
+ ManipulatingELValueTest.EL_IN_PAGE_FOLDER_VARIABLE_VALUE,
+ ManipulatingELValueTest.TEST_IN_PAGE_FOLDER_PAGE_NAME);
+ // Delete Folder scoped definition of EL Variable
+ deleteELSubstitution(ManipulatingELValueTest.EL_VARIABLE_NAME,
+ IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_FOLDER_SCOPE_TABLE_LABEL);
+ assertVisualEditorContainsNodeWithValue(webBrowserInMainFolder,
+ ManipulatingELValueTest.EL_IN_MAIN_FOLDER_VARIABLE_VALUE,
+ ManipulatingELValueTest.TEST_IN_MAIN_FOLDER_PAGE_NAME);
+ assertVisualEditorContainsNodeWithValue(webBrowserInPageFolder,
+ ManipulatingELValueTest.EL_IN_MAIN_FOLDER_VARIABLE_VALUE,
+ ManipulatingELValueTest.TEST_IN_PAGE_FOLDER_PAGE_NAME);
+ }
+
+ @Override
+ protected void closeUnuseDialogs() {
+
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return false;
+ }
+ @Override
+ protected void tearDown() throws Exception {
+
+ deleteAllELSubstitutions();
+
+ if (testInPageFolderEditor != null){
+ testInPageFolderEditor.close();
+ }
+ if (testInMainFolderEditor != null){
+ testInMainFolderEditor.close();
+ }
+
+ super.tearDown();
+ }
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/ManipulatingELValueTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/PageDesignTestCase.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/PageDesignTestCase.java 2010-11-16 14:35:12 UTC (rev 26618)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/PageDesignTestCase.java 2010-11-16 14:43:55 UTC (rev 26619)
@@ -8,6 +8,8 @@
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotTableExt;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.vpe.ui.bot.test.Activator;
import org.jboss.tools.vpe.ui.bot.test.editor.VPEEditorTestCase;
@@ -52,6 +54,7 @@
* Deletes all defined EL Substitutions. VPE has to be opened when called this method
*/
public void deleteAllELSubstitutions(){
+ bot.toolbarButtonWithTooltip(PAGE_DESIGN).click();
SWTBot optionsDialogBot = bot.shell(IDELabel.Shell.PAGE_DESIGN_OPTIONS).activate().bot();
optionsDialogBot.tabItem(IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_TAB).activate();
SWTBotTable elVariablesTable = optionsDialogBot.table();
@@ -60,5 +63,63 @@
optionsDialogBot.button(IDELabel.Button.REMOVE).click();
}
optionsDialogBot.button(IDELabel.Button.OK).click();
+ bot.sleep(Timing.time2S());
}
+ /**
+ * Adds EL Definition
+ * @param elName
+ * @param value
+ * @param scope
+ */
+ public void addELSubstitution (String elName , String value , String scope){
+ bot.toolbarButtonWithTooltip(PAGE_DESIGN).click();
+ SWTBot optionsDialogBot = bot.shell(IDELabel.Shell.PAGE_DESIGN_OPTIONS).activate().bot();
+ optionsDialogBot.tabItem(IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_TAB).activate();
+ optionsDialogBot.button(IDELabel.Button.ADD_WITHOUT_DOTS).click();
+ SWTBot addELReferenceDialogBot = optionsDialogBot.shell(IDELabel.Shell.ADD_EL_REFERENCE).activate().bot();
+ addELReferenceDialogBot.textWithLabel(IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_EL_NAME)
+ .setText(elName);
+ addELReferenceDialogBot.textWithLabel(IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_VALUE)
+ .setText(value);
+ addELReferenceDialogBot.radio(scope).click();
+ addELReferenceDialogBot.button(IDELabel.Button.FINISH).click();
+ optionsDialogBot.button(IDELabel.Button.OK).click();
+ }
+ /**
+ * Edits EL Variable elName Definition
+ * @param elName
+ * @param oldScope
+ * @param newValue
+ * @param scopeRadioLabel
+ */
+ public void editELSubstitution (String elName , String oldScope, String newValue , String scopeRadioLabel){
+ bot.toolbarButtonWithTooltip(PAGE_DESIGN).click();
+ SWTBot optionsDialogBot = bot.shell(IDELabel.Shell.PAGE_DESIGN_OPTIONS).activate().bot();
+ optionsDialogBot.tabItem(IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_TAB).activate();
+ new SWTBotTableExt(optionsDialogBot.table())
+ .getTableItem(oldScope,elName)
+ .select();
+ optionsDialogBot.button(IDELabel.Button.EDIT_WITHOUT_DOTS).click();
+ SWTBot addELReferenceDialogBot = optionsDialogBot.shell(IDELabel.Shell.ADD_EL_REFERENCE).activate().bot();
+ addELReferenceDialogBot.textWithLabel(IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_VALUE)
+ .setText(newValue);
+ addELReferenceDialogBot.radio(scopeRadioLabel).click();
+ addELReferenceDialogBot.button(IDELabel.Button.FINISH).click();
+ optionsDialogBot.button(IDELabel.Button.OK).click();
+ }
+ /**
+ * Deletes EL Variable elName Definition
+ * @param elName
+ * @param scope
+ */
+ public void deleteELSubstitution (String elName , String scope){
+ bot.toolbarButtonWithTooltip(PAGE_DESIGN).click();
+ SWTBot optionsDialogBot = bot.shell(IDELabel.Shell.PAGE_DESIGN_OPTIONS).activate().bot();
+ optionsDialogBot.tabItem(IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_TAB).activate();
+ new SWTBotTableExt(optionsDialogBot.table())
+ .getTableItem(scope,elName)
+ .select();
+ optionsDialogBot.button(IDELabel.Button.REMOVE).click();
+ optionsDialogBot.button(IDELabel.Button.OK).click();
+ }
}
15 years, 5 months
JBoss Tools SVN: r26618 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-16 09:35:12 -0500 (Tue, 16 Nov 2010)
New Revision: 26618
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java
Log:
[JBIDE-7603] cleanup unused imports
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java 2010-11-16 14:34:34 UTC (rev 26617)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java 2010-11-16 14:35:12 UTC (rev 26618)
@@ -13,7 +13,6 @@
import org.eclipse.core.databinding.conversion.Converter;
import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
-import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudException;
15 years, 5 months