JBoss Tools SVN: r27992 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/commands and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-07 12:04:22 -0500 (Fri, 07 Jan 2011)
New Revision: 27992
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java
Log:
[JBIDE-7557] implemented capability to destroy the destroyable instances out of a bunch of instances (destroyables and non-destroyables)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-07 17:00:22 UTC (rev 27991)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-07 17:04:22 UTC (rev 27992)
@@ -1,9 +1,14 @@
2011-01-07 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* plugin.xml:
+ * src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java
+ (destroyWithDialog):
+ (getDestroyableInstances):
+ [JBIDE-7557] implemented capability to stop the running instances out of a bunch of instances (running and stopped ones)
+ * plugin.xml:
* src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java
(rebootWithDialog):
- (getRunningInstances):
+ (getRebootableInstances):
[JBIDE-7557] implemented capability to stop the running instances out of a bunch of instances (running and stopped ones)
* plugin.xml:
* src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-01-07 17:00:22 UTC (rev 27991)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-01-07 17:04:22 UTC (rev 27992)
@@ -233,26 +233,19 @@
<handler
class="org.jboss.tools.deltacloud.ui.commands.DestroyInstanceHandler"
commandId="org.jboss.tools.deltacloud.ui.destroyinstance">
- <activeWhen>
+ <enabledWhen>
<with
variable="selection">
- <iterate operator="and">
- <and>
- <adapt
- type="org.jboss.tools.deltacloud.core.DeltaCloudInstance">
- <test property="org.jboss.tools.deltacloud.ui.commands.canDestroy"
+ <iterate operator="or">
+ <adapt
+ type="org.jboss.tools.deltacloud.core.DeltaCloudInstance">
+ <test property="org.jboss.tools.deltacloud.ui.commands.canDestroy"
value="true"/>
- </adapt>
- </and>
+ </adapt>
</iterate>
</with>
- </activeWhen>
- <enabledWhen>
- <with
- variable="selection">
- <count value="+" />
- </with>
</enabledWhen>
+
</handler>
<handler
class="org.jboss.tools.deltacloud.ui.commands.CreateInstanceFromAnyImageHandler"
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java 2011-01-07 17:00:22 UTC (rev 27991)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java 2011-01-07 17:04:22 UTC (rev 27992)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.deltacloud.ui.commands;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.commands.ExecutionEvent;
@@ -59,17 +60,29 @@
private void destroyWithDialog(IStructuredSelection selection) {
List<DeltaCloudInstance> deltaCloudInstances =
UIUtils.adapt((List<DeltaCloudInstance>) selection.toList(),DeltaCloudInstance.class);
+ List<DeltaCloudInstance> destroyableInstances = getDestroyableInstances(deltaCloudInstances);
DeltaCloudInstanceDialog dialog = new DeltaCloudInstanceDialog(
UIUtils.getActiveShell()
- , deltaCloudInstances
+ , destroyableInstances
, CVMessages.getString(DESTROY_INSTANCE_TITLE)
, CVMessages.getString(DESTROY_INSTANCE_MSG));
- dialog.setInitialElementSelections(deltaCloudInstances);
+ dialog.setInitialElementSelections(destroyableInstances);
if (Dialog.OK == dialog.open()) {
destroyInstances(dialog.getResult());
}
}
+
+ private List<DeltaCloudInstance> getDestroyableInstances(List<DeltaCloudInstance> deltaCloudInstances) {
+ ArrayList<DeltaCloudInstance> stoppedInstances = new ArrayList<DeltaCloudInstance>();
+ for (DeltaCloudInstance instance : deltaCloudInstances) {
+ if (instance.canDestroy()) {
+ stoppedInstances.add(instance);
+ }
+ }
+ return stoppedInstances;
+ }
+
private void destroyInstances(Object[] cvInstances) {
for (int i = 0; i < cvInstances.length; i++) {
destroyInstance((DeltaCloudInstance) cvInstances[i]);
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java 2011-01-07 17:00:22 UTC (rev 27991)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java 2011-01-07 17:04:22 UTC (rev 27992)
@@ -61,22 +61,22 @@
private void stopWithDialog(IStructuredSelection selection) {
List<DeltaCloudInstance> deltaCloudInstances = UIUtils.adapt((List<DeltaCloudInstance>) selection.toList(),
DeltaCloudInstance.class);
- List<DeltaCloudInstance> runningInstances = getRunningInstances(deltaCloudInstances);
+ List<DeltaCloudInstance> stoppableInstances = getStoppableInstances(deltaCloudInstances);
DeltaCloudInstanceDialog dialog = new DeltaCloudInstanceDialog(
UIUtils.getActiveShell()
- , runningInstances
+ , stoppableInstances
, CVMessages.getString(STOP_INSTANCES_DIALOG_TITLE)
, CVMessages.getString(STOP_INSTANCES_DIALOG_MSG));
- dialog.setInitialElementSelections(runningInstances);
+ dialog.setInitialElementSelections(stoppableInstances);
if (Dialog.OK == dialog.open()) {
stopInstances(dialog.getResult());
}
}
- private List<DeltaCloudInstance> getRunningInstances(List<DeltaCloudInstance> deltaCloudInstances) {
+ private List<DeltaCloudInstance> getStoppableInstances(List<DeltaCloudInstance> deltaCloudInstances) {
ArrayList<DeltaCloudInstance> stoppedInstances = new ArrayList<DeltaCloudInstance>();
for (DeltaCloudInstance instance : deltaCloudInstances) {
- if (instance.isRunning()) {
+ if (instance.canStop()) {
stoppedInstances.add(instance);
}
}
13 years, 5 months
JBoss Tools SVN: r27991 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/commands and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-07 12:00:22 -0500 (Fri, 07 Jan 2011)
New Revision: 27991
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java
Log:
[JBIDE-7557] implemented capability to reboot the running instances out of a bunch of instances (running and stopped ones)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-07 16:56:22 UTC (rev 27990)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-07 17:00:22 UTC (rev 27991)
@@ -1,6 +1,11 @@
2011-01-07 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* plugin.xml:
+ * src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java
+ (rebootWithDialog):
+ (getRunningInstances):
+ [JBIDE-7557] implemented capability to stop the running instances out of a bunch of instances (running and stopped ones)
+ * plugin.xml:
* src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java
(stopWithDialog):
(getRunningInstances):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-01-07 16:56:22 UTC (rev 27990)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-01-07 17:00:22 UTC (rev 27991)
@@ -217,25 +217,17 @@
<handler
class="org.jboss.tools.deltacloud.ui.commands.RebootInstanceHandler"
commandId="org.jboss.tools.deltacloud.ui.rebootinstance">
- <activeWhen>
+ <enabledWhen>
<with
variable="selection">
- <iterate operator="and">
- <and>
- <adapt
- type="org.jboss.tools.deltacloud.core.DeltaCloudInstance">
- <test property="org.jboss.tools.deltacloud.ui.commands.canReboot"
+ <iterate operator="or">
+ <adapt
+ type="org.jboss.tools.deltacloud.core.DeltaCloudInstance">
+ <test property="org.jboss.tools.deltacloud.ui.commands.canReboot"
value="true"/>
- </adapt>
- </and>
+ </adapt>
</iterate>
</with>
- </activeWhen>
- <enabledWhen>
- <with
- variable="selection">
- <count value="+" />
- </with>
</enabledWhen>
</handler>
<handler
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java 2011-01-07 16:56:22 UTC (rev 27990)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java 2011-01-07 17:00:22 UTC (rev 27991)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.deltacloud.ui.commands;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.commands.ExecutionEvent;
@@ -60,17 +61,28 @@
@SuppressWarnings("unchecked")
private void rebootWithDialog(IStructuredSelection selection) {
List<DeltaCloudInstance> deltaCloudInstances = UIUtils.adapt((List<DeltaCloudInstance>) selection.toList(), DeltaCloudInstance.class);
+ List<DeltaCloudInstance> rebootableInstances = getRebootableInstances(deltaCloudInstances);
DeltaCloudInstanceDialog dialog = new DeltaCloudInstanceDialog(
UIUtils.getActiveShell()
- , deltaCloudInstances
+ , rebootableInstances
, CVMessages.getString(REBOOT_INSTANCE_TITLE)
, CVMessages.getString(REBOOT_INSTANCE_MSG));
- dialog.setInitialElementSelections(deltaCloudInstances);
+ dialog.setInitialElementSelections(rebootableInstances);
if (Dialog.OK == dialog.open()) {
rebootInstances(dialog.getResult());
}
}
+ private List<DeltaCloudInstance> getRebootableInstances(List<DeltaCloudInstance> deltaCloudInstances) {
+ ArrayList<DeltaCloudInstance> stoppedInstances = new ArrayList<DeltaCloudInstance>();
+ for (DeltaCloudInstance instance : deltaCloudInstances) {
+ if (instance.canReboot()) {
+ stoppedInstances.add(instance);
+ }
+ }
+ return stoppedInstances;
+ }
+
private void rebootInstances(Object[] deltaCloudInstances) {
for (int i = 0; i < deltaCloudInstances.length; i++) {
rebootInstance((DeltaCloudInstance) deltaCloudInstances[i]);
13 years, 5 months
JBoss Tools SVN: r27990 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/commands and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-07 11:56:22 -0500 (Fri, 07 Jan 2011)
New Revision: 27990
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java
Log:
[JBIDE-7557] implemented capability to stop the running instances out of a bunch of instances (running and stopped ones)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-07 16:50:37 UTC (rev 27989)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-07 16:56:22 UTC (rev 27990)
@@ -1,11 +1,15 @@
2011-01-07 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+ * plugin.xml:
+ * src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java
+ (stopWithDialog):
+ (getRunningInstances):
+ [JBIDE-7557] implemented capability to stop the running instances out of a bunch of instances (running and stopped ones)
* src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java
(startWithDialog):
(getStoppedInstances):
[JBIDE-7557] implemented capability to start the stopped instances out of a bunch of instances (running and stopped ones)
-
- * plugin.xml:
+
* src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java (execute):
[JBIDE-7916] added ability to refresh several clouds
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-01-07 16:50:37 UTC (rev 27989)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-01-07 16:56:22 UTC (rev 27990)
@@ -201,25 +201,17 @@
<handler
class="org.jboss.tools.deltacloud.ui.commands.StopInstanceHandler"
commandId="org.jboss.tools.deltacloud.ui.stopinstance">
- <activeWhen>
+ <enabledWhen>
<with
variable="selection">
- <iterate operator="and">
- <and>
- <adapt
- type="org.jboss.tools.deltacloud.core.DeltaCloudInstance">
- <test property="org.jboss.tools.deltacloud.ui.commands.canStop"
+ <iterate operator="or">
+ <adapt
+ type="org.jboss.tools.deltacloud.core.DeltaCloudInstance">
+ <test property="org.jboss.tools.deltacloud.ui.commands.canStop"
value="true"/>
- </adapt>
- </and>
+ </adapt>
</iterate>
</with>
- </activeWhen>
- <enabledWhen>
- <with
- variable="selection">
- <count value="+" />
- </with>
</enabledWhen>
</handler>
<handler
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java 2011-01-07 16:50:37 UTC (rev 27989)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java 2011-01-07 16:56:22 UTC (rev 27990)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.deltacloud.ui.commands;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.commands.ExecutionEvent;
@@ -60,17 +61,28 @@
private void stopWithDialog(IStructuredSelection selection) {
List<DeltaCloudInstance> deltaCloudInstances = UIUtils.adapt((List<DeltaCloudInstance>) selection.toList(),
DeltaCloudInstance.class);
+ List<DeltaCloudInstance> runningInstances = getRunningInstances(deltaCloudInstances);
DeltaCloudInstanceDialog dialog = new DeltaCloudInstanceDialog(
UIUtils.getActiveShell()
- , deltaCloudInstances
+ , runningInstances
, CVMessages.getString(STOP_INSTANCES_DIALOG_TITLE)
, CVMessages.getString(STOP_INSTANCES_DIALOG_MSG));
- dialog.setInitialElementSelections(deltaCloudInstances);
+ dialog.setInitialElementSelections(runningInstances);
if (Dialog.OK == dialog.open()) {
stopInstances(dialog.getResult());
}
}
+ private List<DeltaCloudInstance> getRunningInstances(List<DeltaCloudInstance> deltaCloudInstances) {
+ ArrayList<DeltaCloudInstance> stoppedInstances = new ArrayList<DeltaCloudInstance>();
+ for (DeltaCloudInstance instance : deltaCloudInstances) {
+ if (instance.isRunning()) {
+ stoppedInstances.add(instance);
+ }
+ }
+ return stoppedInstances;
+ }
+
private void stopInstances(Object[] deltaCloudInstances) {
for (int i = 0; i < deltaCloudInstances.length; i++) {
stopInstance((DeltaCloudInstance) deltaCloudInstances[i]);
13 years, 5 months
JBoss Tools SVN: r27989 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/commands and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-07 11:50:37 -0500 (Fri, 07 Jan 2011)
New Revision: 27989
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java
Log:
[JBIDE-7557] implemented capability to start the stopped instances out of a bunch of instances (running and stopped ones)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-07 16:41:44 UTC (rev 27988)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-07 16:50:37 UTC (rev 27989)
@@ -1,5 +1,10 @@
2011-01-07 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+ * src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java
+ (startWithDialog):
+ (getStoppedInstances):
+ [JBIDE-7557] implemented capability to start the stopped instances out of a bunch of instances (running and stopped ones)
+
* plugin.xml:
* src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java (execute):
[JBIDE-7916] added ability to refresh several clouds
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-01-07 16:41:44 UTC (rev 27988)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-01-07 16:50:37 UTC (rev 27989)
@@ -185,25 +185,17 @@
<handler
class="org.jboss.tools.deltacloud.ui.commands.StartInstanceHandler"
commandId="org.jboss.tools.deltacloud.ui.startinstance">
- <activeWhen>
+ <enabledWhen>
<with
variable="selection">
- <iterate operator="and">
- <and>
- <adapt
- type="org.jboss.tools.deltacloud.core.DeltaCloudInstance">
- <test property="org.jboss.tools.deltacloud.ui.commands.canStart"
+ <iterate operator="or">
+ <adapt
+ type="org.jboss.tools.deltacloud.core.DeltaCloudInstance">
+ <test property="org.jboss.tools.deltacloud.ui.commands.canStart"
value="true"/>
- </adapt>
- </and>
+ </adapt>
</iterate>
</with>
- </activeWhen>
- <enabledWhen>
- <with
- variable="selection">
- <count value="+" />
- </with>
</enabledWhen>
</handler>
<handler
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java 2011-01-07 16:41:44 UTC (rev 27988)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java 2011-01-07 16:50:37 UTC (rev 27989)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.deltacloud.ui.commands;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.commands.ExecutionEvent;
@@ -61,17 +62,28 @@
@SuppressWarnings("unchecked")
private void startWithDialog(IStructuredSelection selection) {
List<DeltaCloudInstance> deltaCloudInstances = UIUtils.adapt((List<DeltaCloudInstance>) selection.toList(), DeltaCloudInstance.class);
+ List<DeltaCloudInstance> stoppedInstances = getStoppedInstances(deltaCloudInstances);
DeltaCloudInstanceDialog dialog = new DeltaCloudInstanceDialog(
UIUtils.getActiveShell()
- , deltaCloudInstances
+ , stoppedInstances
, CVMessages.getString(START_INSTANCES_DIALOG_TITLE)
, CVMessages.getString(START_INSTANCES_DIALOG_MSG));
- dialog.setInitialElementSelections(deltaCloudInstances);
+ dialog.setInitialElementSelections(stoppedInstances);
if (Dialog.OK == dialog.open()) {
startInstances(dialog.getResult());
}
}
+ private List<DeltaCloudInstance> getStoppedInstances(List<DeltaCloudInstance> deltaCloudInstances) {
+ ArrayList<DeltaCloudInstance> stoppedInstances = new ArrayList<DeltaCloudInstance>();
+ for (DeltaCloudInstance instance : deltaCloudInstances) {
+ if (instance.isStopped()) {
+ stoppedInstances.add(instance);
+ }
+ }
+ return stoppedInstances;
+ }
+
private void startInstances(Object[] deltaCloudInstances) {
for (int i = 0; i < deltaCloudInstances.length; i++) {
Assert.isTrue(deltaCloudInstances[i] instanceof DeltaCloudInstance);
13 years, 5 months
JBoss Tools SVN: r27988 - trunk/gwt/plugins/org.jboss.tools.gwt.core/META-INF.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-07 11:41:44 -0500 (Fri, 07 Jan 2011)
New Revision: 27988
Modified:
trunk/gwt/plugins/org.jboss.tools.gwt.core/META-INF/MANIFEST.MF
Log:
[JBIDE-8012] set dependency to the gwt sdk to be optional
Modified: trunk/gwt/plugins/org.jboss.tools.gwt.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/gwt/plugins/org.jboss.tools.gwt.core/META-INF/MANIFEST.MF 2011-01-07 16:38:51 UTC (rev 27987)
+++ trunk/gwt/plugins/org.jboss.tools.gwt.core/META-INF/MANIFEST.MF 2011-01-07 16:41:44 UTC (rev 27988)
@@ -8,7 +8,7 @@
Require-Bundle:
org.jboss.tools.common;bundle-version="[3.2.0,4.0.0)",
com.google.gwt.eclipse.core;bundle-version="[1.3.3,2.0.0)",
- com.google.gwt.eclipse.sdkbundle.2.1.1;bundle-version="2.1.1",
+ com.google.gwt.eclipse.sdkbundle.2.1.1;resolution:=optional,
org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.0,2.0.0)",
org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
13 years, 5 months
JBoss Tools SVN: r27987 - in trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests: examples and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-01-07 11:38:51 -0500 (Fri, 07 Jan 2011)
New Revision: 27987
Added:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksCSV2XML.java
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2POJO.java
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2XMLDateManipulation.java
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2XMLSimple.java
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/WebServiceConsumer1.java
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/WebServiceProducer.java
Modified:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/ESBAllBotTests.java
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorld.java
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorldAction.java
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorldFileAction.java
Log:
added project-examples bot tests covering all esb examples
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/ESBAllBotTests.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/ESBAllBotTests.java 2011-01-07 16:36:41 UTC (rev 27986)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/ESBAllBotTests.java 2011-01-07 16:38:51 UTC (rev 27987)
@@ -11,17 +11,31 @@
package org.jboss.tools.esb.ui.bot.tests;
import org.jboss.tools.esb.ui.bot.tests.examples.HelloWorld;
+import org.jboss.tools.esb.ui.bot.tests.examples.HelloWorldAction;
+import org.jboss.tools.esb.ui.bot.tests.examples.HelloWorldFileAction;
+import org.jboss.tools.esb.ui.bot.tests.examples.SmooksCSV2XML;
+import org.jboss.tools.esb.ui.bot.tests.examples.SmooksXML2XMLSimple;
+import org.jboss.tools.esb.ui.bot.tests.examples.SmooksXML2XMLDateManipulation;
+import org.jboss.tools.esb.ui.bot.tests.examples.WebServiceConsumer1;
+import org.jboss.tools.esb.ui.bot.tests.examples.WebServiceProducer;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
@SuiteClasses({
- CreateRuntimeFromESB.class,
- CreateRuntimeFromSOA.class,
- NewProjectUsingRuntime.class,
- NewProjectUsingBundledInEAP.class,
- Editing.class,
- HelloWorld.class,
+ //CreateRuntimeFromESB.class,
+ //CreateRuntimeFromSOA.class,
+ //NewProjectUsingRuntime.class,
+ //NewProjectUsingBundledInEAP.class,
+ //Editing.class,
+ HelloWorld.class,
+ HelloWorldAction.class,
+ HelloWorldFileAction.class,
+ WebServiceConsumer1.class,
+ WebServiceProducer.class,
+ SmooksCSV2XML.class,
+ SmooksXML2XMLDateManipulation.class,
+ SmooksXML2XMLSimple.class
})
@RunWith(RequirementAwareSuite.class)
public class ESBAllBotTests {
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java 2011-01-07 16:36:41 UTC (rev 27986)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java 2011-01-07 16:38:51 UTC (rev 27987)
@@ -1,17 +1,136 @@
package org.jboss.tools.esb.ui.bot.tests.examples;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.ExampleTest;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.view.ProblemsView;
-public class ESBExampleTest extends SWTTestExt{
+public class ESBExampleTest extends ExampleTest{
+
+ @Override
+ public String getExampleCategory() {
+ return getRunningSoaVersionTreeLabel();
+ }
+ /**
+ * called after example projects are imported, by default fixes both example project references and (if defined) client example references
+ */
+ @Override
+ protected void postImport() {
+ fixExampleLibs();
+ if (getExampleClientProjectName()!=null) {
+ fixExampleClientLibs();
+ }
+ openESBConfig();
+ assertProblemsView();
+ }
+ /**
+ * opens up ESB config file contained in example project in ESB Editor
+ */
+ protected void openESBConfig() {
+ String[] config = {getExampleProjectName(),"esbcontent","META-INF","jboss-esb.xml"};
+ assertTrue("ESB config file does not exist",projectExplorer.existsResource(config));
+ SWTBotEditor editor = projectExplorer.openFile(getExampleProjectName(), "esbcontent","META-INF","jboss-esb.xml");
+ assertNotNull("No editor was opened", editor);
+ assertEquals("Wrong editor was opened", "jboss-esb.xml", editor.getTitle());
+ editor.close();
+ }
+ /**
+ * executes (deploys) example project
+ */
+ @Override
+ protected void executeExample() {
+ super.executeExample();
+ packageExplorer.runOnServer(getExampleProjectName());
+ util.waitForNonIgnoredJobs();
+ }
+ /**
+ * executes given class in given project (path must include project name)
+ * @param path clientClass as could be seen in package explorer (e.g src, org.jboss.tools.test.Class.java)
+ * @return string in server log console that was appended or null if nothing appended
+ */
+ protected String executeClientGetServerOutput(String... clientClass) {
+ String text = console.getConsoleText();
+ SWTBotTreeItem jmsCall = SWTEclipseExt.selectTreeLocation(packageExplorer.show().bot(),clientClass);
+ eclipse.runTreeItemAsJavaApplication(jmsCall);
+ bot.sleep(Timing.time5S());
+ console.switchConsole(configuredState.getServer().name);
+ String text2 = console.getConsoleText(TIME_5S, TIME_20S, false);
+ if (text.length()>=text2.length()) {
+ return null;
+ }
+ return text2.substring(text.length());
+ }
+ /**
+ * executes given class in given project (path must include project name)
+ * @param path clientClass as could be seen in package explorer (e.g src, org.jboss.tools.test.Class.java)
+ * @return string in log console that was appended
+ */
+ protected String executeClient(String... clientClass) {
+ SWTBotTreeItem jmsCall = SWTEclipseExt.selectTreeLocation(packageExplorer.show().bot(),clientClass);
+ eclipse.runTreeItemAsJavaApplication(jmsCall);
+ bot.sleep(Timing.time5S());
+ String text = console.getConsoleText(TIME_5S, TIME_20S, false);
+ console.switchConsole(configuredState.getServer().name); // switch console back for sure
+ return text;
+ }
+ /**
+ * executes given class in given project (path must include project name)
+ * @param className full name of class to run
+ * @param arguments arguments that should be passed to classes main method (can be null)
+ * @return string in server log that was appended or null if nothing appended
+ */
+ protected String executeClientGetServerOutput(String className, String arguments) {
+ String text = console.getConsoleText();
+ eclipse.runJavaApplication(getExampleClientProjectName(), className, arguments);
+ bot.sleep(Timing.time5S());
+ console.switchConsole(configuredState.getServer().name);
+ String text2 = console.getConsoleText(TIME_5S, TIME_20S, false);
+ if (text.length()>=text2.length()) {
+ return null;
+ }
+ return text2.substring(text.length());
+ }
+ protected void fixJREToWorkspaceDefault(String project) {
+ SWTBotTree tree = projectExplorer.show().bot().tree();
+ SWTBotTreeItem proj = tree.select(project).getTreeItem(project);
+ for (SWTBotTreeItem item : proj.getItems()) {
+ if (item.getText().startsWith("JRE System")) {
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree, item);
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.PROPERTIES, false)).click();
+ SWTBotShell shell = bot.activeShell();
+ shell.bot().radio(2).click();
+ open.finish(shell.bot(),IDELabel.Button.OK);
+ break;
+ }
+ }
+
+ }
+ protected void fixExampleLibs() {
+ fixLibrary(getExampleProjectName(),"Server Library");
+ fixLibrary(getExampleProjectName(),"JBoss ESB Runtime");
+ util.waitForNonIgnoredJobs();
+ }
+ protected void fixExampleClientLibs() {
+ fixLibrary(getExampleClientProjectName(),"Server Library");
+ fixLibrary(getExampleClientProjectName(),"JBoss ESB Runtime");
+ fixJREToWorkspaceDefault(getExampleClientProjectName());
+ util.waitForNonIgnoredJobs();
+ }
+ protected void assertProblemsView() {
+ SWTBotTreeItem errors = ProblemsView.getErrorsNode(bot);
+ assertNull("Project still contain problems :"+SWTEclipseExt.getFormattedTreeNode(errors),errors);
+ }
protected void fixLibrary(String project, String lib) {
SWTBotTree tree = projectExplorer.show().bot().tree();
SWTBotTreeItem proj = tree.select(project).getTreeItem(project);
+ proj.expand();
boolean fixed=false;
boolean found=false;
for (SWTBotTreeItem item : proj.getItems()) {
@@ -30,6 +149,9 @@
log.error("Libray starting with '"+lib+"' in project '"+project+"' was not fixed.");
bot.sleep(Long.MAX_VALUE);
}
+ if (!found) {
+ log.info("Libray starting with '"+lib+"' in project '"+project+"' was not found.");
+ }
}
/**
* gets label in project examples tree derived by version of soa we currently run
@@ -37,6 +159,9 @@
*/
protected String getRunningSoaVersionTreeLabel() {
String ret = "ESB for SOA-P ";
+ if (!configuredState.getServer().isConfigured) {
+ throw new NullPointerException("No server was configured for test, but it is required");
+ }
if (configuredState.getServer().version.equals("5.0")) {
ret+="5.0";
}
@@ -45,11 +170,9 @@
}
else if (configuredState.getServer().version.equals("4.3")) {
ret+="4.3";
- if (jbt.isJBDSRun()) {
- return "ESB";
- }
}
else {
+ assertNotNull("We are running on unexpected SOA-P version "+configuredState.getServer().version+" update test source code "+this.getClass().getName(), null);
return null;
}
return ret;
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorld.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorld.java 2011-01-07 16:36:41 UTC (rev 27986)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorld.java 2011-01-07 16:38:51 UTC (rev 27987)
@@ -1,94 +1,40 @@
package org.jboss.tools.esb.ui.bot.tests.examples;
-import static org.eclipse.swtbot.swt.finder.waits.Conditions.shellCloses;
-
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
-import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
-import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.JBossToolsProjectExamples;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.junit.AfterClass;
-import org.junit.Test;
@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,state=ServerState.Running))
public class HelloWorld extends ESBExampleTest {
-
- String projectName="helloworld";
- String projectClientName="helloworld_client";
-
+ @Override
+ public String getExampleName() {
+ return "JBoss ESB HelloWorld Example - ESB";
+ }
+ @Override
+ public String getExampleProjectName() {
+ return "helloworld";
+ }
+ @Override
+ public String getExampleClientProjectName() {
+ return "helloworld_testclient";
+ }
@AfterClass
public static void waitaminute() {
- // bot.sleep(Long.MAX_VALUE);
+ //bot.sleep(Long.MAX_VALUE);
}
- @Test
- public void helloWorldExample() {
- String soaNode = getRunningSoaVersionTreeLabel();
- assertNotNull("We are running on unexpected SOA-P version "+configuredState.getServer().version+" update test source code "+this.getClass().getName(), soaNode);
- createHelloWorldExample(soaNode, "JBoss ESB HelloWorld Example - ESB", "helloworld", null, "helloworld_testclient");
- }
-
- /**
- * creates example
- * @param soaNode first treenode name on projectExamples dialog
- * @param exampleName name of example node
- * @param projectName projectname that will be generated by example
- * @param exampleClientName name of example client example (when null, client project is assumed to be together with example)
- * @param projectClientName name of client project that will be generated by example (or client example)
- */
- private void createHelloWorldExample(String soaNode, String exampleName,String projectName, String exampleClientName, String projectClientName) {
- SWTBot wiz = open.newObject(JBossToolsProjectExamples.LABEL);
- SWTBotTree tree = wiz.tree();
- tree.expandNode(soaNode).select(exampleName);
- assertTrue(wiz.textWithLabel(JBossToolsProjectExamples.TEXT_PROJECT_NAME).getText().equals(projectName));
- wiz.button(IDELabel.Button.FINISH).click();
- SWTBotShell shell = bot.shell("Downloading...");
- shell.activate();
- bot.waitUntil(shellCloses(shell),Timing.time100S());
- shell = bot.shell("Quick Fix");
- shell.activate();
- open.finish(shell.bot());
- assertTrue(projectExplorer.existsResource(projectName));
- assertTrue(projectExplorer.existsResource(projectName,"esbcontent","META-INF","jboss-esb.xml"));
- if (exampleClientName!=null) {
- wiz = open.newObject(JBossToolsProjectExamples.LABEL);
- tree = wiz.tree();
- tree.expandNode(soaNode).select(exampleClientName);
- assertTrue(wiz.textWithLabel(JBossToolsProjectExamples.TEXT_PROJECT_NAME).getText().equals(projectClientName));
- wiz.button(IDELabel.Button.FINISH).click();
- shell = bot.shell("Downloading...");
- shell.activate();
- bot.waitUntil(shellCloses(shell),Timing.time100S());
- shell = bot.shell("Quick Fix");
- shell.activate();
- open.finish(shell.bot());
- }
- assertTrue(projectExplorer.existsResource(projectClientName));
- fixLibrary(projectName,"Server Library");
- fixLibrary(projectClientName,"Server Library");
- fixLibrary(projectName,"JBoss ESB Runtime");
- fixLibrary(projectClientName,"JBoss ESB Runtime");
- util.waitForNonIgnoredJobs();
- SWTBotTreeItem errors = problems.getErrorsNode(bot);
- //assertTrue("Project still contain problems :"+eclipse.getFormattedTreeNodesText(problems.show().bot().tree(), errors.getItems()),errors==null);
- packageExplorer.runOnServer(projectName);
- util.waitForNonIgnoredJobs();
- String text = console.getConsoleText();
- SWTBotTreeItem jmsCall = SWTEclipseExt.selectTreeLocation(packageExplorer.show().bot(),projectClientName,"src","org.jboss.soa.esb.samples.quickstart.helloworld.test","SendJMSMessage.java");
- eclipse.runTreeItemAsJavaApplication(jmsCall);
- bot.sleep(Timing.time5S());
- console.switchConsole(configuredState.getServer().name);
- String text2 = console.getConsoleText(TIME_5S, TIME_20S, false);
- assertTrue("Calling JMS Send message failed, nothing appened to server log",text.length()<text2.length());
- String diff = text2.substring(text.length());
- assertTrue("Calling JMS Send message failed, unexpected server output :"+diff,diff.contains("Body: Hello World"));
+ @Override
+ protected void executeExample() {
+ super.executeExample();
+ String text = executeClientGetServerOutput(getExampleClientProjectName(),"src","org.jboss.soa.esb.samples.quickstart.helloworld.test","SendJMSMessage.java");
+ assertNotNull("Calling JMS Send message failed, nothing appened to server log",text);
+ assertTrue("Calling JMS Send message failed, unexpected server output :"+text,text.contains("Body: Hello World"));
+ text = null;
+ text = executeClientGetServerOutput(getExampleClientProjectName(),"src","org.jboss.soa.esb.samples.quickstart.helloworld.test","SendEsbMessage.java");
+ assertNotNull("Calling ESB Send message failed, nothing appened to server log",text);
+ assertTrue("Calling ESB Send message failed, unexpected server output :"+text,text.contains("hello world esb"));
}
}
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorldAction.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorldAction.java 2011-01-07 16:36:41 UTC (rev 27986)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorldAction.java 2011-01-07 16:38:51 UTC (rev 27987)
@@ -1,5 +1,30 @@
package org.jboss.tools.esb.ui.bot.tests.examples;
+import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
+
+@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,state=ServerState.Running))
public class HelloWorldAction extends ESBExampleTest {
+ @Override
+ public String getExampleName() {
+ return "JBoss ESB HelloWorld Action Example - ESB";
+ }
+ @Override
+ public String getExampleProjectName() {
+ return "helloworld_action";
+ }
+ @Override
+ public String getExampleClientProjectName() {
+ return "helloworld_action_client";
+ }
+ @Override
+ protected void executeExample() {
+ super.executeExample();
+ String text = executeClientGetServerOutput(getExampleClientProjectName(),"src","org.jboss.soa.esb.samples.quickstart.helloworldaction.test","SendJMSMessage.java");
+ assertNotNull("Calling JMS Send message failed, nothing appened to server log",text);
+ assertTrue("Calling JMS Send message failed, unexpected server output :"+text,text.contains("Hello World Action ESB invoked!"));
+ }
}
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorldFileAction.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorldFileAction.java 2011-01-07 16:36:41 UTC (rev 27986)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorldFileAction.java 2011-01-07 16:38:51 UTC (rev 27987)
@@ -1,5 +1,26 @@
package org.jboss.tools.esb.ui.bot.tests.examples;
+import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
+
+@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,state=ServerState.Running))
public class HelloWorldFileAction extends ESBExampleTest {
-
+ @Override
+ public String getExampleName() {
+ return "JBoss ESB HelloWorld File Action Example - ESB";
+ }
+ @Override
+ public String getExampleProjectName() {
+ return "helloworld_file_action";
+ }
+ @Override
+ public String getExampleClientProjectName() {
+ return "helloworld_file_action_client";
+ }
+ @Override
+ protected void executeExample() {
+ fail("Example execution not yet implemented");
+ }
}
Added: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksCSV2XML.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksCSV2XML.java (rev 0)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksCSV2XML.java 2011-01-07 16:38:51 UTC (rev 27987)
@@ -0,0 +1,30 @@
+package org.jboss.tools.esb.ui.bot.tests.examples;
+
+import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
+
+@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,state=ServerState.Running))
+public class SmooksCSV2XML extends ESBExampleTest {
+ @Override
+ public String getExampleName() {
+ return "JBoss ESB Smooks CSV->XML Example";
+ }
+ @Override
+ public String getExampleProjectName() {
+ return "transform_CSV2XML";
+ }
+ @Override
+ public String getExampleClientProjectName() {
+ return "transform_CSV2XML_client";
+ }
+
+ @Override
+ protected void executeExample() {
+ super.executeExample();
+ String text = executeClientGetServerOutput(getExampleClientProjectName(),"src","org.jboss.soa.esb.samples.quickstart.transformcsv2xml","SendJMSMessage.java");
+ assertNotNull("Calling Send message failed, nothing appened to server log",text);
+ assertTrue("Calling Send message failed, unexpected server output :"+text,text.contains("<csv-set>"));
+ }
+}
Property changes on: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksCSV2XML.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2POJO.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2POJO.java (rev 0)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2POJO.java 2011-01-07 16:38:51 UTC (rev 27987)
@@ -0,0 +1,34 @@
+package org.jboss.tools.esb.ui.bot.tests.examples;
+
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
+
+@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,state=ServerState.Running))
+public class SmooksXML2POJO extends ESBExampleTest {
+ @Override
+ public String getExampleName() {
+ return "JBoss ESB Smooks XML->POJO Example";
+ }
+ @Override
+ public String getExampleProjectName() {
+ return "transform_XML2POJO";
+ }
+ @Override
+ public String getExampleClientProjectName() {
+ return "transform_XML2POJO_client";
+ }
+
+ @Override
+ protected void executeExample() {
+ super.executeExample();
+ String text = executeClientGetServerOutput(getExampleClientProjectName(),"src","org.jboss.soa.esb.samples.quickstart.transformxml2pojo.test","SendJMSMessage.java");
+ bot.sleep(Timing.time3S());
+ assertNotNull("Calling Send message failed, nothing appened to server log",text);
+ assertTrue("Calling Send message failed, unexpected server output :"+text,text.contains("Order Items"));
+ text = executeClient(getExampleClientProjectName(),"src","org.jboss.soa.esb.samples.quickstart.transformxml2pojo.test","ReceiveJMSMessage.java");
+ assertTrue("Calling Send message failed, unexpected server output :"+text,text.contains("Order Items"));
+ }
+}
Property changes on: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2POJO.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2XMLDateManipulation.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2XMLDateManipulation.java (rev 0)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2XMLDateManipulation.java 2011-01-07 16:38:51 UTC (rev 27987)
@@ -0,0 +1,32 @@
+package org.jboss.tools.esb.ui.bot.tests.examples;
+
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
+
+@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,state=ServerState.Running))
+public class SmooksXML2XMLDateManipulation extends ESBExampleTest {
+ @Override
+ public String getExampleName() {
+ return "JBoss ESB Smooks XML->XML date-manipulation Example";
+ }
+ @Override
+ public String getExampleProjectName() {
+ return "transform_XML2XML_date_manipulation";
+ }
+ @Override
+ public String getExampleClientProjectName() {
+ return "transform_XML2XML_date_manipulation_client";
+ }
+
+ @Override
+ protected void executeExample() {
+ super.executeExample();
+ String text = executeClientGetServerOutput(getExampleClientProjectName(),"src","org.jboss.soa.esb.samples.quickstart.transformxml2xmldatemanipulation.test","SendJMSMessage.java");
+ bot.sleep(Timing.time3S());
+ assertNotNull("Calling Send message failed, nothing appened to server log",text);
+ assertTrue("Calling Send message failed, unexpected server output :"+text,text.contains("OrderDate"));
+ }
+}
Property changes on: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2XMLDateManipulation.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2XMLSimple.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2XMLSimple.java (rev 0)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2XMLSimple.java 2011-01-07 16:38:51 UTC (rev 27987)
@@ -0,0 +1,32 @@
+package org.jboss.tools.esb.ui.bot.tests.examples;
+
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
+
+@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,state=ServerState.Running))
+public class SmooksXML2XMLSimple extends ESBExampleTest {
+ @Override
+ public String getExampleName() {
+ return "JBoss ESB Smooks XML->XML Example";
+ }
+ @Override
+ public String getExampleProjectName() {
+ return "transform_XML2XML_simple";
+ }
+ @Override
+ public String getExampleClientProjectName() {
+ return "transform_XML2XML_simple_client";
+ }
+
+ @Override
+ protected void executeExample() {
+ super.executeExample();
+ String text = executeClientGetServerOutput(getExampleClientProjectName(),"src","org.jboss.soa.esb.samples.quickstart.transformxml2xmlsimple.test","SendJMSMessage.java");
+ bot.sleep(Timing.time3S());
+ assertNotNull("Calling Send message failed, nothing appened to server log",text);
+ assertTrue("Calling Send message failed, unexpected server output :"+text,text.contains("<Order"));
+ }
+}
Property changes on: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SmooksXML2XMLSimple.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/WebServiceConsumer1.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/WebServiceConsumer1.java (rev 0)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/WebServiceConsumer1.java 2011-01-07 16:38:51 UTC (rev 27987)
@@ -0,0 +1,34 @@
+package org.jboss.tools.esb.ui.bot.tests.examples;
+
+import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
+
+@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,state=ServerState.Running))
+public class WebServiceConsumer1 extends ESBExampleTest {
+ @Override
+ public String getExampleName() {
+ return "JBoss ESB Web Service consumer1 Example";
+ }
+ @Override
+ public String getExampleProjectName() {
+ return "webservice_consumer1";
+ }
+ @Override
+ public String getExampleClientProjectName() {
+ return "webservice_consumer1_client";
+ }
+ @Override
+ protected void executeExample() {
+ super.executeExample();
+ String text = executeClientGetServerOutput(getExampleClientProjectName(),"src","org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test","SendJMSMessage.java");
+ assertNotNull("Calling JMS Send message failed, nothing appened to server log",text);
+ assertTrue("Calling JMS Send message failed, unexpected server output :"+text,text.contains("Hello World Greeting for 'JMS'"));
+ text = null;
+ text = executeClientGetServerOutput(getExampleClientProjectName(),"src","org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test","SendEsbMessage.java");
+ assertNotNull("Calling ESB Send message failed, nothing appened to server log",text);
+ assertTrue("Calling ESB Send message failed, unexpected server output :"+text,text.contains("Hello World Greeting for 'ESB'"));
+
+ }
+}
Property changes on: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/WebServiceConsumer1.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/WebServiceProducer.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/WebServiceProducer.java (rev 0)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/WebServiceProducer.java 2011-01-07 16:38:51 UTC (rev 27987)
@@ -0,0 +1,31 @@
+package org.jboss.tools.esb.ui.bot.tests.examples;
+
+import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
+
+@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,state=ServerState.Running),perspective="Java")
+public class WebServiceProducer extends ESBExampleTest {
+ @Override
+ public String getExampleName() {
+ return "JBoss ESB Web Service producer Example";
+ }
+ @Override
+ public String getExampleProjectName() {
+ return "webservice_producer";
+ }
+ @Override
+ public String getExampleClientProjectName() {
+ return "webservice_producer_client";
+ }
+
+ @Override
+ protected void executeExample() {
+ super.executeExample();
+ String text = executeClientGetServerOutput("org.jboss.soa.esb.samples.quickstart.webserviceproducer.test.SendMessage","jms");
+ assertNotNull("Calling Send message failed, nothing appened to server log",text);
+ assertTrue("Calling Send message failed, unexpected server output :"+text,text.contains("Goodbye!!"));
+ fail("testing method http not yet implemented");
+ }
+}
Property changes on: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/WebServiceProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
13 years, 5 months
JBoss Tools SVN: r27986 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-01-07 11:36:41 -0500 (Fri, 07 Jan 2011)
New Revision: 27986
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/ExampleTest.java
Log:
swtbot ext: added project-example test class
Added: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/ExampleTest.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/ExampleTest.java (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/ExampleTest.java 2011-01-07 16:36:41 UTC (rev 27986)
@@ -0,0 +1,92 @@
+package org.jboss.tools.ui.bot.ext;
+
+import static org.eclipse.swtbot.swt.finder.waits.Conditions.shellCloses;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.JBossToolsProjectExamples;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Test;
+/**
+ * this class represents SWTBot-based Project Example test. Whenever we test project-examples, we should
+ * extend these class and override what needed. See esb bot tests for details
+ * @author lzoubek
+ *
+ */
+public class ExampleTest extends SWTTestExt{
+ /**
+ * returns example project name (as it is imported to workspace)
+ * @return
+ */
+ public String getExampleProjectName() {
+ return null;
+ }
+ /**
+ * returns name of example client project (null if none)
+ * @return
+ */
+ public String getExampleClientProjectName() {
+ return null;
+ }
+ /**
+ * gets example name (listed in project examples dialog)
+ * @return
+ */
+ public String getExampleName() {
+ return null;
+ }
+ /**
+ * gets example category (listed in project examples dialog)
+ * @return
+ */
+ public String getExampleCategory() {
+ return null;
+ }
+ /**
+ * override to implement post-import step (fix dependencies etc.)
+ */
+ protected void postImport() {}
+ /**
+ * override to implement example execution (deployment, running asserts)
+ */
+ protected void executeExample() {}
+ /**
+ * main test method, all steps can be overriden
+ * <ol>
+ * <li>{@link ESBExampleTest#importExamples()}</li>
+ * <li>{@link ESBExampleTest#postImport()}</li>
+ * <li>{@link ESBExampleTest#executeExample()}</li>
+ * </ol>
+ */
+ @Test
+ public void exampleTest() {
+ importExamples();
+ postImport();
+ executeExample();
+ }
+ /**
+ * runs Project Examples dialog, downloads and imports example's projects to workspace
+ */
+ protected void importExamples() {
+ SWTBot wiz = open.newObject(JBossToolsProjectExamples.LABEL);
+ // wait for progress shell (downloading & parsing example xml)
+ SWTBotShell shell = bot.shell("Progress Information");
+ shell.activate();
+ bot.waitUntil(shellCloses(shell),Timing.time100S());
+ open.selectTreeNode(wiz,ActionItem.create(getExampleCategory(),getExampleName()));
+ String hasProjName = wiz.textWithLabel(JBossToolsProjectExamples.TEXT_PROJECT_NAME).getText();
+ assertTrue(String.format("Example project name changed, have '%s', expected '%s'",hasProjName,getExampleProjectName()),hasProjName.equals(getExampleProjectName()));
+ wiz.checkBox("Show the Quick Fix dialog").deselect();
+ wiz.button(IDELabel.Button.FINISH).click();
+ shell = bot.shell("Downloading...");
+ shell.activate();
+ bot.waitUntil(shellCloses(shell),Timing.time100S());
+ util.waitForNonIgnoredJobs(Timing.time20S());
+ assertTrue(String.format("Example project '%s' was not found in project explorer",getExampleProjectName()),projectExplorer.existsResource(getExampleProjectName()));
+ if (getExampleClientProjectName()!=null) {
+ assertTrue(String.format("Example project '%s' was not found in project explorer",getExampleClientProjectName()),projectExplorer.existsResource(getExampleClientProjectName()));
+ }
+
+ }
+}
Property changes on: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/ExampleTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
13 years, 5 months
JBoss Tools SVN: r27985 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2011-01-07 11:25:43 -0500 (Fri, 07 Jan 2011)
New Revision: 27985
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
Log:
https://issues.jboss.org/browse/JBIDE-8072 - hide the option "use extern process", cause https://issues.jboss.org/browse/JBIDE-8071
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2011-01-07 16:05:01 UTC (rev 27984)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2011-01-07 16:25:43 UTC (rev 27985)
@@ -246,7 +246,10 @@
useOwnTemplates.attachDialogField(templatedir);
reverseengineer.attachDialogFields(new DialogField[] { packageName, preferRawCompositeIds, reverseEngineeringSettings, reverseEngineeringStrategy, autoManyToMany, autoOneToOne, autoVersioning });
- useExternalProcess.doFillIntoGrid(container, 4);
+ // do not show the option cause: JBIDE-8072
+ //useExternalProcess.doFillIntoGrid(container, 4);
+ useExternalProcess.setSelection(false);
+
consoleConfigurationName.doFillIntoGrid(container, 4);
Control[] controls = outputdir.doFillIntoGrid(container, 4);
// Hack to tell the text field to stretch!
@@ -459,7 +462,8 @@
useOwnTemplates.setSelection(attributes.isUseOwnTemplates());
packageName.setText(safeText(attributes.getPackageName()));
templatedir.setText(safeText(attributes.getTemplatePath()));
- useExternalProcess.setSelection(attributes.isUseExternalProcess());
+ //useExternalProcess.setSelection(attributes.isUseExternalProcess());
+ useExternalProcess.setSelection(false);
}
private String safeText(String text) {
13 years, 5 months
JBoss Tools SVN: r27984 - in trunk/bpel/plugins: org.eclipse.bpel.model/src/org/eclipse/bpel/model/util and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2011-01-07 11:05:01 -0500 (Fri, 07 Jan 2011)
New Revision: 27984
Modified:
trunk/bpel/plugins/org.eclipse.bpel.common.ui/src/org/eclipse/bpel/common/ui/messages.properties
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationHelper.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/AddVariableCommand.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/contentassist/ExpressionContentAssistProcessor.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/details/providers/OperationContentProvider.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/factories/BPELUIObjectFactory.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/InvokeImplSection.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/InvokeVariableSection.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariablePartAssignCategory.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableTypeSelector.java
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/messages.properties
Log:
https://issues.jboss.org/browse/JBIDE-8048
Modified: trunk/bpel/plugins/org.eclipse.bpel.common.ui/src/org/eclipse/bpel/common/ui/messages.properties
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.common.ui/src/org/eclipse/bpel/common/ui/messages.properties 2011-01-07 16:02:36 UTC (rev 27983)
+++ trunk/bpel/plugins/org.eclipse.bpel.common.ui/src/org/eclipse/bpel/common/ui/messages.properties 2011-01-07 16:05:01 UTC (rev 27984)
@@ -31,9 +31,7 @@
SynchronizationManager_refresh_title=File Changed
CompositeEditor_Cannot_disconnect_active_editor=Cannot disconnect active editor\: {0}
# https://jira.jboss.org/browse/JBIDE-7520
-SynchronizationManager_refresh_message=The file {0} \n
- has been changed on the file system.\n
- Do you want to load the changes?
+SynchronizationManager_refresh_message=The file {0} has been changed on the file system. Do you want to load the changes?
SynchronizationManager_saveButtonLabel=Save
CompositeEditorManager_5=Embedded editors must provide an id. Ignoring editor.
DatePicker_noDateSelected=None
Modified: trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationHelper.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationHelper.java 2011-01-07 16:02:36 UTC (rev 27983)
+++ trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationHelper.java 2011-01-07 16:05:01 UTC (rev 27984)
@@ -211,6 +211,10 @@
reader.xml2Target((Target)element, changedElement);
} else if (element instanceof Targets){
reader.xml2Targets((Targets)element, changedElement);
+ } else if (element instanceof CompensationHandler){
+ // https://issues.jboss.org/browse/JBIDE-8048
+ // this was left out inadevertently
+ reader.xml2CompensationHandler((CompensationHandler)element, changedElement);
} else {
System.err.println("Cannot reconcile: " + element.getClass());
// throw new NotImplementedException(element.getClass().toString());
@@ -683,8 +687,29 @@
return;
}
if (parseElement == null) {
- System.err.println("trying to replace attribute on null element:" + element.getClass());
- return;
+ // https://issues.jboss.org/browse/JBIDE-8048
+ // Hack to allow setting an implicit variable's attributes for OnEvent, Catch.
+ // These are not real Variable objects (i.e. they are not XML elements like
+ // real <variable>'s). To do this right, we really should define an
+ // ImplicitVariable model object instead of reusing Variable objects inside
+ // OnEvent and Catch...
+ EObject parent = element.eContainer();
+ if (parent instanceof OnEvent || parent instanceof Catch) {
+ // ignore attempts to set attributes on the parent that aren't in the model
+ for ( EStructuralFeature feature : parent.eClass().getEAllStructuralFeatures()) {
+ if ( feature.getName().equals(attributeName)) {
+ parseElement = ((ExtensibleElement)parent).getElement();
+ break;
+ }
+ }
+ }
+ if (parseElement == null) {
+ System.err.println("trying to replace attribute " + "\"" + attributeName + "\"" +
+ " on null element " + element.getClass() + " contained in " +
+ (element.eContainer() == null ? null : element.eContainer().getClass())
+ );
+ return;
+ }
}
// This is a problem in eclipse3.6, if we use parseElement.getAttribute(attributeName) and the attribute is not in the parseElement,
@@ -744,10 +769,6 @@
if (isLoading(element)) {
return;
}
- if (element.getElement() == null) {
- System.err.println("trying to replace attribute on null element: " + element.getClass());
- return;
- }
replaceAttribute(element, attributeName, attributeValue == null ? null : ElementFactory.getInstance().createName(element, attributeValue));
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/AddVariableCommand.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/AddVariableCommand.java 2011-01-07 16:02:36 UTC (rev 27983)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/commands/AddVariableCommand.java 2011-01-07 16:05:01 UTC (rev 27984)
@@ -10,11 +10,18 @@
*******************************************************************************/
package org.eclipse.bpel.ui.commands;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpel.model.BPELPackage;
+import org.eclipse.bpel.model.Import;
import org.eclipse.bpel.model.Variable;
+import org.eclipse.bpel.model.Variables;
import org.eclipse.bpel.ui.IBPELUIConstants;
import org.eclipse.bpel.ui.util.ModelHelper;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
/**
@@ -28,7 +35,11 @@
}
@Override
- protected EList<Variable> getList() {
- return ModelHelper.getVariables( target ).getChildren();
+ protected List<Variable> getList() {
+ // https://issues.jboss.org/browse/JBIDE-8048
+ Variables variables = ModelHelper.getVariables( target );
+ if (variables != null)
+ return variables.getChildren();
+ return new ArrayList<Variable>();
}
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/contentassist/ExpressionContentAssistProcessor.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/contentassist/ExpressionContentAssistProcessor.java 2011-01-07 16:02:36 UTC (rev 27983)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/contentassist/ExpressionContentAssistProcessor.java 2011-01-07 16:05:01 UTC (rev 27984)
@@ -107,6 +107,7 @@
static final int PROPTYPE_VARIABLE = 1;
static final int PROPTYPE_FUNCTION = 2;
static final int PROPTYPE_OPERATOR = 4;
+ static final int PROPTYPE_ELEMENT = 8;
ProposalType(int type, String beginsWith) {
theType = type;
@@ -117,6 +118,7 @@
boolean isFunction() { return ((theType & PROPTYPE_FUNCTION) == PROPTYPE_FUNCTION); }
boolean isOperator() { return ((theType & PROPTYPE_OPERATOR) == PROPTYPE_OPERATOR); }
boolean isVariableAndFunction() { return ((theType & (PROPTYPE_VARIABLE | PROPTYPE_FUNCTION)) == (PROPTYPE_VARIABLE | PROPTYPE_FUNCTION)); }
+ boolean isElement() { return ((theType & PROPTYPE_ELEMENT) == PROPTYPE_ELEMENT); }
}
// helper class for defining expression types within xpath expression... used by XPathStack
@@ -134,6 +136,7 @@
static final int EXPRTYPE_NEW_EXPRESSION = 8;
static final int EXPRTYPE_FUNCTION_ARGUMENTS = 9;
static final int EXPRTYPE_FUNCTION_ARGUMENT_SEPARATOR = 10;
+ static final int EXPRTYPE_ELEMENT = 11;
static final int CLASS_NUMERIC = 100;
static final int CLASS_BOOLEAN = 101;
@@ -220,6 +223,9 @@
theTopOfStackExprType = ExpressionType.CLASS_NUMERIC;
}
}
+ else if (currChar == '/' ) {
+ return parseElement();
+ }
else {
theStatus = -1;
return false;
@@ -408,6 +414,71 @@
return proceed;
}
+ private boolean parseElement() throws BadLocationException {
+ theIndex++; // move past / token
+ String variable = DIVIDE;
+ char nextChar;
+ while (theIndex < theOffset) {
+ nextChar = theDocument.getChar(theIndex);
+ if (isLocationPathCharacter(nextChar)) {
+ variable = variable + nextChar;
+ }
+ else if (nextChar == '[') {
+ theCallStack.push(new ExpressionType(ExpressionType.EXPRTYPE_ELEMENT, variable));
+ theCallStack.push(new ExpressionType(ExpressionType.EXPRTYPE_NEW_EXPRESSION, OPEN_BRACKET));
+ theIndex++;
+ boolean proceed = parseBooleanExpression();
+ if (proceed) {
+ nextChar = theDocument.getChar(theIndex);
+ if (nextChar == ']') {
+ try {
+ ExpressionType tempExpr = theCallStack.pop();
+ while (tempExpr.theType != ExpressionType.EXPRTYPE_NEW_EXPRESSION) {
+ // continue popping until we find a new expression type
+ tempExpr = theCallStack.pop();
+ }
+ if (tempExpr != null) {
+ if (tempExpr.theGrammar.compareTo(CLOSE_BRACKET) == 0) {
+ return true;
+ }
+ }
+ }
+ catch (EmptyStackException e) {
+ theStatus = -1;
+ return false;
+ }
+ }
+ else {
+ // in error ... maybe throw something here
+ theStatus = -1;
+ return false;
+ }
+ }
+ else {
+ return proceed;
+ }
+ }
+ else {
+ theCallStack.push(new ExpressionType(ExpressionType.EXPRTYPE_ELEMENT, variable));
+ theTopOfStackExprType = ExpressionType.EXPRTYPE_ELEMENT;
+ theIndex--;
+ return true;
+ }
+ theIndex++;
+ }
+
+ if (theIndex >= theOffset) {
+ theCallStack.push(new ExpressionType(ExpressionType.EXPRTYPE_ELEMENT, variable));
+ theStatus = 1;
+ return false;
+ //return new ProposalType(ProposalType.PROPTYPE_VARIABLE, variable);
+ }
+
+ // shouldn't get here
+ theStatus = -1;
+ return false;
+ }
+
// parse word found in numeric expression
private boolean parseWord() throws BadLocationException {
String word = EMPTY_STRING;
@@ -814,6 +885,9 @@
return (new ProposalType(0, EMPTY_STRING));
}
return new ProposalType(ProposalType.PROPTYPE_OPERATOR, EMPTY_STRING);
+
+ case ExpressionType.EXPRTYPE_ELEMENT:
+ return new ProposalType(ProposalType.PROPTYPE_ELEMENT, EMPTY_STRING);
default:
return (new ProposalType(0, EMPTY_STRING));
@@ -831,7 +905,13 @@
tempContext = startOfFunction(viewer, offset);
if (tempContext != null) {
return new ProposalType(ProposalType.PROPTYPE_FUNCTION, tempContext);
- }
+ }
+
+ tempContext = startOfElement(viewer, offset);
+ if (tempContext != null) {
+ return new ProposalType(ProposalType.PROPTYPE_ELEMENT, tempContext);
+ }
+
return new ProposalType(ProposalType.PROPTYPE_FUNCTION | ProposalType.PROPTYPE_VARIABLE, EMPTY_STRING);
}
@@ -851,13 +931,13 @@
String varlinkStart = EMPTY_STRING;
if (propType.isVariableAndFunction()) {
- theToggle = (theToggle+1) % 4;
+ theToggle = (theToggle+1) % 5;
funcStart = propType.theBeginsWith;
varlinkStart = propType.theBeginsWith;
}
else if (propType.isVariable()) {
if (toggle)
- theToggle = (theToggle+1) % 4;
+ theToggle = (theToggle+1) % 5;
else
theToggle = 0;
funcStart = EMPTY_STRING;
@@ -865,7 +945,7 @@
}
else if (propType.isFunction()) {
if (toggle)
- theToggle = (theToggle+1) % 4;
+ theToggle = (theToggle+1) % 5;
else
theToggle = 1;
funcStart = propType.theBeginsWith;
@@ -873,13 +953,22 @@
}
else if (propType.isOperator()) {
if (toggle)
- theToggle = (theToggle+1) % 4;
+ theToggle = (theToggle+1) % 5;
else
theToggle = 2;
funcStart = EMPTY_STRING;
varlinkStart = EMPTY_STRING;
}
+ else if (propType.isElement()) {
+ if (toggle)
+ theToggle = (theToggle+1) % 5;
+ else
+ theToggle = 3;
+ funcStart = EMPTY_STRING;
+ varlinkStart = EMPTY_STRING;
+ }
+
switch (theToggle) {
case 0:
theContentAssistant.setStatusMessage(Messages.getString("ExpressionContentAssistProcessor.44")); //$NON-NLS-1$
@@ -901,6 +990,9 @@
theContentAssistant.setStatusMessage(Messages.getString("ExpressionContentAssistProcessor.49")); //$NON-NLS-1$
//return generateTemplateProposals(tempStart, offset);
return (fXpathTemplates.computeCompletionProposals(viewer, offset));
+
+ case 4:
+ return generateVariableProposals(varlinkStart, offset);
}
return null;
@@ -1315,5 +1407,306 @@
private boolean isClosingExpressionCharacter(char c) {
return (RESERVED_CLOSING_EXPR_CHARS.indexOf(c) > -1);
- }
+ }
+
+ // simple form of determining if message part or XSD Element is located at offset
+ String startOfElement(ITextViewer viewer, int offset) {
+ int startPosition = offset-1;
+ char currChar;
+ String context = EMPTY_STRING;
+ IDocument document = viewer.getDocument();
+
+ try {
+ while (startPosition >= 0) {
+ currChar = document.getChar(startPosition);
+
+ if (currChar == '/')
+ return context;
+
+ if (!(Character.isLetterOrDigit(currChar)
+ || currChar == '.' || currChar == '@' || currChar == '_'))
+ return null;
+
+ context = currChar + context;
+ startPosition--;
+ }
+ }
+ catch (Exception e) {
+ System.out.println(e.toString());
+ }
+ return null;
+ }
+
+ /**
+ * From model, determine list of XSD elements or message parts the user may want to choose from.
+ */
+
+ ICompletionProposal[] generateElementProposals(String context, int offset) {
+ boolean seekChildren = false;
+
+ String context2;
+ if ((context.length() > 0) && (context.charAt(0) == '/'))
+ context2 = context.substring(1);
+ else
+ context2 = context;
+
+ int slash = context2.indexOf('/');
+ int dot = context2.indexOf('.');
+ int at = context2.indexOf('@');
+
+ if ((slash > -1) || (dot > -1) || (at > -1))
+ seekChildren = true;
+
+ Variable[] variables = BPELUtil.getVisibleVariables((EObject)theModel);
+ ArrayList<ICompletionProposal> results = new ArrayList<ICompletionProposal>();
+ CompletionProposal prop = null;
+ String name;
+ Variable currVar = null;
+ XSDTypeDefinition currXsdType = null;
+ Message currMsg = null;
+ XSDElementDeclaration currXsdElem = null;
+
+ Image varImg = BPELUIPlugin.INSTANCE.getImage(IBPELUIConstants.ICON_VARIABLE_16);
+ Image partImg = BPELUIPlugin.INSTANCE.getImage(IBPELUIConstants.ICON_PART_16);
+ Image elementImg = BPELUIPlugin.INSTANCE.getImage(IBPELUIConstants.ICON_XSD_ELEMENT_DECLARATION_16);
+ Image attrImg = BPELUIPlugin.INSTANCE.getImage(IBPELUIConstants.ICON_XSD_ATTRIBUTE_DECLARATION_16);
+ try
+ {
+ if (seekChildren) {
+ // walk down path
+ int index = 0;
+ int level = 0;
+ int token = -1;
+ char t = 0;
+ String levelName;
+
+ while (index < context2.length()) {
+ t = context2.charAt(index);
+ if ((t == '.') || (t == '/')) {
+ levelName = context2.substring(token+1, index);
+ /*
+ // check for namespace
+ int ns = levelName.indexOf(':');
+ if (ns > -1) {
+ levelNSPrefix = levelName.substring(0, ns);
+ levelName = levelName.substring(ns+1);
+ }
+ else
+ levelNSPrefix = null;
+ */
+
+ // find variable
+ if (level == 0) {
+ for (int i=0; i<variables.length; i++) {
+ if (levelName.compareTo(variables[i].getName()) == 0) {
+ currVar = variables[i];
+ currXsdType = currVar.getType();
+ currMsg = currVar.getMessageType();
+ currXsdElem = currVar.getXSDElement();
+
+ level++;
+ break;
+ }
+ }
+ if (currVar == null)
+ break;
+ }
+ // traverse down
+ else {
+ boolean childFound = false;
+ if (context2.charAt(token) == '.') {
+ if (currMsg != null) {
+ if (currMsg.getParts() != null) {
+ for(Object next : currMsg.getParts().values()) {
+ Part item = (Part) next ;
+ if (levelName.compareTo(item.getName()) == 0) {
+ currXsdType = item.getTypeDefinition();
+ currMsg = item.getEMessage();
+ currXsdElem = item.getElementDeclaration();
+ childFound = true;
+ break;
+ }
+ }
+ }
+ }
+ if (!childFound)
+ break;
+ }
+ // search for child objects
+ else if (context2.charAt(token) == '/') {
+ if (currXsdType == null) {
+ if (currXsdElem != null) {
+ currXsdType = currXsdElem.getTypeDefinition();
+ }
+ }
+ if (currXsdType instanceof XSDComplexTypeDefinition) {
+ XSDComplexTypeDefinition xsdcomplex = (XSDComplexTypeDefinition)currXsdType;
+
+ for(Object next : XSDUtils.getChildElements(xsdcomplex)) {
+ XSDElementDeclaration elem = ((XSDElementDeclaration)next).getResolvedElementDeclaration();
+ String elemName = elem.getName();
+ if (elem.getTargetNamespace() != null) {
+ String elemNSPrefix = getNamespacePrefix(currVar, elem.getTargetNamespace());
+ if (elemNSPrefix != null) {
+ elemName = elemNSPrefix + COLON + elemName;
+ }
+ }
+
+ if (levelName.compareTo(elemName) == 0) {
+ currXsdType = elem.getTypeDefinition();
+ currXsdElem = null;
+ currMsg = null;
+ //currXsdElem = elem.getResolvedElementDeclaration();
+ childFound = true;
+ break;
+ }
+ }
+ }
+ else if (currXsdType instanceof XSDSimpleTypeDefinition) {
+ XSDSimpleTypeDefinition xsdsimple = (XSDSimpleTypeDefinition)currXsdType;
+ //currXsdType = xsdsimple.getBaseType();
+ //XSDSimpleTypeDefinition tempsimple = xsdsimple.getBaseTypeDefinition();
+ //org.eclipse.xsd.XSDParticle temppart = xsdsimple.getComplexType();
+ //XSDSimpleTypeDefinition tempsimple2 = xsdsimple.getItemTypeDefinition();
+ String tempname = xsdsimple.getName();
+ if (levelName.compareTo(tempname) == 0) {
+ childFound = true;
+ }
+ }
+ if (!childFound)
+ break;
+ }
+ }
+ token = index;
+ }
+ else if (t == '@')
+ token = index;
+
+ index++;
+ }
+ // determine if last character is a special character if above is successful
+ if (index == context2.length()) {
+ // looking for parts, attributes or elements?
+ String beginsWith;
+ if ((index-1) == token)
+ beginsWith = EMPTY_STRING;
+ else
+ beginsWith = context2.substring(token+1);
+
+ if ((context2.charAt(token) == '/') || (context2.charAt(token) == '@')) {
+ if (currXsdType == null) {
+ if (currXsdElem != null) {
+ currXsdType = currXsdElem.getTypeDefinition();
+ }
+ }
+ if (currXsdType instanceof XSDComplexTypeDefinition) {
+ XSDComplexTypeDefinition xsdcomplex = (XSDComplexTypeDefinition)currXsdType;
+ @SuppressWarnings("rawtypes")
+ Iterator eaIter;
+ if (context2.charAt(token) == '/')
+ eaIter = XSDUtils.getXSDElementsAndAttributes(xsdcomplex).iterator();
+ else
+ eaIter = XSDUtils.getChildAttributes(xsdcomplex).iterator();
+ Image img = null;
+ String tempReplName = null;
+ String tempDispName = null;
+ String namespace = null;
+ String nsprefix = null;
+ while (eaIter.hasNext()) {
+ Object tempEA = eaIter.next();
+
+ if (tempEA instanceof XSDAttributeDeclaration) {
+ XSDAttributeDeclaration attr = (XSDAttributeDeclaration)tempEA;
+ tempReplName = AT + attr.getName();
+ tempDispName = attr.getName();
+ namespace = attr.getTargetNamespace();
+ if ((namespace != null) && (namespace.length() > 0)) {
+ nsprefix = getNamespacePrefix(currVar, namespace);
+ tempReplName = AT + nsprefix + COLON + attr.getName();
+ tempDispName = nsprefix + COLON + tempDispName;
+ }
+ img = attrImg;
+ }
+ else if (tempEA instanceof XSDElementDeclaration) {
+ XSDElementDeclaration elem = ((XSDElementDeclaration)tempEA).getResolvedElementDeclaration();
+ tempReplName = elem.getName();
+ tempDispName = tempReplName;
+ namespace = elem.getTargetNamespace();
+ if ((namespace != null) && (namespace.length() > 0)) {
+ nsprefix = getNamespacePrefix(currVar, namespace);
+ tempReplName = nsprefix + COLON + tempDispName;
+ tempDispName = tempReplName;
+ }
+ img = elementImg;
+ }
+ if (tempReplName != null) {
+ if ((beginsWith.length() == 0) || (tempDispName != null && tempDispName.startsWith(beginsWith))) {
+ int replOffset = offset-beginsWith.length();
+ int replLen = beginsWith.length();
+ if (context2.charAt(token) == '@') {
+ replOffset--;
+ replLen++;
+ }
+
+ prop = new CompletionProposal(tempReplName, replOffset, replLen,
+ tempReplName.length(), img, tempDispName + " " , //$NON-NLS-1$
+ null, null);
+ results.add(prop);
+ }
+ }
+ tempReplName = null;
+ tempDispName = null;
+ }
+ }
+// else if (currXsdType instanceof XSDSimpleTypeDefinition) {
+// XSDSimpleTypeDefinition simple = (XSDSimpleTypeDefinition)currXsdType;
+// // do nothing?
+// }
+ }
+ // search for parts
+ else if (context2.charAt(token) == '.') {
+ if (currMsg != null) {
+ if (currMsg.getParts() != null) {
+ for(Object next : currMsg.getParts().values() ) {
+ Part item = (Part) next;
+ if ((beginsWith.length() == 0) || (item.getName().startsWith(beginsWith))) {
+ prop = new CompletionProposal(item.getName(), offset-beginsWith.length(), beginsWith.length(),
+ item.getName().length(), partImg, item.getName() + " " , //$NON-NLS-1$
+ null, null);
+ results.add(prop);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ //variables
+ else {
+ for (Variable v : variables) {
+ name = v.getName();
+ if (name.startsWith(context2)) {
+ prop = new CompletionProposal(DIVIDE + name, offset-context.length(), context.length(),
+ name.length()+1, varImg, name + " " , //$NON-NLS-1$
+ null, null);
+ results.add(prop);
+ }
+ }
+ }
+ }
+ catch(IllegalArgumentException ex)
+ {
+ results.toArray(EMPTY_COMPLETION_PROPOSALS);
+ }
+
+ if (results.size() < 1) {
+ return new ICompletionProposal [] {
+ new CompletionProposal(EMPTY_STRING, offset, 0,
+ 0, null, Messages.getString("ExpressionContentAssistProcessor.31"), //$NON-NLS-1$
+ null, null) };
+ }
+
+ return results.toArray(EMPTY_COMPLETION_PROPOSALS);
+ }
+
}
\ No newline at end of file
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/details/providers/OperationContentProvider.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/details/providers/OperationContentProvider.java 2011-01-07 16:02:36 UTC (rev 27983)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/details/providers/OperationContentProvider.java 2011-01-07 16:05:01 UTC (rev 27984)
@@ -13,8 +13,11 @@
import java.util.List;
import org.eclipse.bpel.model.Invoke;
+import org.eclipse.bpel.model.OnEvent;
+import org.eclipse.bpel.model.PartnerLink;
import org.eclipse.bpel.model.Receive;
import org.eclipse.bpel.model.Reply;
+import org.eclipse.bpel.model.partnerlinktype.Role;
import org.eclipse.wst.wsdl.PortType;
/**
@@ -54,5 +57,19 @@
collectElements ( invoke.getPortType(), list );
return ;
}
+
+ // https://issues.jboss.org/browse/JBIDE-8048
+ // for event handlers, the operation comes from partnerlink role
+ if (input instanceof OnEvent) {
+ OnEvent onEvent = (OnEvent) input;
+ PartnerLink partnerLink = onEvent.getPartnerLink();
+ if (partnerLink != null) {
+ Role myRole = partnerLink.getMyRole();
+ if (myRole != null) {
+ collectElements ( myRole.getPortType(), list );
+ }
+ }
+ return ;
+ }
}
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/factories/BPELUIObjectFactory.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/factories/BPELUIObjectFactory.java 2011-01-07 16:02:36 UTC (rev 27983)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/factories/BPELUIObjectFactory.java 2011-01-07 16:05:01 UTC (rev 27984)
@@ -276,7 +276,10 @@
Sequence sequence = BPELFactory.eINSTANCE.createSequence();
sequence.getActivities().add(
BPELFactory.eINSTANCE.createCompensate());
- sequence.getActivities().add(BPELFactory.eINSTANCE.createRethrow());
+ // https://issues.jboss.org/browse/JBIDE-8048
+ // don't generate a rethrow for CompensationHandlers
+ if (result instanceof CatchAll || result instanceof Catch)
+ sequence.getActivities().add(BPELFactory.eINSTANCE.createRethrow());
if (result instanceof Catch) {
Catch _catch = (Catch) result;
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/InvokeImplSection.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/InvokeImplSection.java 2011-01-07 16:02:36 UTC (rev 27983)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/InvokeImplSection.java 2011-01-07 16:05:01 UTC (rev 27984)
@@ -1832,7 +1832,16 @@
private Variable findVariable ( EObject input, Message msg , PartnerLink pl ) {
- Variable list[] = ModelHelper.getVariablesOfType( input, msg );
+ Variable list[] = null;
+
+ // https://issues.jboss.org/browse/JBIDE-8048
+ // this property section is also used by OnEvent
+ if (input instanceof OnEvent) {
+ OnEvent oe = (OnEvent)input;
+ list = new Variable[] { oe.getVariable() };
+ }
+ else
+ list = ModelHelper.getVariablesOfType( input, msg );
if ( list.length == 1 ) {
return list[0];
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/InvokeVariableSection.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/InvokeVariableSection.java 2011-01-07 16:02:36 UTC (rev 27983)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/InvokeVariableSection.java 2011-01-07 16:05:01 UTC (rev 27984)
@@ -64,6 +64,8 @@
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Point;
@@ -379,7 +381,21 @@
}
}
});
+
+ // https://issues.jboss.org/browse/JBIDE-8048
+ // do the same thing when variable name widget loses focus
+ inputVariableText.addFocusListener(new FocusListener() {
+ public void focusGained(FocusEvent arg0) {
+ }
+
+ public void focusLost(FocusEvent arg0) {
+ findAndSetOrCreateVariable(inputVariableText.getText(),
+ isInvoke() ? ModelHelper.OUTGOING
+ : ModelHelper.INCOMING);
+ }
+ });
+
data = new FlatFormData();
data.right = new FlatFormAttachment(100, 0);
data.top = new FlatFormAttachment(inputVariableText, +2, SWT.TOP);
@@ -417,6 +433,11 @@
FlatFormData data;
final Composite composite = this.outputVariableComposite = createFlatFormComposite(parent);
+ if (isReceive()) {
+ // https://issues.jboss.org/browse/JBIDE-8048
+ // don't even bother creating widgets we will never use
+ return composite;
+ }
data = new FlatFormData();
if (top == null) {
@@ -1019,7 +1040,9 @@
}
private boolean isReceive() {
- return getInput() instanceof Receive || getInput() instanceof OnMessage;
+ // https://issues.jboss.org/browse/JBIDE-8048
+ // OnEvent is also a type of Receive
+ return getInput() instanceof Receive || getInput() instanceof OnMessage || getInput() instanceof OnEvent;
}
/**
@@ -1078,6 +1101,11 @@
private void updateInputVariableWidgets() {
inputVariableComposite.setVisible(!isReply());
+ if (getInput() instanceof OnEvent) {
+ // https://issues.jboss.org/browse/JBIDE-8048
+ // hide the proposal drop-down button - user must enter variable name
+ inputVariableButton.setVisible(false);
+ }
if (isReply())
return;
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariablePartAssignCategory.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariablePartAssignCategory.java 2011-01-07 16:02:36 UTC (rev 27983)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariablePartAssignCategory.java 2011-01-07 16:05:01 UTC (rev 27984)
@@ -25,6 +25,7 @@
import org.eclipse.bpel.model.Query;
import org.eclipse.bpel.model.To;
import org.eclipse.bpel.model.Variable;
+import org.eclipse.bpel.model.impl.VariableImpl;
import org.eclipse.bpel.model.messageproperties.Property;
import org.eclipse.bpel.model.util.BPELConstants;
import org.eclipse.bpel.model.util.BPELUtils;
@@ -59,6 +60,7 @@
import org.eclipse.xsd.XSDElementDeclaration;
import org.eclipse.xsd.XSDNamedComponent;
import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.impl.XSDTypeDefinitionImpl;
/**
* An AssignCategory presenting a tree from which the user can select any of: -
@@ -493,7 +495,7 @@
if (query == null)
return;
Variable var = side.getVariable();
- if (isInitializerExist(var, side))
+ if (needInitializer(var, side))
return;
if (MessageDialog
.openQuestion(
@@ -508,7 +510,7 @@
}
}
- private boolean isInitializerExist(Variable var, IVirtualCopyRuleSide side) {
+ private boolean needInitializer(Variable var, IVirtualCopyRuleSide side) {
Assign a = (Assign) ((To) side.getCopyRuleSide()).getContainer()
.getContainer();
EList<Copy> list = a.getCopy();
@@ -527,6 +529,50 @@
if (p.equals(side.getPart()))
return true;
}
+
+ // https://issues.jboss.org/browse/JBIDE-8048
+ // check if initialization is possible: this is not possible if the
+ // variable is implicit (e.g. in a ForEach or OnEvent)
+ String rootElement = null;
+ String uriWSDL = null;
+
+ // Variable is defined using "messageType"
+ Message msg = var.getMessageType();
+ if (msg != null && !msg.eIsProxy()) {
+ // https://jira.jboss.org/browse/JBIDE-6697
+ // from eclipse.org/bpel rev 1.17 on 7/23/2010 3:13AM bugzilla 302943 by gqian: apply the patch from bugzilla
+ if (side.getPart() != null) {
+ XSDElementDeclaration declaration = side.getPart().getElementDeclaration();
+ if (declaration != null) {
+ uriWSDL = declaration.getSchema().getSchemaLocation();
+ rootElement = declaration.getName();
+ }
+ }
+ }
+
+ // can we construct an initializer for this variable?
+ // Variable is defined using "type"
+ XSDTypeDefinitionImpl type = (XSDTypeDefinitionImpl)var.getType();
+ if (type != null && !type.eIsProxy()) {
+ QName qname = new QName(type.getTargetNamespace(), type.getName());
+ rootElement = qname.getLocalPart();
+ uriWSDL = type.eResource().getURI().toString();
+ }
+
+ // Variable is defined using "element"
+ XSDElementDeclaration element = var.getXSDElement();
+ if (element != null && !element.eIsProxy()) {
+ QName qname = new QName(element.getTargetNamespace(), element
+ .getName());
+ rootElement = qname.getLocalPart();
+ uriWSDL = element.eResource().getURI().toString();
+ }
+
+ // Incomplete variable definition
+ if (rootElement == null || uriWSDL == null) {
+ return true;
+ }
+
return false;
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableTypeSelector.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableTypeSelector.java 2011-01-07 16:02:36 UTC (rev 27983)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableTypeSelector.java 2011-01-07 16:05:01 UTC (rev 27984)
@@ -617,7 +617,10 @@
dataTypeNameText.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
- BPELUtil.openEditor(getVariableType(), bpelEditor);
+ // https://issues.jboss.org/browse/JBIDE-8048
+ // don't bother trying to open editor if variable is not defined
+ if (getVariableType() != null)
+ BPELUtil.openEditor(getVariableType(), bpelEditor);
}
});
@@ -686,8 +689,10 @@
data.left = new FlatFormAttachment(dataTypeTreeLabel,0, SWT.LEFT);
data.top = new FlatFormAttachment(dataTypeTreeLabel,0, SWT.BOTTOM);
data.right = new FlatFormAttachment(100, -IDetailsAreaConstants.HSPACE) ;
- data.bottom = new FlatFormAttachment(100, -IDetailsAreaConstants.HSPACE);
- dataTypeTree.setLayoutData(data);
+ // https://issues.jboss.org/browse/JBIDE-8048
+ // make the message structure viewer a wee bit larger than just a single line
+ data.bottom = new FlatFormAttachment(dataTypeTreeLabel,150, SWT.BOTTOM); //new FlatFormAttachment(100, -IDetailsAreaConstants.HSPACE);
+ dataTypeTree.setLayoutData(data);
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/messages.properties
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/messages.properties 2011-01-07 16:02:36 UTC (rev 27983)
+++ trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/messages.properties 2011-01-07 16:05:01 UTC (rev 27984)
@@ -626,10 +626,10 @@
# {0} : node
# {1} : fault QName
BPELC_CATCH__STANDARD_FAULT.summary = Standard fault "{1}" cannot be \
- handled in <{0}> when existOnStandardFaults is set to yes.
+ handled in <{0}> when exitOnStandardFaults is set to yes.
BPELC_CATCH__STANDARD_FAULT = Standard fault "{1}" cannot be \
- handled in <{0}> when existOnStandardFaults is set to yes.
-BPELC_CATCH__STANDARD_FAULT.fix = Remove the handler or disable exit on standard faults.
+ handled in <{0}> when exitOnStandardFaults is set to yes.
+BPELC_CATCH__STANDARD_FAULT.fix = Remove the handler or set "Exit On Standard Faults" to "No" for this process.
#
# BPELC_CATCH__EXIST
# {0}: node name
13 years, 5 months
JBoss Tools SVN: r27983 - in trunk/bpel/plugins: org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/helpers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2011-01-07 11:02:36 -0500 (Fri, 07 Jan 2011)
New Revision: 27983
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/BPELUtil.java
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/helpers/ModelQueryImpl.java
Log:
https://issues.jboss.org/browse/JBIDE-8044
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/BPELUtil.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/BPELUtil.java 2011-01-07 15:59:12 UTC (rev 27982)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/BPELUtil.java 2011-01-07 16:02:36 UTC (rev 27983)
@@ -1394,11 +1394,13 @@
}
return true;
}
- });
- returnObjects.remove(0); //remove the scope containing the compensate
+ });
+ // https://issues.jboss.org/browse/JBIDE-8044
+ if (!returnObjects.isEmpty())
+ returnObjects.remove(0); //remove the scope containing the compensate
return returnObjects;
- }
- throw new IllegalArgumentException();
+ }
+ throw new IllegalArgumentException();
}
public static Object resolveXSDObject(Object xsdObject) {
@@ -1721,13 +1723,14 @@
public static void openEditor(EObject modelObject, BPELEditor editor) {
try {
+ // https://issues.jboss.org/browse/JBIDE-8044
+ Assert.isNotNull(modelObject);
+ Assert.isNotNull(modelObject.eResource());
// https://jira.jboss.org/browse/JBIDE-7351
// try to resolve proxies here, otherwise we don't know editor input
if (modelObject.eIsProxy()) {
modelObject = EmfModelQuery.resolveProxy(editor.getProcess(), modelObject);
}
- Assert.isNotNull(modelObject);
- Assert.isNotNull(modelObject.eResource());
IFile file = BPELUtil.getFileFromURI(modelObject.eResource().getURI());
IDE.openEditor(editor.getSite().getWorkbenchWindow().getActivePage(), file);
} catch (PartInitException ex) {
Modified: trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/helpers/ModelQueryImpl.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/helpers/ModelQueryImpl.java 2011-01-07 15:59:12 UTC (rev 27982)
+++ trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/helpers/ModelQueryImpl.java 2011-01-07 16:02:36 UTC (rev 27983)
@@ -27,6 +27,7 @@
import org.eclipse.bpel.validator.model.IModelQuery;
import org.eclipse.bpel.validator.model.INode;
import org.eclipse.bpel.validator.model.NodeAttributeValueFilter;
+import org.eclipse.bpel.validator.model.NodeNameFilter;
import org.eclipse.bpel.validator.model.Selector;
import org.eclipse.bpel.validator.model.UndefinedNode;
import org.eclipse.bpel.validator.model.XNotImplemented;
@@ -216,17 +217,35 @@
IFilter<INode> aFilterByName = new NodeAttributeValueFilter(IConstants.AT_NAME, name );
IFilter<INode> aFilterByFaultVariable = new NodeAttributeValueFilter(IConstants.AT_FAULT_VARIABLE, name );
-
+ IFilter<INode> aFilterByVariable = new NodeAttributeValueFilter(IConstants.AT_VARIABLE, name );
+ IFilter<INode> aFilterByCounterName = new NodeAttributeValueFilter(IConstants.AT_COUNTER_NAME, name );
+ IFilter<INode> nFilterForEach = new NodeNameFilter(IConstants.ND_FOR_EACH);
+
while (context != null) {
if (Filters.SCOPE_OR_PROCESS.select (context) ) {
+ // select variables defined in a scope or process
INode var = mSelector.selectNode(context,IConstants.ND_VARIABLES,IConstants.ND_VARIABLE,aFilterByName);
if (var != null) {
return var;
}
+ // select catch name defined in faultHandlers
var = mSelector.selectNode(context,IConstants.ND_FAULT_HANDLERS,IConstants.ND_CATCH,aFilterByFaultVariable);
if (var != null) {
return var;
}
+ // https://issues.jboss.org/browse/JBIDE-8044
+ // select variable defined in onEvent of eventHandlers
+ var = mSelector.selectNode(context,IConstants.ND_EVENT_HANDLERS,IConstants.ND_ON_EVENT,aFilterByVariable);
+ if (var != null) {
+ return var;
+ }
+ // select counterName defined in forEach
+ INode parent = mSelector.selectParent(context,nFilterForEach);
+ if (parent != null) {
+ if (aFilterByCounterName.select(parent)) {
+ return parent;
+ }
+ }
}
context = context.parentNode();
}
13 years, 5 months