Author: jpeterka
Date: 2010-10-20 05:03:25 -0400 (Wed, 20 Oct 2010)
New Revision: 25932
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/JBPMBean.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJBPM.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/Annotations.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ConfiguredState.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/PerspectiveType.java
Log:
jBPM Requirement support for jBPM SWTBot Tests Added
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-10-20
08:59:34 UTC (rev 25931)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-10-20
09:03:25 UTC (rev 25932)
@@ -162,14 +162,17 @@
perspectiveLabel = IDELabel.SelectPerspectiveDialog.JPA;
break;
case DEBUG:
- perspectiveLabel = IDELabel.SelectPerspectiveDialog.DEBUG;
- break;
+ perspectiveLabel = IDELabel.SelectPerspectiveDialog.DEBUG;
+ break;
case GUVNOR_REPOSITORY_EXPLORING:
- perspectiveLabel = IDELabel.SelectPerspectiveDialog.GUVNOR_REPOSITORY_EXPLORING;
- break;
+ perspectiveLabel = IDELabel.SelectPerspectiveDialog.GUVNOR_REPOSITORY_EXPLORING;
+ break;
case DROOLS:
- perspectiveLabel = IDELabel.SelectPerspectiveDialog.DROOLS;
- break;
+ perspectiveLabel = IDELabel.SelectPerspectiveDialog.DROOLS;
+ break;
+ case JBPM3:
+ perspectiveLabel = IDELabel.SelectPerspectiveDialog.JBPM3;
+ break;
default:
fail("Unknown perspective to open");
}
@@ -503,6 +506,17 @@
open.finish(wiz, IDELabel.Button.OK);
}
}
+
+ public void addJBPMRuntime(String name, String version, String runtimeHome) {
+ // TODO - needs to be impl.
+ log.info("WARN - Adding JBPM Runtime, needs to be impl.");
+ }
+
+ public void removeJBPMRuntime(String name) {
+ // TODO - needs to be impl
+ log.info("WARN - Removing JBPM Runtime, needs to be impl.");
+ }
+
public void addESBRuntime(String name, String version, String runtimeHome ) {
SWTBot wiz =
open.preferenceOpen(ActionItem.Preference.JBossToolsJBossESBRuntimes.LABEL);
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/Annotations.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/Annotations.java 2010-10-20
08:59:34 UTC (rev 25931)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/Annotations.java 2010-10-20
09:03:25 UTC (rev 25932)
@@ -40,9 +40,14 @@
*/
ESB esb() default @ESB( required = false);
/**
+ * optionally require JBPM runtime
+ * @return
+ */
+ JBPM jbpm() default @JBPM ( required = false );
+ /**
* name of perspective to run within
* @return
- */
+ */
String perspective() default "";
/**
* my default workspace is cleaned before test (attempt to close all shells and
editors, closes 'Welcome' view),
@@ -146,6 +151,28 @@
String operator() default "=";
}
+
+
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface JBPM {
+ /**
+ * true if JBPM is required (default)
+ * @return
+ */
+ boolean required() default true;
+ /**
+ * version of require runtime (use * for all)
+ * @return
+ */
+ String version() default "*";
+ /**
+ * defines operator on runtime version, possible values (=,<,>=<=,>=,!=)
default =
+ * @return
+ */
+ String operator() default "=";
+ }
+
+
public enum ServerState {
/**
* server is present, no matter if runs or not
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ConfiguredState.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ConfiguredState.java 2010-10-20
08:59:34 UTC (rev 25931)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ConfiguredState.java 2010-10-20
09:03:25 UTC (rev 25932)
@@ -17,6 +17,7 @@
private Server server = new Server();
private Seam seam = new Seam();
private ESB esb = new ESB();
+ private JBPM jbpm = new JBPM();
private boolean viewsPrepared = false;
@@ -64,6 +65,13 @@
return esb;
}
+ /**
+ * gets configured jbpm
+ */
+ public JBPM getJBPM() {
+ return jbpm;
+ }
+
public class Server {
/**
* is server runtime & server added?
@@ -125,4 +133,19 @@
*/
public String name = null;
}
+
+ public class JBPM {
+ /**
+ * version of ESB runtime
+ */
+ public String version = null;
+ /**
+ * is configured?
+ */
+ public boolean isConfigured = false;
+ /**
+ * name of added runtime
+ */
+ public String name = null;
+ }
}
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/JBPMBean.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/JBPMBean.java
(rev 0)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/JBPMBean.java 2010-10-20
09:03:25 UTC (rev 25932)
@@ -0,0 +1,27 @@
+package org.jboss.tools.ui.bot.ext.config;
+
+public class JBPMBean {
+ public String version;
+ public String jbpmHome;
+
+ public static JBPMBean fromString(String propValue) throws Exception{
+ try {
+ if (propValue==null) {
+ return null;
+ }
+ String[] jbpmParams = propValue.split(",");
+ JBPMBean bean = new JBPMBean();
+ bean.jbpmHome=jbpmParams[1];
+ bean.version=jbpmParams[0];
+ return bean;
+ }
+ catch (Exception ex) {
+ throw new Exception("Cannot parse jBPM property line",ex);
+ }
+ }
+ @Override
+ public String toString() {
+ return String.format("jBPM runtime version=%s, home=%s",
+ this.version, this.jbpmHome);
+ }
+}
Property changes on:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/JBPMBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java 2010-10-20
08:59:34 UTC (rev 25931)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java 2010-10-20
09:03:25 UTC (rev 25932)
@@ -28,6 +28,7 @@
private SeamBean seam;
private ESBBean esb;
private JavaBean java;
+ private JBPMBean jbpm;
public TestConfiguration(String propName, String propFile) throws Exception {
this.propName = propName;
@@ -55,6 +56,8 @@
printConfig(Keys.SEAM, seam);
esb = ESBBean.fromString(getProperty(Keys.ESB));
printConfig(Keys.ESB, esb);
+ jbpm = JBPMBean.fromString(getProperty(Keys.JBPM));
+ printConfig(Keys.JBPM, jbpm);
checkConfig();
}
@@ -132,4 +135,8 @@
public String getPropName() {
return propName;
}
+
+ public JBPMBean getJBPM() {
+ return jbpm;
+ }
}
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2010-10-20
08:59:34 UTC (rev 25931)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2010-10-20
09:03:25 UTC (rev 25932)
@@ -11,6 +11,7 @@
import org.apache.log4j.Logger;
import org.jboss.tools.ui.bot.ext.config.Annotations.ESB;
+import org.jboss.tools.ui.bot.ext.config.Annotations.JBPM;
import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
import org.jboss.tools.ui.bot.ext.config.Annotations.Seam;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
@@ -26,6 +27,7 @@
public static final String SEAM = "SEAM";
public static final String JAVA = "JAVA";
public static final String ESB = "ESB";
+ public static final String JBPM = "JBPM";
}
public class Values {
@@ -81,6 +83,7 @@
ex.printStackTrace();
}
// load default config by default
+ /*
try {
log.info(" * Loading default configuration first");
currentConfig = new TestConfiguration("default", "");
@@ -92,6 +95,7 @@
finally {
log.info(" * Defaults loaded");
}
+ */
}
/**
@@ -175,6 +179,16 @@
}
return RequirementBase.createAddESB();
}
+
+ private static RequirementBase getJBPMRequirement(JBPM j) {
+ if (!j.required() || currentConfig.getJBPM() == null ) {
+ return null;
+ }
+ if (!matches(currentConfig.getJBPM().version, j.operator(), j.version())) {
+ return null;
+ }
+ return RequirementBase.createAddJBPM();
+ }
/**
* returns list of requirements if given class (Test) can run, all this is
@@ -213,6 +227,14 @@
}
reqs.add(req);
}
+ if (requies.jbpm().required()) {
+ RequirementBase req = getJBPMRequirement(requies.jbpm());
+ if (req == null) {
+ return null;
+ }
+ reqs.add(req);
+ }
+
if (!"".equals(requies.perspective())) {
reqs.add(RequirementBase.createSwitchPerspective(requies
.perspective()));
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJBPM.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJBPM.java
(rev 0)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJBPM.java 2010-10-20
09:03:25 UTC (rev 25932)
@@ -0,0 +1,23 @@
+package org.jboss.tools.ui.bot.ext.config.requirement;
+
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.config.TestConfigurator;
+
+public class AddJBPM extends RequirementBase {
+
+ @Override
+ public boolean checkFulfilled() {
+ return SWTTestExt.configuredState.getJBPM().isConfigured;
+ }
+
+ @Override
+ public void handle() {
+ String jbpmName = "JBPM-"+TestConfigurator.currentConfig.getJBPM().version;
+ SWTTestExt.eclipse.addJBPMRuntime(jbpmName,
TestConfigurator.currentConfig.getJBPM().version,
TestConfigurator.currentConfig.getJBPM().jbpmHome);
+ SWTTestExt.configuredState.getJBPM().isConfigured=true;
+ SWTTestExt.configuredState.getJBPM().name=jbpmName;
+ SWTTestExt.configuredState.getJBPM().version=TestConfigurator.currentConfig.getJBPM().version;
+
+ }
+
+}
Property changes on:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJBPM.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java 2010-10-20
08:59:34 UTC (rev 25931)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java 2010-10-20
09:03:25 UTC (rev 25932)
@@ -119,6 +119,11 @@
RequirementBase req = new AddESB();
return req;
}
+
+ public static RequirementBase createAddJBPM() {
+ RequirementBase req = new AddJBPM();
+ return req;
+ }
public static AddJava createAddJava() {
AddJava req = new AddJava();
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java 2010-10-20
08:59:34 UTC (rev 25931)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java 2010-10-20
09:03:25 UTC (rev 25932)
@@ -22,7 +22,7 @@
public enum EntityType {
HIBERNATE_MAPPING_FILE, JAVA_PROJECT, JAVA_CLASS, HIBERNATE_REVERSE_FILE,
HIBERNATE_CONSOLE,
HIBERNATE_CONFIGURATION_FILE, STRUTS_PROJECT, JPA_PROJECT, DROOLS_PROJECT, DROOLS_RULE,
- GUIDED_DROOLS_RULE,DSL_DROOLS_FILE,RESOURCES_FROM_GUVNOR,SMOOKS_CONFIG;
+ GUIDED_DROOLS_RULE,DSL_DROOLS_FILE,RESOURCES_FROM_GUVNOR,SMOOKS_CONFIG, JBPM3_PROJECT;
public List<String> getGroupsLabels() {
List<String> groupLabel = new LinkedList<String>();
@@ -42,6 +42,7 @@
case DSL_DROOLS_FILE: groupLabel.add(IDELabel.EntityGroup.DROOLS);break;
case RESOURCES_FROM_GUVNOR: groupLabel.add(IDELabel.EntityGroup.GUVNOR);break;
case SMOOKS_CONFIG: groupLabel.add(IDELabel.EntityGroup.SMOOKS);break;
+ case JBPM3_PROJECT: groupLabel.add(IDELabel.EntityGroup.JBPM);break;
default: fail("Unknown Entity Type");
}
@@ -70,6 +71,7 @@
case DSL_DROOLS_FILE: entityLabel = IDELabel.EntityLabel.DSL_DROOLS_FILE; break;
case RESOURCES_FROM_GUVNOR: entityLabel = IDELabel.EntityLabel.RESOURCES_FROM_GUVNOR;
break;
case SMOOKS_CONFIG: entityLabel = IDELabel.EntityLabel.SMOOKS_CONF_FILE; break;
+ case JBPM3_PROJECT: entityLabel = IDELabel.EntityLabel.JBPM3_PROJECT; break;
default: fail("Unknown Entity Type");
}
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-10-20
08:59:34 UTC (rev 25931)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-10-20
09:03:25 UTC (rev 25932)
@@ -160,6 +160,7 @@
public static final String DROOLS = "Drools";
public static final String GUVNOR = "Guvnor";
public static final String SMOOKS = "Smooks";
+ public static final String JBPM = "JBoss jBPM";
}
public class EntityLabel {
@@ -178,6 +179,7 @@
public static final String DSL_DROOLS_FILE = "Domain Specific Language";
public static final String SMOOKS_CONF_FILE = "Smooks Configuration File";
public static final String RESOURCES_FROM_GUVNOR = "Resources from Guvnor";
+ public static final String JBPM3_PROJECT = "jBPM 3 Project";
}
public class JavaProjectWizard {
@@ -231,6 +233,7 @@
public static final String DEBUG = "Debug";
public static final String GUVNOR_REPOSITORY_EXPLORING = "Guvnor Repository
Exploring";
public static final String DROOLS = "Drools";
+ public static final String JBPM3 = "jBPM jPDL 3";
}
/**
* Hibernate Console Wizard (ConsoleConfigurationCreationWizard) Labels (
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/PerspectiveType.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/PerspectiveType.java 2010-10-20
08:59:34 UTC (rev 25931)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/PerspectiveType.java 2010-10-20
09:03:25 UTC (rev 25932)
@@ -17,6 +17,6 @@
*/
public enum PerspectiveType {
SEAM, JAVA, WEB_DEVELOPMENT, HIBERNATE, DB_DEVELOPMENT, JPA, DEBUG,
GUVNOR_REPOSITORY_EXPLORING,
- DROOLS;
+ DROOLS, JBPM3;
}