diff --git a/README.md b/README.md index 4aa0bf8f..e6df2108 100644 --- a/README.md +++ b/README.md @@ -58,11 +58,13 @@ Options: -f,--use-custom-test-folder Use a custom test folder (folder name defaults to "test") GROUPS for and are in CAPITAL LETTERS. -: [ALL, LOCALS, VMS, RECENT, ode, bpelg, openesb, petalsesb, -orchestra, active-bpel, openesb23, openesb231, petalsesb41, ode136, -ode-in-memory, ode136-in-memory, bpelg-in-memory, wso2_v3_1_0, -wso2_v3_0_0, wso2_v2_1_2, ode_v, bpelg_v, openesb_v, petalsesb_v, -orchestra_v, active_bpel_v] +: [ALL, LOCALS, VMS, RECENT, ode__1_3_5, ode__1_3_6, +ode__1_3_5__in-memory, ode__1_3_6__in-memory, openesb__2_2, openesb__2_3, +openesb__2_3_1, openesb__3_0_1, orchestra__4_9, active-bpel__5_0_2, +petalsesb__4_0, petalsesb__4_1, bpelg__5_3, bpelg__5_3__in-memory, +wso2__3_2_0, wso2__3_1_0, wso2__3_0_0, wso2__2_1_2, ode__1_3_5__virtual, +bpelg__5_3__virtual, openesb__2_2__virtual, petalsesb__4_0__virtual, +orchestra__4_9__virtual, active-bpel__5_0_2__virtual] : [ALL, BASIC_ACTIVITIES_WAIT, BASIC_ACTIVITIES_THROW, BASIC_ACTIVITIES_RECEIVE, BASIC_ACTIVITIES_INVOKE, BASIC_ACTIVITIES_ASSIGN, BASIC_ACTIVITIES, SCOPES_EVENT_HANDLERS, @@ -104,8 +106,9 @@ Options: -o,--open-results-in-browser Opens results in default browser GROUPS for and are in CAPITAL LETTERS. -: [ALL, camunda, camunda710, camunda720, camunda730, activiti, -activiti5170, jbpm, jbpm610, jbpm620] +: [ALL, camunda__7_0_0, camunda__7_1_0, camunda__7_2_0, +camunda__7_3_0, activiti__5_16_3, activiti__5_17_0, jbpm__6_0_1, +jbpm__6_1_0, jbpm__6_2_0] : [ALL, GATEWAYS, ACTIVITIES, ERRORS, EVENTS, BASICS, DATA, diff --git a/src/main/groovy/betsy/bpel/UniformProcessEngineManagementAPI.java b/src/main/groovy/betsy/bpel/UniformProcessEngineManagementAPI.java index 7e4c4410..94f93a96 100644 --- a/src/main/groovy/betsy/bpel/UniformProcessEngineManagementAPI.java +++ b/src/main/groovy/betsy/bpel/UniformProcessEngineManagementAPI.java @@ -4,6 +4,7 @@ import betsy.bpel.model.BPELProcess; import betsy.common.engines.EngineAPI; import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import java.nio.file.Path; import java.util.List; @@ -77,7 +78,8 @@ public List getLogs() { } @Override - public String getName() { - return engine.getName(); + public Engine getEngineId() { + return engine.getEngineId(); } + } diff --git a/src/main/groovy/betsy/bpel/engines/AbstractBPELEngine.java b/src/main/groovy/betsy/bpel/engines/AbstractBPELEngine.java index 5549df40..704174bd 100644 --- a/src/main/groovy/betsy/bpel/engines/AbstractBPELEngine.java +++ b/src/main/groovy/betsy/bpel/engines/AbstractBPELEngine.java @@ -4,7 +4,6 @@ import betsy.common.HasPath; import betsy.common.engines.EngineAPI; import betsy.common.engines.ProcessLanguage; -import betsy.common.util.ClasspathHelper; import java.nio.file.Path; import java.util.ArrayList; @@ -16,14 +15,7 @@ public abstract class AbstractBPELEngine implements EngineAPI, HasP private BPELEnginePackageBuilder packageBuilder = new BPELEnginePackageBuilder(); private Path parentFolder; - /** - * The path src/main/xslt/$engine - * - * @return the path src/main/xslt/$engine - */ - public Path getXsltPath() { - return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpel/" + getName()); - } + public abstract Path getXsltPath(); /** * The path test/$engine diff --git a/src/main/groovy/betsy/bpel/engines/activebpel/ActiveBpelEngine.java b/src/main/groovy/betsy/bpel/engines/activebpel/ActiveBpelEngine.java index d7f44b54..ce6ad0ba 100644 --- a/src/main/groovy/betsy/bpel/engines/activebpel/ActiveBpelEngine.java +++ b/src/main/groovy/betsy/bpel/engines/activebpel/ActiveBpelEngine.java @@ -2,9 +2,12 @@ import betsy.bpel.engines.AbstractLocalBPELEngine; import betsy.bpel.model.BPELProcess; +import betsy.common.engines.ProcessLanguage; import betsy.common.engines.tomcat.Tomcat; +import betsy.common.model.Engine; import betsy.common.tasks.FileTasks; import betsy.common.tasks.XSLTTasks; +import betsy.common.util.ClasspathHelper; import org.apache.log4j.Logger; import java.io.File; @@ -16,8 +19,12 @@ public class ActiveBpelEngine extends AbstractLocalBPELEngine { @Override - public String getName() { - return "active-bpel"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "activebpel", "5.0.2"); + } + + public Path getXsltPath() { + return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpel/active-bpel"); } @Override @@ -81,7 +88,7 @@ public boolean isRunning() { @Override public void install() { - new ActiveBpelInstaller().install(); + new ActiveBpelInstaller(getServerPath()).install(); } @Override diff --git a/src/main/groovy/betsy/bpel/engines/activebpel/ActiveBpelInstaller.java b/src/main/groovy/betsy/bpel/engines/activebpel/ActiveBpelInstaller.java index 6c346639..5da185df 100644 --- a/src/main/groovy/betsy/bpel/engines/activebpel/ActiveBpelInstaller.java +++ b/src/main/groovy/betsy/bpel/engines/activebpel/ActiveBpelInstaller.java @@ -13,9 +13,15 @@ import java.util.Map; public class ActiveBpelInstaller { + + private final Path serverDir; + + public ActiveBpelInstaller(Path serverDir) { + this.serverDir = serverDir; + } + public void install() { // setup engine folder - Path serverDir = Paths.get("server/active-bpel"); FileTasks.mkdirs(serverDir); TomcatInstaller installer = TomcatInstaller.v5(serverDir); diff --git a/src/main/groovy/betsy/bpel/engines/bpelg/BpelgEngine.java b/src/main/groovy/betsy/bpel/engines/bpelg/BpelgEngine.java index 4549edce..3a66f120 100644 --- a/src/main/groovy/betsy/bpel/engines/bpelg/BpelgEngine.java +++ b/src/main/groovy/betsy/bpel/engines/bpelg/BpelgEngine.java @@ -2,18 +2,26 @@ import betsy.bpel.engines.AbstractLocalBPELEngine; import betsy.bpel.model.BPELProcess; +import betsy.common.engines.ProcessLanguage; import betsy.common.engines.tomcat.Tomcat; +import betsy.common.model.Engine; import betsy.common.tasks.FileTasks; import betsy.common.tasks.XSLTTasks; +import betsy.common.util.ClasspathHelper; import java.nio.file.Path; import java.util.LinkedList; import java.util.List; public class BpelgEngine extends AbstractLocalBPELEngine { + + public Path getXsltPath() { + return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpel/bpelg"); + } + @Override - public String getName() { - return "bpelg"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "bpelg", "5.3"); } public Path getDeploymentDir() { diff --git a/src/main/groovy/betsy/bpel/engines/bpelg/BpelgInMemoryEngine.java b/src/main/groovy/betsy/bpel/engines/bpelg/BpelgInMemoryEngine.java index bef929cc..b6213f93 100644 --- a/src/main/groovy/betsy/bpel/engines/bpelg/BpelgInMemoryEngine.java +++ b/src/main/groovy/betsy/bpel/engines/bpelg/BpelgInMemoryEngine.java @@ -1,9 +1,20 @@ package betsy.bpel.engines.bpelg; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; +import betsy.common.util.ClasspathHelper; + +import java.nio.file.Path; + public class BpelgInMemoryEngine extends BpelgEngine { + + public Path getXsltPath() { + return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpel/bpelg-in-memory"); + } + @Override - public String getName() { - return "bpelg-in-memory"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "bpelg", "5.3", "in-memory"); } } diff --git a/src/main/groovy/betsy/bpel/engines/ode/Ode136Engine.java b/src/main/groovy/betsy/bpel/engines/ode/Ode136Engine.java index be94a66d..f241b7cd 100644 --- a/src/main/groovy/betsy/bpel/engines/ode/Ode136Engine.java +++ b/src/main/groovy/betsy/bpel/engines/ode/Ode136Engine.java @@ -1,13 +1,16 @@ package betsy.bpel.engines.ode; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import betsy.common.util.ClasspathHelper; import java.nio.file.Path; public class Ode136Engine extends OdeEngine { + @Override - public String getName() { - return "ode136"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "ode", "1.3.6"); } public Path getXsltPath() { diff --git a/src/main/groovy/betsy/bpel/engines/ode/Ode136InMemoryEngine.java b/src/main/groovy/betsy/bpel/engines/ode/Ode136InMemoryEngine.java index 4af4c0b9..d8c46aa1 100644 --- a/src/main/groovy/betsy/bpel/engines/ode/Ode136InMemoryEngine.java +++ b/src/main/groovy/betsy/bpel/engines/ode/Ode136InMemoryEngine.java @@ -1,13 +1,16 @@ package betsy.bpel.engines.ode; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import betsy.common.util.ClasspathHelper; import java.nio.file.Path; public class Ode136InMemoryEngine extends Ode136Engine { + @Override - public String getName() { - return "ode136-in-memory"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "ode", "1.3.6", "in-memory"); } public Path getXsltPath() { diff --git a/src/main/groovy/betsy/bpel/engines/ode/OdeEngine.java b/src/main/groovy/betsy/bpel/engines/ode/OdeEngine.java index 21677180..1a9ddb19 100644 --- a/src/main/groovy/betsy/bpel/engines/ode/OdeEngine.java +++ b/src/main/groovy/betsy/bpel/engines/ode/OdeEngine.java @@ -2,9 +2,12 @@ import betsy.bpel.engines.AbstractLocalBPELEngine; import betsy.bpel.model.BPELProcess; +import betsy.common.engines.ProcessLanguage; import betsy.common.engines.tomcat.Tomcat; +import betsy.common.model.Engine; import betsy.common.tasks.FileTasks; import betsy.common.tasks.XSLTTasks; +import betsy.common.util.ClasspathHelper; import java.nio.file.Path; import java.util.LinkedList; @@ -15,8 +18,13 @@ public class OdeEngine extends AbstractLocalBPELEngine { public static final String TEST_INTERFACE_SERVICE = "TestInterfaceService"; @Override - public String getName() { - return "ode"; + public Path getXsltPath() { + return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpel/ode"); + } + + @Override + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "ode", "1.3.5"); } @Override diff --git a/src/main/groovy/betsy/bpel/engines/ode/OdeInMemoryEngine.java b/src/main/groovy/betsy/bpel/engines/ode/OdeInMemoryEngine.java index e793fca0..45c1fe09 100644 --- a/src/main/groovy/betsy/bpel/engines/ode/OdeInMemoryEngine.java +++ b/src/main/groovy/betsy/bpel/engines/ode/OdeInMemoryEngine.java @@ -1,13 +1,16 @@ package betsy.bpel.engines.ode; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import betsy.common.util.ClasspathHelper; import java.nio.file.Path; public class OdeInMemoryEngine extends OdeEngine { + @Override - public String getName() { - return "ode-in-memory"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "ode", "1.3.5", "in-memory"); } @Override diff --git a/src/main/groovy/betsy/bpel/engines/openesb/OpenEsb231Engine.java b/src/main/groovy/betsy/bpel/engines/openesb/OpenEsb231Engine.java index a14012f0..05a41ee3 100644 --- a/src/main/groovy/betsy/bpel/engines/openesb/OpenEsb231Engine.java +++ b/src/main/groovy/betsy/bpel/engines/openesb/OpenEsb231Engine.java @@ -1,19 +1,17 @@ package betsy.bpel.engines.openesb; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import betsy.common.util.ClasspathHelper; import betsy.common.util.OperatingSystem; -import java.nio.file.Path; import java.nio.file.Paths; public class OpenEsb231Engine extends OpenEsbEngine { - @Override - public String getName() { - return "openesb231"; - } - public Path getXsltPath() { - return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpel/openesb"); + @Override + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "openesb", "2.3.1"); } @Override diff --git a/src/main/groovy/betsy/bpel/engines/openesb/OpenEsb23Engine.java b/src/main/groovy/betsy/bpel/engines/openesb/OpenEsb23Engine.java index 23098c55..19c906c8 100644 --- a/src/main/groovy/betsy/bpel/engines/openesb/OpenEsb23Engine.java +++ b/src/main/groovy/betsy/bpel/engines/openesb/OpenEsb23Engine.java @@ -1,19 +1,17 @@ package betsy.bpel.engines.openesb; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import betsy.common.util.ClasspathHelper; import betsy.common.util.OperatingSystem; -import java.nio.file.Path; import java.nio.file.Paths; public class OpenEsb23Engine extends OpenEsbEngine { - @Override - public String getName() { - return "openesb23"; - } - public Path getXsltPath() { - return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpel/openesb"); + @Override + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "openesb", "2.3"); } @Override diff --git a/src/main/groovy/betsy/bpel/engines/openesb/OpenEsb301StandaloneEngine.java b/src/main/groovy/betsy/bpel/engines/openesb/OpenEsb301StandaloneEngine.java index 50e6564e..122426a4 100644 --- a/src/main/groovy/betsy/bpel/engines/openesb/OpenEsb301StandaloneEngine.java +++ b/src/main/groovy/betsy/bpel/engines/openesb/OpenEsb301StandaloneEngine.java @@ -3,6 +3,8 @@ import betsy.bpel.engines.AbstractLocalBPELEngine; import betsy.bpel.model.BPELProcess; import betsy.common.config.Configuration; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import betsy.common.tasks.*; import betsy.common.util.ClasspathHelper; import betsy.common.util.StringUtils; @@ -188,7 +190,7 @@ public boolean isRunning() { } @Override - public String getName() { - return "openesb301standalone"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "openesb", "3.0.1"); } } diff --git a/src/main/groovy/betsy/bpel/engines/openesb/OpenEsbEngine.java b/src/main/groovy/betsy/bpel/engines/openesb/OpenEsbEngine.java index 36051c99..e5634dcf 100644 --- a/src/main/groovy/betsy/bpel/engines/openesb/OpenEsbEngine.java +++ b/src/main/groovy/betsy/bpel/engines/openesb/OpenEsbEngine.java @@ -2,6 +2,8 @@ import betsy.bpel.engines.AbstractLocalBPELEngine; import betsy.bpel.model.BPELProcess; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import betsy.common.tasks.FileTasks; import betsy.common.tasks.WaitTasks; import betsy.common.tasks.XSLTTasks; @@ -14,9 +16,13 @@ public class OpenEsbEngine extends AbstractLocalBPELEngine { + public Path getXsltPath() { + return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpel/openesb"); + } + @Override - public String getName() { - return "openesb"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "openesb", "2.2"); } @Override diff --git a/src/main/groovy/betsy/bpel/engines/orchestra/OrchestraEngine.java b/src/main/groovy/betsy/bpel/engines/orchestra/OrchestraEngine.java index 3525e6cd..bf753ca7 100644 --- a/src/main/groovy/betsy/bpel/engines/orchestra/OrchestraEngine.java +++ b/src/main/groovy/betsy/bpel/engines/orchestra/OrchestraEngine.java @@ -2,7 +2,9 @@ import betsy.bpel.engines.AbstractLocalBPELEngine; import betsy.bpel.model.BPELProcess; +import betsy.common.engines.ProcessLanguage; import betsy.common.engines.tomcat.Tomcat; +import betsy.common.model.Engine; import betsy.common.tasks.FileTasks; import java.nio.file.Path; @@ -10,9 +12,14 @@ import java.util.List; public class OrchestraEngine extends AbstractLocalBPELEngine { + + public Path getXsltPath() { + throw new IllegalStateException("unused"); + } + @Override - public String getName() { - return "orchestra"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "orchestra", "4.9"); } public Tomcat getTomcat() { @@ -21,7 +28,7 @@ public Tomcat getTomcat() { @Override public void install() { - new OrchestraInstaller().install(); + new OrchestraInstaller(getServerPath()).install(); } @Override diff --git a/src/main/groovy/betsy/bpel/engines/orchestra/OrchestraInstaller.java b/src/main/groovy/betsy/bpel/engines/orchestra/OrchestraInstaller.java index 4571775e..94c2c408 100644 --- a/src/main/groovy/betsy/bpel/engines/orchestra/OrchestraInstaller.java +++ b/src/main/groovy/betsy/bpel/engines/orchestra/OrchestraInstaller.java @@ -17,8 +17,15 @@ public class OrchestraInstaller { - private final Path serverDir = Paths.get("server/orchestra"); - private final Path installDir = serverDir.resolve("orchestra-cxf-tomcat-4.9.0"); + private final Path serverDir; + + public OrchestraInstaller(Path serverPath) { + this.serverDir = serverPath; + } + + public Path getInstallDir() { + return serverDir.resolve("orchestra-cxf-tomcat-4.9.0"); + } public Path getAntPath() { return Configuration.getAntHome().resolve("bin"); @@ -36,13 +43,13 @@ public void install() { ZipTasks.unzip(Configuration.getDownloadsDir().resolve(fileName), serverDir); - setPropertyInPropertiesFile(installDir.resolve("conf").resolve("install.properties"), "catalina.home", "../" + tomcatInstaller.getTomcatName()); + setPropertyInPropertiesFile(getInstallDir().resolve("conf").resolve("install.properties"), "catalina.home", "../" + tomcatInstaller.getTomcatName()); ConsoleTasks.setupAnt(getAntPath()); // clean up data (with db and config files in the users home directory) - ConsoleTasks.executeOnWindowsAndIgnoreError(ConsoleTasks.CliCommand.build(installDir, getAntPath().toAbsolutePath().toString() + "/ant install")); - ConsoleTasks.executeOnUnixAndIgnoreError(ConsoleTasks.CliCommand.build(installDir, getAntPath().toAbsolutePath().toString() + "/ant").values("install")); + ConsoleTasks.executeOnWindowsAndIgnoreError(ConsoleTasks.CliCommand.build(getInstallDir(), getAntPath().toAbsolutePath().toString() + "/ant install")); + ConsoleTasks.executeOnUnixAndIgnoreError(ConsoleTasks.CliCommand.build(getInstallDir(), getAntPath().toAbsolutePath().toString() + "/ant").values("install")); } private static void setPropertyInPropertiesFile(Path propertiesFile, String key, String value) { diff --git a/src/main/groovy/betsy/bpel/engines/petalsesb/PetalsEsb41Engine.java b/src/main/groovy/betsy/bpel/engines/petalsesb/PetalsEsb41Engine.java index bb79dc47..89682c90 100644 --- a/src/main/groovy/betsy/bpel/engines/petalsesb/PetalsEsb41Engine.java +++ b/src/main/groovy/betsy/bpel/engines/petalsesb/PetalsEsb41Engine.java @@ -4,6 +4,8 @@ import betsy.common.tasks.FileTasks; import betsy.common.util.ClasspathHelper; import org.apache.log4j.Logger; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import java.nio.file.Path; import java.nio.file.Paths; @@ -13,18 +15,14 @@ public class PetalsEsb41Engine extends PetalsEsbEngine { private static final Logger LOGGER = Logger.getLogger(PetalsEsb41Engine.class); @Override - public String getName() { - return "petalsesb41"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "petalsesb", "4.1"); } public String getPetalsFolderName() { return "petals-esb-4.1"; } - public Path getXsltPath() { - return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpel/petalsesb"); - } - @Override public Path getPetalsCliBinFolder() {return getServerPath().resolve("petals-cli-2.0.0/bin");} @@ -45,14 +43,15 @@ public void shutdown() { @Override public void install() { - PetalsEsbInstaller installer = new PetalsEsbInstaller(this); - installer.setServerDir(Paths.get("server/petalsesb41")); + PetalsEsbInstaller installer = new PetalsEsbInstaller(); + installer.setServerDir(getServerPath()); installer.setFileName("petals-esb-distrib-4.1.0.zip"); - installer.setTargetEsbInstallDir(Paths.get("server/petalsesb41/petals-esb-4.1/install")); - installer.setBpelComponentPath(Paths.get("server/petalsesb41/petals-esb-distrib-4.1.0/esb-components/petals-se-bpel-1.1.0.zip")); - installer.setSoapComponentPath(Paths.get("server/petalsesb41/petals-esb-distrib-4.1.0/esb-components/petals-bc-soap-4.2.0.zip")); - installer.setSourceFile(Paths.get("server/petalsesb41/petals-esb-distrib-4.1.0/esb/petals-esb-4.1.zip")); - installer.setCliFile(Paths.get("server/petalsesb41/petals-esb-distrib-4.1.0/esb/petals-cli-2.0.0.zip")); + installer.setTargetEsbInstallDir(getServerPath().resolve("petals-esb-4.1/install")); + installer.setBpelComponentPath(getServerPath().resolve("petals-esb-distrib-4.1.0/esb-components/petals-se-bpel-1.1.0.zip")); + installer.setSoapComponentPath(getServerPath().resolve("petals-esb-distrib-4.1.0/esb-components/petals-bc-soap-4.2.0.zip")); + installer.setSourceFile(getServerPath().resolve("petals-esb-distrib-4.1.0/esb/petals-esb-4.1.zip")); + installer.setCliFile(getServerPath().resolve("petals-esb-distrib-4.1.0/esb/petals-cli-2.0.0.zip")); + installer.setPetalsBinFolder(getPetalsBinFolder()); installer.install(); } diff --git a/src/main/groovy/betsy/bpel/engines/petalsesb/PetalsEsbEngine.java b/src/main/groovy/betsy/bpel/engines/petalsesb/PetalsEsbEngine.java index 6c8da6f6..dcd1eecd 100644 --- a/src/main/groovy/betsy/bpel/engines/petalsesb/PetalsEsbEngine.java +++ b/src/main/groovy/betsy/bpel/engines/petalsesb/PetalsEsbEngine.java @@ -3,7 +3,10 @@ import betsy.bpel.engines.AbstractLocalBPELEngine; import betsy.bpel.model.BPELProcess; import betsy.common.config.Configuration; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import betsy.common.tasks.*; +import betsy.common.util.ClasspathHelper; import org.apache.log4j.Logger; import java.nio.file.Files; @@ -14,9 +17,14 @@ import java.util.Map; public class PetalsEsbEngine extends AbstractLocalBPELEngine { + + public Path getXsltPath() { + return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpel/petalsesb"); + } + @Override - public String getName() { - return "petalsesb"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "petalsesb", "4.0"); } @Override @@ -106,7 +114,16 @@ public void shutdown() { @Override public void install() { - new PetalsEsbInstaller(this).install(); + PetalsEsbInstaller installer = new PetalsEsbInstaller(); + installer.setServerDir(getServerPath()); + installer.setFileName("petals-esb-distrib-4.0.zip"); + installer.setTargetEsbInstallDir(getServerPath().resolve("petals-esb-4.0/install")); + installer.setBpelComponentPath(getServerPath().resolve("petals-esb-distrib-4.0/esb-components/petals-se-bpel-1.1.0.zip")); + installer.setSoapComponentPath(getServerPath().resolve("petals-esb-distrib-4.0/esb-components/petals-bc-soap-4.1.0.zip")); + installer.setSourceFile(getServerPath().resolve("petals-esb-distrib-4.0/esb/petals-esb-4.0.zip")); + installer.setCliFile(getServerPath().resolve("petals-esb-distrib-4.0/esb/petals-cli-1.0.0.zip")); + installer.setPetalsBinFolder(getPetalsBinFolder()); + installer.install(); } @Override diff --git a/src/main/groovy/betsy/bpel/engines/petalsesb/PetalsEsbInstaller.java b/src/main/groovy/betsy/bpel/engines/petalsesb/PetalsEsbInstaller.java index 0a76591b..056b8b95 100644 --- a/src/main/groovy/betsy/bpel/engines/petalsesb/PetalsEsbInstaller.java +++ b/src/main/groovy/betsy/bpel/engines/petalsesb/PetalsEsbInstaller.java @@ -11,9 +11,14 @@ public class PetalsEsbInstaller { - public PetalsEsbInstaller(PetalsEsbEngine engine){ - this.engine = engine; - } + private Path serverDir; + private String fileName; + private Path targetEsbInstallDir; + private Path bpelComponentPath; + private Path soapComponentPath; + private Path sourceFile; + private Path petalsBinFolder; + private Path cliFile; public void install() { FileTasks.deleteDirectory(serverDir); @@ -32,9 +37,13 @@ public void install() { FileTasks.copyFileIntoFolder(bpelComponentPath, targetEsbInstallDir); FileTasks.copyFileIntoFolder(soapComponentPath, targetEsbInstallDir); - FileTasks.createFile(engine.getPetalsBinFolder().resolve("start-petals.sh"), "export JAVA_HOME=$JAVA7_HOME\ncd \"" + engine.getPetalsBinFolder().toAbsolutePath() + "\" && ./petals-esb.sh >/dev/null 2>&1 &"); - ConsoleTasks.executeOnUnix(ConsoleTasks.CliCommand.build(engine.getPetalsBinFolder(), "chmod").values("+x", "start-petals.sh")); - ConsoleTasks.executeOnUnix(ConsoleTasks.CliCommand.build(engine.getPetalsBinFolder(), "chmod").values("+x", "petals-esb.sh")); + FileTasks.createFile(petalsBinFolder.resolve("start-petals.sh"), "export JAVA_HOME=$JAVA7_HOME\ncd \"" + petalsBinFolder.toAbsolutePath() + "\" && ./petals-esb.sh >/dev/null 2>&1 &"); + ConsoleTasks.executeOnUnix(ConsoleTasks.CliCommand.build(petalsBinFolder, "chmod").values("+x", "start-petals.sh")); + ConsoleTasks.executeOnUnix(ConsoleTasks.CliCommand.build(petalsBinFolder, "chmod").values("+x", "petals-esb.sh")); + } + + public void setPetalsBinFolder(Path petalsBinFolder) { + this.petalsBinFolder = petalsBinFolder; } public void setServerDir(Path serverDir) { @@ -67,12 +76,4 @@ public void setSourceFile(Path sourceFile) { public void setCliFile(Path cliFile) { this.cliFile = cliFile;} - private Path serverDir = Paths.get("server/petalsesb"); - private String fileName = "petals-esb-distrib-4.0.zip"; - private Path targetEsbInstallDir = serverDir.resolve("petals-esb-4.0/install"); - private Path bpelComponentPath = serverDir.resolve("petals-esb-distrib-4.0/esb-components/petals-se-bpel-1.1.0.zip"); - private Path soapComponentPath = serverDir.resolve("petals-esb-distrib-4.0/esb-components/petals-bc-soap-4.1.0.zip"); - private Path sourceFile = serverDir.resolve("petals-esb-distrib-4.0/esb/petals-esb-4.0.zip"); - private Path cliFile = serverDir.resolve("petals-esb-distrib-4.0/esb/petals-cli-1.0.0.zip"); - private PetalsEsbEngine engine; } diff --git a/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v2_1_2.java b/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v2_1_2.java index e4611ed3..8f70d654 100644 --- a/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v2_1_2.java +++ b/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v2_1_2.java @@ -1,13 +1,16 @@ package betsy.bpel.engines.wso2; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import betsy.common.tasks.FileTasks; import java.nio.file.Path; public class Wso2Engine_v2_1_2 extends Wso2Engine_v3_1_0 { + @Override - public String getName() { - return "wso2_v2_1_2"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "wso2", "2.1.2"); } @Override diff --git a/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v3_0_0.java b/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v3_0_0.java index 1b5e8e1e..74dbc0ef 100644 --- a/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v3_0_0.java +++ b/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v3_0_0.java @@ -1,11 +1,15 @@ package betsy.bpel.engines.wso2; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; + import java.nio.file.Path; public class Wso2Engine_v3_0_0 extends Wso2Engine_v3_1_0 { + @Override - public String getName() { - return "wso2_v3_0_0"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "wso2", "3.0.0"); } @Override diff --git a/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v3_1_0.java b/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v3_1_0.java index b5384fee..2788a2fb 100644 --- a/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v3_1_0.java +++ b/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v3_1_0.java @@ -3,6 +3,8 @@ import betsy.bpel.engines.AbstractLocalBPELEngine; import betsy.bpel.model.BPELProcess; import betsy.common.config.Configuration; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import betsy.common.tasks.*; import betsy.common.util.ClasspathHelper; @@ -20,8 +22,8 @@ public Path getXsltPath() { } @Override - public String getName() { - return "wso2_v3_1_0"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "wso2", "3.1.0"); } @Override diff --git a/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v3_2_0.java b/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v3_2_0.java index 6fe85169..c0876548 100644 --- a/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v3_2_0.java +++ b/src/main/groovy/betsy/bpel/engines/wso2/Wso2Engine_v3_2_0.java @@ -1,25 +1,15 @@ package betsy.bpel.engines.wso2; -import betsy.bpel.engines.AbstractLocalBPELEngine; -import betsy.bpel.model.BPELProcess; -import betsy.common.config.Configuration; -import betsy.common.tasks.*; -import betsy.common.util.ClasspathHelper; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import java.nio.file.Path; -import java.util.LinkedList; -import java.util.List; public class Wso2Engine_v3_2_0 extends Wso2Engine_v3_1_0 { @Override - public Path getXsltPath() { - return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpel/ode"); - } - - @Override - public String getName() { - return "wso2_v3_2_0"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "wso2", "3.2.0"); } public String getZipFileName() { diff --git a/src/main/groovy/betsy/bpel/model/BPELProcess.java b/src/main/groovy/betsy/bpel/model/BPELProcess.java index 69119799..e545e6db 100644 --- a/src/main/groovy/betsy/bpel/model/BPELProcess.java +++ b/src/main/groovy/betsy/bpel/model/BPELProcess.java @@ -81,8 +81,7 @@ public Path getTargetSoapUIPath() { } public String getTargetSoapUIProjectName() { - String result = getEngine() + "." + getGroup() + "." + getName(); - return result.replaceAll("__", "."); + return getEngine() + "." + getGroup() + "." + getName(); } /** diff --git a/src/main/groovy/betsy/bpel/virtual/host/engines/AbstractVirtualBPELEngine.java b/src/main/groovy/betsy/bpel/virtual/host/engines/AbstractVirtualBPELEngine.java index a6ef5bff..d6efa434 100644 --- a/src/main/groovy/betsy/bpel/virtual/host/engines/AbstractVirtualBPELEngine.java +++ b/src/main/groovy/betsy/bpel/virtual/host/engines/AbstractVirtualBPELEngine.java @@ -20,6 +20,8 @@ import betsy.bpel.virtual.host.exceptions.vm.VirtualMachineNotFoundException; import betsy.bpel.virtual.host.virtualbox.SnapshotCreator; import betsy.common.config.Configuration; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import org.apache.log4j.Logger; import org.codehaus.groovy.runtime.StackTraceUtils; @@ -27,6 +29,7 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; +import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -48,6 +51,15 @@ public abstract class AbstractVirtualBPELEngine extends AbstractBPELEngine imple public AbstractBPELEngine defaultEngine; + @Override + public Engine getEngineId() { + Engine engineId = defaultEngine.getEngineId(); + List configuration = new LinkedList<>(); + configuration.addAll(engineId.getConfiguration()); + configuration.add("virtual"); + return new Engine(ProcessLanguage.BPEL, engineId.getName(), engineId.getVersion(), configuration); + } + private VirtualBoxMachine vm = null; public void setVirtualBox(VirtualBox virtualBox) { diff --git a/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualActiveBpelEngine.java b/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualActiveBpelEngine.java index 93c55825..4b7a7083 100644 --- a/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualActiveBpelEngine.java +++ b/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualActiveBpelEngine.java @@ -25,11 +25,6 @@ public VirtualActiveBpelEngine() { this.defaultEngine = new ActiveBpelEngine(); } - @Override - public String getName() { - return "active_bpel_v"; - } - @Override public List getVerifiableServiceAddresses() { List saList = new LinkedList<>(); diff --git a/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualBpelgEngine.java b/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualBpelgEngine.java index 9966e90f..74b60747 100644 --- a/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualBpelgEngine.java +++ b/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualBpelgEngine.java @@ -25,11 +25,6 @@ public VirtualBpelgEngine() { this.defaultEngine = new BpelgEngine(); } - @Override - public String getName() { - return "bpelg_v"; - } - @Override public List getVerifiableServiceAddresses() { List saList = new LinkedList<>(); diff --git a/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualOdeEngine.java b/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualOdeEngine.java index 36002042..947a8e55 100644 --- a/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualOdeEngine.java +++ b/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualOdeEngine.java @@ -24,11 +24,6 @@ public VirtualOdeEngine() { this.defaultEngine = new OdeEngine(); } - @Override - public String getName() { - return "ode_v"; - } - @Override public List getVerifiableServiceAddresses() { List saList = new LinkedList<>(); diff --git a/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualOpenEsbEngine.java b/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualOpenEsbEngine.java index 73509f62..760e05b8 100644 --- a/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualOpenEsbEngine.java +++ b/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualOpenEsbEngine.java @@ -28,11 +28,6 @@ public VirtualOpenEsbEngine() { this.defaultEngine = new OpenEsbEngine(); } - @Override - public String getName() { - return "openesb_v"; - } - @Override public List getVerifiableServiceAddresses() { List saList = new LinkedList<>(); diff --git a/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualOrchestraEngine.java b/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualOrchestraEngine.java index f2a1abf5..42b60b99 100644 --- a/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualOrchestraEngine.java +++ b/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualOrchestraEngine.java @@ -25,11 +25,6 @@ public VirtualOrchestraEngine() { this.defaultEngine = new OrchestraEngine(); } - @Override - public String getName() { - return "orchestra_v"; - } - @Override public List getVerifiableServiceAddresses() { List saList = new LinkedList<>(); diff --git a/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualPetalsEsbEngine.java b/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualPetalsEsbEngine.java index 3984841a..502ebc8e 100644 --- a/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualPetalsEsbEngine.java +++ b/src/main/groovy/betsy/bpel/virtual/host/engines/VirtualPetalsEsbEngine.java @@ -25,11 +25,6 @@ public VirtualPetalsEsbEngine() { this.defaultEngine = new PetalsEsbEngine(); } - @Override - public String getName() { - return "petalsesb_v"; - } - @Override public List getVerifiableServiceAddresses() { List saList = new LinkedList<>(); diff --git a/src/main/groovy/betsy/bpmn/engines/AbstractBPMNEngine.java b/src/main/groovy/betsy/bpmn/engines/AbstractBPMNEngine.java index ddce6095..120a4776 100644 --- a/src/main/groovy/betsy/bpmn/engines/AbstractBPMNEngine.java +++ b/src/main/groovy/betsy/bpmn/engines/AbstractBPMNEngine.java @@ -6,7 +6,6 @@ import betsy.common.engines.LocalEngineAPI; import betsy.common.engines.ProcessLanguage; import betsy.common.tasks.FileTasks; -import betsy.common.util.ClasspathHelper; import java.nio.file.Path; import java.nio.file.Paths; @@ -19,14 +18,7 @@ public abstract class AbstractBPMNEngine implements EngineAPI, Loca private final List processes = new ArrayList<>(); - /** - * The path src/main/xslt/$engine - * - * @return the path src/main/xslt/$engine - */ - public Path getXsltPath() { - return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpmn/" + getName()); - } + public abstract Path getXsltPath(); /** * The path test/$engine diff --git a/src/main/groovy/betsy/bpmn/engines/activiti/Activiti5170Engine.java b/src/main/groovy/betsy/bpmn/engines/activiti/Activiti5170Engine.java index bb62b573..848a113e 100644 --- a/src/main/groovy/betsy/bpmn/engines/activiti/Activiti5170Engine.java +++ b/src/main/groovy/betsy/bpmn/engines/activiti/Activiti5170Engine.java @@ -1,7 +1,9 @@ package betsy.bpmn.engines.activiti; import betsy.common.config.Configuration; +import betsy.common.engines.ProcessLanguage; import betsy.common.engines.tomcat.TomcatInstaller; +import betsy.common.model.Engine; import betsy.common.tasks.FileTasks; import betsy.common.tasks.NetworkTasks; import betsy.common.tasks.ZipTasks; @@ -17,8 +19,8 @@ public class Activiti5170Engine extends ActivitiEngine { @Override - public String getName() { - return "activiti5170"; // 5.17.0 + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPMN, "activiti", "5.17.0"); } @Override diff --git a/src/main/groovy/betsy/bpmn/engines/activiti/ActivitiEngine.java b/src/main/groovy/betsy/bpmn/engines/activiti/ActivitiEngine.java index 0005751a..acf62cbe 100644 --- a/src/main/groovy/betsy/bpmn/engines/activiti/ActivitiEngine.java +++ b/src/main/groovy/betsy/bpmn/engines/activiti/ActivitiEngine.java @@ -8,8 +8,10 @@ import betsy.bpmn.model.BPMNTestCase; import betsy.bpmn.reporting.BPMNTestcaseMerger; import betsy.common.config.Configuration; +import betsy.common.engines.ProcessLanguage; import betsy.common.engines.tomcat.Tomcat; import betsy.common.engines.tomcat.TomcatInstaller; +import betsy.common.model.Engine; import betsy.common.tasks.FileTasks; import betsy.common.tasks.NetworkTasks; import betsy.common.tasks.XSLTTasks; @@ -42,8 +44,8 @@ public void testProcess(BPMNProcess process) { } @Override - public String getName() { - return "activiti"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPMN, "activiti", "5.16.3"); } @Override diff --git a/src/main/groovy/betsy/bpmn/engines/camunda/Camunda710Engine.java b/src/main/groovy/betsy/bpmn/engines/camunda/Camunda710Engine.java index 479a02de..e9bc67b1 100644 --- a/src/main/groovy/betsy/bpmn/engines/camunda/Camunda710Engine.java +++ b/src/main/groovy/betsy/bpmn/engines/camunda/Camunda710Engine.java @@ -1,22 +1,17 @@ package betsy.bpmn.engines.camunda; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import betsy.common.tasks.ConsoleTasks; import betsy.common.tasks.WaitTasks; -import betsy.common.util.ClasspathHelper; -import java.nio.file.Path; import java.util.Optional; public class Camunda710Engine extends CamundaEngine { @Override - public String getName() { - return "camunda710"; - } - - @Override - public Path getXsltPath() { - return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpmn/" + super.getName()); + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPMN, "camunda", "7.1.0"); } @Override diff --git a/src/main/groovy/betsy/bpmn/engines/camunda/Camunda720Engine.java b/src/main/groovy/betsy/bpmn/engines/camunda/Camunda720Engine.java index e7e58b47..7c99911e 100644 --- a/src/main/groovy/betsy/bpmn/engines/camunda/Camunda720Engine.java +++ b/src/main/groovy/betsy/bpmn/engines/camunda/Camunda720Engine.java @@ -1,16 +1,13 @@ package betsy.bpmn.engines.camunda; -import betsy.common.tasks.ConsoleTasks; -import betsy.common.tasks.WaitTasks; -import betsy.common.util.ClasspathHelper; - -import java.nio.file.Path; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; public class Camunda720Engine extends Camunda710Engine { @Override - public String getName() { - return "camunda720"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPMN, "camunda", "7.2.0"); } @Override diff --git a/src/main/groovy/betsy/bpmn/engines/camunda/Camunda730Engine.java b/src/main/groovy/betsy/bpmn/engines/camunda/Camunda730Engine.java index 4a59f490..3cd0759d 100644 --- a/src/main/groovy/betsy/bpmn/engines/camunda/Camunda730Engine.java +++ b/src/main/groovy/betsy/bpmn/engines/camunda/Camunda730Engine.java @@ -1,16 +1,13 @@ package betsy.bpmn.engines.camunda; -import betsy.common.tasks.ConsoleTasks; -import betsy.common.tasks.WaitTasks; -import betsy.common.util.ClasspathHelper; - -import java.nio.file.Path; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; public class Camunda730Engine extends Camunda710Engine { @Override - public String getName() { - return "camunda730"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPMN, "camunda", "7.3.0"); } @Override diff --git a/src/main/groovy/betsy/bpmn/engines/camunda/CamundaEngine.java b/src/main/groovy/betsy/bpmn/engines/camunda/CamundaEngine.java index 3ab8fbcf..88e9184a 100644 --- a/src/main/groovy/betsy/bpmn/engines/camunda/CamundaEngine.java +++ b/src/main/groovy/betsy/bpmn/engines/camunda/CamundaEngine.java @@ -2,28 +2,25 @@ import betsy.bpmn.engines.AbstractBPMNEngine; import betsy.bpmn.engines.BPMNTester; -import betsy.bpmn.model.BPMNAssertions; import betsy.bpmn.model.BPMNProcess; import betsy.bpmn.model.BPMNTestBuilder; import betsy.bpmn.model.BPMNTestCase; import betsy.bpmn.reporting.BPMNTestcaseMerger; import betsy.common.config.Configuration; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import betsy.common.tasks.*; +import betsy.common.util.ClasspathHelper; import betsy.common.util.FileTypes; -import java.nio.file.Files; import java.nio.file.Path; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; public class CamundaEngine extends AbstractBPMNEngine { @Override - public String getName() { - return "camunda"; + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPMN, "camunda", "7.0.0"); } public String getCamundaUrl() { @@ -38,6 +35,11 @@ public Path getTomcatDir() { return getServerPath().resolve("server").resolve(getTomcatName()); } + @Override + public Path getXsltPath() { + return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpmn/camunda"); + } + @Override public void deploy(final BPMNProcess process) { FileTasks.copyFileIntoFolder(process.getTargetPath().resolve("war").resolve(process.getName() + ".war"), getTomcatDir().resolve("webapps")); diff --git a/src/main/groovy/betsy/bpmn/engines/jbpm/JbpmEngine.java b/src/main/groovy/betsy/bpmn/engines/jbpm/JbpmEngine.java index 6ec4ddf9..bf29a7ac 100644 --- a/src/main/groovy/betsy/bpmn/engines/jbpm/JbpmEngine.java +++ b/src/main/groovy/betsy/bpmn/engines/jbpm/JbpmEngine.java @@ -7,6 +7,8 @@ import betsy.bpmn.model.BPMNTestCase; import betsy.bpmn.reporting.BPMNTestcaseMerger; import betsy.common.config.Configuration; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import betsy.common.tasks.*; import betsy.common.util.ClasspathHelper; import org.apache.log4j.Logger; @@ -22,8 +24,13 @@ public class JbpmEngine extends AbstractBPMNEngine { private static final Logger LOGGER = Logger.getLogger(JbpmEngine.class); @Override - public String getName() { - return "jbpm"; + public Path getXsltPath() { + return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpmn/jbpm"); + } + + @Override + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPMN, "jbpm", "6.0.1"); } public Path getJbpmInstallerPath() { diff --git a/src/main/groovy/betsy/bpmn/engines/jbpm/JbpmEngine610.java b/src/main/groovy/betsy/bpmn/engines/jbpm/JbpmEngine610.java index 5ab9fe04..6cebea87 100644 --- a/src/main/groovy/betsy/bpmn/engines/jbpm/JbpmEngine610.java +++ b/src/main/groovy/betsy/bpmn/engines/jbpm/JbpmEngine610.java @@ -1,19 +1,13 @@ package betsy.bpmn.engines.jbpm; -import betsy.common.util.ClasspathHelper; - -import java.nio.file.Path; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; public class JbpmEngine610 extends JbpmEngine { @Override - public String getName() { - return "jbpm610"; - } - - @Override - public Path getXsltPath() { - return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpmn/" + super.getName()); + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPMN, "jbpm", "6.1.0"); } @Override diff --git a/src/main/groovy/betsy/bpmn/engines/jbpm/JbpmEngine620.java b/src/main/groovy/betsy/bpmn/engines/jbpm/JbpmEngine620.java index 9a6a8138..83828379 100644 --- a/src/main/groovy/betsy/bpmn/engines/jbpm/JbpmEngine620.java +++ b/src/main/groovy/betsy/bpmn/engines/jbpm/JbpmEngine620.java @@ -1,20 +1,13 @@ package betsy.bpmn.engines.jbpm; -import betsy.common.util.ClasspathHelper; - - -import java.nio.file.Path; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; public class JbpmEngine620 extends JbpmEngine { @Override - public String getName() { - return "jbpm620"; - } - - @Override - public Path getXsltPath() { - return ClasspathHelper.getFilesystemPathFromClasspathPath("/bpmn/" + super.getName()); + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPMN, "jbpm", "6.2.0"); } @Override diff --git a/src/main/groovy/betsy/common/engines/EngineAPI.java b/src/main/groovy/betsy/common/engines/EngineAPI.java index 26fb9208..e92598a3 100644 --- a/src/main/groovy/betsy/common/engines/EngineAPI.java +++ b/src/main/groovy/betsy/common/engines/EngineAPI.java @@ -1,9 +1,9 @@ package betsy.common.engines; import betsy.common.HasLogs; -import betsy.common.HasName; +import betsy.common.model.IsEngine; -public interface EngineAPI

extends EngineLifecycle, HasName, HasLogs { +public interface EngineAPI

extends EngineLifecycle, IsEngine, HasLogs { /** * Deploy the given process to the current engine. diff --git a/src/main/groovy/betsy/common/model/Engine.java b/src/main/groovy/betsy/common/model/Engine.java new file mode 100644 index 00000000..080354d4 --- /dev/null +++ b/src/main/groovy/betsy/common/model/Engine.java @@ -0,0 +1,85 @@ +package betsy.common.model; + +import betsy.common.engines.ProcessLanguage; +import com.google.common.base.Objects; + +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +import static java.util.Objects.requireNonNull; + +public final class Engine { + + public static final String DELIMITER = "--"; + private final String name; + private final String version; + private final List configuration; + private final ProcessLanguage language; + + public Engine(ProcessLanguage language, String name, String version) { + this(language, name, version, Collections.emptyList()); + } + + public Engine(ProcessLanguage language, String name, String version, String configuration) { + this(language, name, version, Collections.singletonList(configuration)); + } + + public Engine(ProcessLanguage language, String name, String version, List configuration) { + this.language = language; + this.name = requireNonNull(name); + this.version = requireNonNull(version); + + List values = new LinkedList<>(); + values.addAll(configuration); + this.configuration = requireNonNull(Collections.unmodifiableList(values)); + } + + public String toString() { + return getNormalizedId(); + } + + public String getNormalizedId() { + return getId().replaceAll(DELIMITER,"__").replaceAll("\\.","_"); + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + Engine engine = (Engine) o; + return Objects.equal(toString(), engine.toString()); + } + + public ProcessLanguage getLanguage() { + return language; + } + + @Override + public int hashCode() { + return Objects.hashCode(toString()); + } + + public String getId() { + List values = new LinkedList<>(); + values.add(name); + values.add(version); + values.addAll(configuration); + + return String.join(DELIMITER, values); + } + + public String getName() { + return name; + } + + public String getVersion() { + return version; + } + + public List getConfiguration() { + return configuration; + } +} \ No newline at end of file diff --git a/src/main/groovy/betsy/common/model/IsEngine.java b/src/main/groovy/betsy/common/model/IsEngine.java new file mode 100644 index 00000000..3273bf9b --- /dev/null +++ b/src/main/groovy/betsy/common/model/IsEngine.java @@ -0,0 +1,13 @@ +package betsy.common.model; + +import betsy.common.HasName; + +public interface IsEngine extends HasName { + + Engine getEngineId(); + + default String getName() { + return getEngineId().toString(); + } + +} diff --git a/src/main/groovy/betsy/common/util/LogUtil.java b/src/main/groovy/betsy/common/util/LogUtil.java index 7a4bd796..c7bd0413 100644 --- a/src/main/groovy/betsy/common/util/LogUtil.java +++ b/src/main/groovy/betsy/common/util/LogUtil.java @@ -10,16 +10,12 @@ public class LogUtil { - private TestSuite suite; + private final TestSuite suite; public LogUtil(TestSuite testSuite) { suite = testSuite; } - public void setTestSuite(TestSuite testSuite){ - suite = testSuite; - } - public void log(final String name, Logger logger, Runnable closure) { String previous = LogContext.getContext(); try { diff --git a/src/test/groovy/betsy/BPELSystemTest.java b/src/test/groovy/betsy/BPELSystemTest.java index 8d9512fb..63831f7a 100644 --- a/src/test/groovy/betsy/BPELSystemTest.java +++ b/src/test/groovy/betsy/BPELSystemTest.java @@ -28,97 +28,97 @@ public static void tearDownSoapUI() { @Test public void test_B1_BpelOdeSequence() throws IOException, InterruptedException { - testBPELEngine("ode"); + testBPELEngine("ode__1_3_5"); } @Test public void test_B1_BpelOdeInMemSequence() throws IOException, InterruptedException { - testBPELEngine("ode-in-memory"); + testBPELEngine("ode__1_3_5__in-memory"); } @Test public void test_B1_BpelOde136Sequence() throws IOException, InterruptedException { - testBPELEngine("ode136"); + testBPELEngine("ode__1_3_6"); } @Test public void test_B1_BpelOde136InMemorySequence() throws IOException, InterruptedException { - testBPELEngine("ode136-in-memory"); + testBPELEngine("ode__1_3_6__in-memory"); } @Test public void test_B2_BpelOrchestraSequence() throws IOException, InterruptedException { - testBPELEngine("orchestra"); + testBPELEngine("orchestra__4_9"); } @Test public void test_B3_BpelBpelgSequence() throws IOException, InterruptedException { - testBPELEngine("bpelg"); + testBPELEngine("bpelg__5_3"); } @Test public void test_B3_BpelBpelgInvokeSync() throws IOException, InterruptedException { - testBPELEngine("bpelg", "basic", "Invoke-Sync"); + testBPELEngine("bpelg__5_3", "basic", "Invoke-Sync"); } @Test public void test_B3_BpelBpelgInMemSequence() throws IOException, InterruptedException { - testBPELEngine("bpelg-in-memory"); + testBPELEngine("bpelg__5_3__in-memory"); } @Test @Ignore("does not work on *nix when starting in the background as a deamon service") public void test_B4_BpelWso212Sequence() throws IOException, InterruptedException { - testBPELEngine("wso2_v2_1_2"); + testBPELEngine("wso2__2_1_2"); } @Test public void test_B4_BpelWso300Sequence() throws IOException, InterruptedException { - testBPELEngine("wso2_v3_0_0"); + testBPELEngine("wso2__3_0_0"); } @Test public void test_B4_BpelWso310Sequence() throws IOException, InterruptedException { - testBPELEngine("wso2_v3_1_0"); + testBPELEngine("wso2__3_1_0"); } @Test public void test_B4_BpelWso320Sequence() throws IOException, InterruptedException { - testBPELEngine("wso2_v3_2_0"); + testBPELEngine("wso2__3_2_0"); } @Test public void test_B5_A_BpelOpenesb301StandaloneSequence() throws IOException, InterruptedException { - testBPELEngine("openesb301standalone"); + testBPELEngine("openesb__3_0_1"); } @Test public void test_B5_B2_BpelOpenesb23Sequence() throws IOException, InterruptedException { - testBPELEngine("openesb23"); + testBPELEngine("openesb__2_3"); } @Test public void test_B5__B3_BpelOpenesb231Sequence() throws IOException, InterruptedException { - testBPELEngine("openesb231"); + testBPELEngine("openesb__2_3_1"); } @Test @Ignore("unstable") public void test_B5__B1_BpelOpenesbSequence() throws IOException, InterruptedException { - testBPELEngine("openesb"); + testBPELEngine("openesb__2_2"); } @Test public void test_B6_BpelActiveBpelSequence() throws IOException, InterruptedException { - testBPELEngine("active-bpel"); + testBPELEngine("activebpel__5_0_2"); } @Test @Ignore("older revision, possibly unstable") public void test_B7_BpelPetalsesbSequence() throws IOException, InterruptedException { - testBPELEngine("petalsesb"); + testBPELEngine("petalsesb__4_0"); } @Test @Ignore("unstable") public void test_B7_BpelPetalsesb41Sequence() throws IOException, InterruptedException { - testBPELEngine("petalsesb41"); + testBPELEngine("petalsesb__4_1"); } diff --git a/src/test/groovy/betsy/BPMNSystemTest.java b/src/test/groovy/betsy/BPMNSystemTest.java index 01900d81..9add2836 100644 --- a/src/test/groovy/betsy/BPMNSystemTest.java +++ b/src/test/groovy/betsy/BPMNSystemTest.java @@ -21,47 +21,47 @@ public class BPMNSystemTest extends AbstractSystemTest { @Test public void testBPMNEngine() throws IOException { - testBPMNEngine("activiti"); + testBPMNEngine("activiti__5_16_3"); } @Test public void test_A_BpmnActiviti5170SequenceFlow() throws IOException { - testBPMNEngine("activiti5170"); + testBPMNEngine("activiti__5_17_0"); } @Test public void test_A_BpmnCamunda700SequenceFlow() throws IOException { - testBPMNEngine("camunda"); + testBPMNEngine("camunda__7_0_0"); } @Test public void test_A_BpmnCamunda710SequenceFlow() throws IOException { - testBPMNEngine("camunda710"); + testBPMNEngine("camunda__7_1_0"); } @Test public void test_A_BpmnCamunda720SequenceFlow() throws IOException { - testBPMNEngine("camunda720"); + testBPMNEngine("camunda__7_2_0"); } @Test public void test_A_BpmnCamunda730SequenceFlow() throws IOException { - testBPMNEngine("camunda730"); + testBPMNEngine("camunda__7_3_0"); } @Test public void test_A_BpmnjBPMSequenceFlow() throws IOException { - testBPMNEngine("jbpm"); + testBPMNEngine("jbpm__6_0_1"); } @Test public void test_A_BpmnjBPM610SequenceFlow() throws IOException { - testBPMNEngine("jbpm610"); + testBPMNEngine("jbpm__6_1_0"); } @Test public void test_A_BpmnjBPM620SequenceFlow() throws IOException { - testBPMNEngine("jbpm620"); + testBPMNEngine("jbpm__6_2_0"); } private void testBPMNEngine(String engine) throws IOException { diff --git a/src/test/groovy/betsy/bpel/BetsyTests.java b/src/test/groovy/betsy/bpel/BetsyTests.java index a70192f3..4f6f7f06 100644 --- a/src/test/groovy/betsy/bpel/BetsyTests.java +++ b/src/test/groovy/betsy/bpel/BetsyTests.java @@ -3,12 +3,13 @@ import betsy.bpel.engines.AbstractBPELEngine; import betsy.bpel.engines.BPELEnginePackageBuilder; import betsy.bpel.model.BPELProcess; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import configuration.bpel.BPELProcessRepository; import org.junit.Test; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -65,8 +66,9 @@ public String getEndpointUrl(BPELProcess process) { return "myendpoint"; } - public String getName() { - return "mock"; + @Override + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPEL, "mock", "1.0"); } public Path getXsltPath() { diff --git a/src/test/groovy/betsy/bpel/virtual/CommunicationTest.java b/src/test/groovy/betsy/bpel/virtual/CommunicationTest.java index 443b0e16..99b7c538 100644 --- a/src/test/groovy/betsy/bpel/virtual/CommunicationTest.java +++ b/src/test/groovy/betsy/bpel/virtual/CommunicationTest.java @@ -3,7 +3,6 @@ import betsy.bpel.virtual.common.Constants; import betsy.bpel.virtual.common.Protocol; import betsy.bpel.virtual.common.exceptions.CommunicationException; -import betsy.bpel.virtual.common.messages.collect_log_files.LogFiles; import betsy.bpel.virtual.common.messages.collect_log_files.LogFilesRequest; import betsy.bpel.virtual.common.messages.collect_log_files.LogFilesResponse; import betsy.bpel.virtual.common.messages.deploy.DeployRequest; @@ -31,7 +30,7 @@ public DeployResponse deployOperation(DeployRequest request) throws Communicatio } }; - int server_port = 50000; + int server_port = 55000; VirtualMachineTcpServer virtualMachineTcpServer = new VirtualMachineTcpServer(server_port, protocol); virtualMachineTcpServer.start(); @@ -57,7 +56,7 @@ public DeployResponse deployOperation(DeployRequest request) throws Communicatio } }; - int server_port = 50001; + int server_port = 55001; VirtualMachineTcpServer virtualMachineTcpServer = new VirtualMachineTcpServer(server_port, protocol); virtualMachineTcpServer.start(); @@ -87,7 +86,7 @@ public DeployResponse deployOperation(DeployRequest request) throws Communicatio } }; - int server_port = 50002; + int server_port = 55002; VirtualMachineTcpServer virtualMachineTcpServer = new VirtualMachineTcpServer(server_port, protocol); virtualMachineTcpServer.start(); @@ -111,7 +110,7 @@ public DeployResponse deployOperation(DeployRequest request) throws Communicatio } }; - int server_port = 50003; + int server_port = 55003; VirtualMachineTcpServer virtualMachineTcpServer = new VirtualMachineTcpServer(server_port, protocol); virtualMachineTcpServer.start(); diff --git a/src/test/groovy/betsy/bpmn/BPMNBetsyTests.java b/src/test/groovy/betsy/bpmn/BPMNBetsyTests.java index 983d42cf..3afc0e2a 100644 --- a/src/test/groovy/betsy/bpmn/BPMNBetsyTests.java +++ b/src/test/groovy/betsy/bpmn/BPMNBetsyTests.java @@ -2,12 +2,13 @@ import betsy.bpmn.engines.AbstractBPMNEngine; import betsy.bpmn.model.BPMNProcess; +import betsy.common.engines.ProcessLanguage; +import betsy.common.model.Engine; import configuration.bpmn.BPMNProcessRepository; import org.junit.Test; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -54,8 +55,9 @@ public String getEndpointUrl(BPMNProcess process) { return "myendpoint"; } - public String getName() { - return "mock"; + @Override + public Engine getEngineId() { + return new Engine(ProcessLanguage.BPMN, "mock","1.0"); } public Path getXsltPath() {