diff --git a/.gitignore b/.gitignore index c6cc0de..b8abc3a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ lib/mvn-deps/ logs/ src_dataClasses/ src_wsproc/ +/.metadata/ diff --git a/docker-connector-demo/config/variables.yaml b/docker-connector-demo/config/variables.yaml index 64c8fa0..d9ce3d6 100644 --- a/docker-connector-demo/config/variables.yaml +++ b/docker-connector-demo/config/variables.yaml @@ -6,4 +6,3 @@ # '/Config/_/variables.yaml # Variables: -# myVariable: value diff --git a/docker-connector-demo/pom.xml b/docker-connector-demo/pom.xml index 129259c..94981f4 100644 --- a/docker-connector-demo/pom.xml +++ b/docker-connector-demo/pom.xml @@ -4,8 +4,11 @@ 4.0.0 com.axonivy.market docker-connector-demo - 1.0.0-SNAPSHOT + 10.0.0-SNAPSHOT iar + + Axon Ivy AG + com.axonivy.market diff --git a/docker-connector-demo/processes/dockerDemo.p.json b/docker-connector-demo/processes/dockerDemo.p.json index 75f5510..2c5318e 100644 --- a/docker-connector-demo/processes/dockerDemo.p.json +++ b/docker-connector-demo/processes/dockerDemo.p.json @@ -41,7 +41,7 @@ "code" : [ "import com.axonivy.connector.docker.PortBinding;", "PortBinding binding = new PortBinding();", - "binding.publicPort = 8080;", + "binding.publicPort = 9090;", "binding.internalPort = 8080;", "", "param.ports = [binding];" diff --git a/docker-connector-demo/src_hd/com/axonivy/market/docker/connector/demo/ShowEngine/ShowEngine.xhtml b/docker-connector-demo/src_hd/com/axonivy/market/docker/connector/demo/ShowEngine/ShowEngine.xhtml index d03a529..bdfcfab 100644 --- a/docker-connector-demo/src_hd/com/axonivy/market/docker/connector/demo/ShowEngine/ShowEngine.xhtml +++ b/docker-connector-demo/src_hd/com/axonivy/market/docker/connector/demo/ShowEngine/ShowEngine.xhtml @@ -13,7 +13,7 @@ - +
diff --git a/docker-connector-test/.classpath b/docker-connector-test/.classpath new file mode 100644 index 0000000..8a52195 --- /dev/null +++ b/docker-connector-test/.classpath @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docker-connector-test/.gitignore b/docker-connector-test/.gitignore new file mode 100644 index 0000000..1b2547b --- /dev/null +++ b/docker-connector-test/.gitignore @@ -0,0 +1,19 @@ +# general +Thumbs.db +.DS_Store +*~ +*.log + +# java +*.class +hs_err_pid* + +# maven +target/ +lib/mvn-deps/ + +# ivy +classes/ +src_dataClasses/ +src_wsproc/ +logs/ diff --git a/docker-connector-test/.project b/docker-connector-test/.project new file mode 100644 index 0000000..f560f36 --- /dev/null +++ b/docker-connector-test/.project @@ -0,0 +1,49 @@ + + + docker-connector-test + + + + + + ch.ivyteam.ivy.designer.dataClasses.ui.ivyDataClassBuilder + + + + + ch.ivyteam.ivy.designer.process.ui.ivyWebServiceProcessClassBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + ch.ivyteam.ivy.designer.ide.ivyModelValidationBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + ch.ivyteam.ivy.project.IvyProjectNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.jem.beaninfo.BeanInfoNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/docker-connector-test/.settings/.jsdtscope b/docker-connector-test/.settings/.jsdtscope new file mode 100644 index 0000000..cf5ec79 --- /dev/null +++ b/docker-connector-test/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/docker-connector-test/.settings/ch.ivyteam.ivy.designer.prefs b/docker-connector-test/.settings/ch.ivyteam.ivy.designer.prefs new file mode 100644 index 0000000..552c153 --- /dev/null +++ b/docker-connector-test/.settings/ch.ivyteam.ivy.designer.prefs @@ -0,0 +1,5 @@ +ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_DATA_CLASS=com.axonivy.market.docker.connector.test.Data +ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_NAMESPACE=com.axonivy.market.docker.connector.test +ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=11 +ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=100000 +eclipse.preferences.version=1 diff --git a/docker-connector-test/.settings/org.eclipse.jdt.core.prefs b/docker-connector-test/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f78f7f7 --- /dev/null +++ b/docker-connector-test/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,10 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/docker-connector-test/.settings/org.eclipse.wst.common.component b/docker-connector-test/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..31ae991 --- /dev/null +++ b/docker-connector-test/.settings/org.eclipse.wst.common.component @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/docker-connector-test/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/docker-connector-test/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml new file mode 100644 index 0000000..0d46547 --- /dev/null +++ b/docker-connector-test/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docker-connector-test/.settings/org.eclipse.wst.common.project.facet.core.xml b/docker-connector-test/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..c2098f9 --- /dev/null +++ b/docker-connector-test/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docker-connector-test/.settings/org.eclipse.wst.css.core.prefs b/docker-connector-test/.settings/org.eclipse.wst.css.core.prefs new file mode 100644 index 0000000..96b96cd --- /dev/null +++ b/docker-connector-test/.settings/org.eclipse.wst.css.core.prefs @@ -0,0 +1,2 @@ +css-profile/=org.eclipse.wst.css.core.cssprofile.css3 +eclipse.preferences.version=1 diff --git a/docker-connector-test/.settings/org.eclipse.wst.jsdt.ui.superType.container b/docker-connector-test/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/docker-connector-test/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/docker-connector-test/.settings/org.eclipse.wst.jsdt.ui.superType.name b/docker-connector-test/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/docker-connector-test/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/docker-connector-test/config/custom-fields.yaml b/docker-connector-test/config/custom-fields.yaml new file mode 100644 index 0000000..aa19ae0 --- /dev/null +++ b/docker-connector-test/config/custom-fields.yaml @@ -0,0 +1,20 @@ +# == Custom Fields Information == +# +# You can define here your project custom fields. +# Have a look at our documentation for more information. +# +CustomFields: +# Tasks: +# MyTaskCustomField: +# Label: My task custom field +# Description: This new task custom field can be used to ... +# Type: STRING +# Cases: +# MyCaseCustomField: +# Label: My case custom field +# Description: This new case custom field can be used to ... +# Type: STRING +# Starts: +# MyStartCustomField: +# Label: My start custom field +# Description: This new start custom field can be used to ... diff --git a/docker-connector-test/config/databases.yaml b/docker-connector-test/config/databases.yaml new file mode 100644 index 0000000..247b128 --- /dev/null +++ b/docker-connector-test/config/databases.yaml @@ -0,0 +1 @@ +Databases: diff --git a/docker-connector-test/config/overrides.any b/docker-connector-test/config/overrides.any new file mode 100644 index 0000000..f59ec20 --- /dev/null +++ b/docker-connector-test/config/overrides.any @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/docker-connector-test/config/persistence.xml b/docker-connector-test/config/persistence.xml new file mode 100644 index 0000000..d6b96d7 --- /dev/null +++ b/docker-connector-test/config/persistence.xml @@ -0,0 +1,2 @@ + + diff --git a/docker-connector-test/config/rest-clients.yaml b/docker-connector-test/config/rest-clients.yaml new file mode 100644 index 0000000..8e85296 --- /dev/null +++ b/docker-connector-test/config/rest-clients.yaml @@ -0,0 +1 @@ +RestClients: diff --git a/docker-connector-test/config/roles.xml b/docker-connector-test/config/roles.xml new file mode 100644 index 0000000..59892fe --- /dev/null +++ b/docker-connector-test/config/roles.xml @@ -0,0 +1,4 @@ + + + Everybody + diff --git a/docker-connector-test/config/users.xml b/docker-connector-test/config/users.xml new file mode 100644 index 0000000..51a6906 --- /dev/null +++ b/docker-connector-test/config/users.xml @@ -0,0 +1,2 @@ + + diff --git a/docker-connector-test/config/variables.yaml b/docker-connector-test/config/variables.yaml new file mode 100644 index 0000000..d9ce3d6 --- /dev/null +++ b/docker-connector-test/config/variables.yaml @@ -0,0 +1,8 @@ +# == Variables == +# +# You can define here your project Variables. +# If you want to define/override a Variable for a specific Environment, +# add an additional ‘variables.yaml’ file in a subdirectory in the ‘Config’ folder: +# '/Config/_/variables.yaml +# +Variables: diff --git a/docker-connector-test/config/webservice-clients.yaml b/docker-connector-test/config/webservice-clients.yaml new file mode 100644 index 0000000..060b018 --- /dev/null +++ b/docker-connector-test/config/webservice-clients.yaml @@ -0,0 +1 @@ +WebServiceClients: diff --git a/docker-connector-test/dataclasses/com/axonivy/market/docker/connector/test/Data.ivyClass b/docker-connector-test/dataclasses/com/axonivy/market/docker/connector/test/Data.ivyClass new file mode 100644 index 0000000..c671fce --- /dev/null +++ b/docker-connector-test/dataclasses/com/axonivy/market/docker/connector/test/Data.ivyClass @@ -0,0 +1,2 @@ +Data #class +com.axonivy.market.docker.connector.test #namespace diff --git a/docker-connector-test/pom.xml b/docker-connector-test/pom.xml new file mode 100644 index 0000000..ff67f7d --- /dev/null +++ b/docker-connector-test/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + com.axonivy.market + docker-connector-test + 10.0.0-SNAPSHOT + iar-integration-test + + Axon Ivy AG + + + + com.axonivy.market + docker-connector-demo + ${project.version} + iar + + + com.axonivy.ivy.webtest + web-tester + 10.0.0 + test + + + + src_test + + + com.axonivy.ivy.ci + project-build-plugin + 10.0.6 + true + + + + diff --git a/docker-connector-test/src_test/com/axonivy/market/docker/connector/test/DockerConntectorWebIT.java b/docker-connector-test/src_test/com/axonivy/market/docker/connector/test/DockerConntectorWebIT.java new file mode 100644 index 0000000..cc7b0bf --- /dev/null +++ b/docker-connector-test/src_test/com/axonivy/market/docker/connector/test/DockerConntectorWebIT.java @@ -0,0 +1,42 @@ +package com.axonivy.market.docker.connector.test; + +import static com.codeborne.selenide.Selenide.$; +import static com.codeborne.selenide.Selenide.open; +import static org.assertj.core.api.Assertions.assertThat; +import java.time.Duration; +import org.junit.jupiter.api.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriverException; +import com.axonivy.ivy.webtest.IvyWebTest; +import com.axonivy.ivy.webtest.engine.EngineUrl; +import com.codeborne.selenide.Selenide; + +@IvyWebTest(headless = false) +public class DockerConntectorWebIT{ + + @Test + public void demo() { + open(EngineUrl.createProcessUrl("docker-connector-demo/18A50F6DFF3B27D1/start.ivp")); + + // Open link to started engine + $(By.id("form:OpenEngine")).click(); + + + Selenide.Wait() + .withTimeout(Duration.ofMinutes(1)) + .pollingEvery(Duration.ofSeconds(5)) + .ignoring(WebDriverException.class) + .ignoring(AssertionError.class) + .until(driver -> { + Selenide.switchTo().window(1); + Selenide.refresh(); + assertThat(Selenide.title()).contains("Axon Ivy Engine"); + return true; + }); + + Selenide.switchTo().window(0); + + $(By.id("form:proceed")).click(); + } + +} \ No newline at end of file diff --git a/docker-connector/config/variables.yaml b/docker-connector/config/variables.yaml index c4ba134..2b58dfe 100644 --- a/docker-connector/config/variables.yaml +++ b/docker-connector/config/variables.yaml @@ -6,15 +6,14 @@ # '/Config/_/variables.yaml # Variables: -# myVariable: value Docker: # URL to communicate with the docker daemon - # Windows Pipe: + # Windows Pipe (localhost only): # npipe:////./pipe/dockerDesktopLinuxEngine - # Linux: + # Linux (localhost only): # unix:///var/run/docker.sock # TCP (Outside container): # tcp://localhost:2375 # TCP (Inside a container): # tcp://host.docker.internal:2375 - URL: "tcp://localhost:2375/" \ No newline at end of file + URL: "unix:///var/run/docker.sock" \ No newline at end of file diff --git a/docker-connector/pom.xml b/docker-connector/pom.xml index 7815255..863c752 100644 --- a/docker-connector/pom.xml +++ b/docker-connector/pom.xml @@ -6,6 +6,21 @@ docker-connector 10.0.0-SNAPSHOT iar + + Axon Ivy AG + + + + com.github.docker-java + docker-java-core + 3.3.3 + + + com.github.docker-java + docker-java-transport-httpclient5 + 3.3.3 + + @@ -16,16 +31,4 @@ - - - com.github.docker-java - docker-java-core - 3.3.3 - - - com.github.docker-java - docker-java-transport-httpclient5 - 3.3.3 - - diff --git a/docker-connector/processes/docker.p.json b/docker-connector/processes/docker.p.json index bb9e12a..4f491a3 100644 --- a/docker-connector/processes/docker.p.json +++ b/docker-connector/processes/docker.p.json @@ -59,8 +59,8 @@ "Binding.bindPort(15);", "List ports = [];", "for (com.axonivy.connector.docker.PortBinding binding : in.ports) { ", - " Binding b = Binding.bindPort(binding.internalPort);", - " ports.add(new PortBinding(b, new ExposedPort(binding.publicPort)));", + " Binding b = Binding.bindPort(binding.publicPort);", + " ports.add(new PortBinding(b, new ExposedPort(binding.internalPort)));", "}", "HostConfig hostConfig = HostConfig.newHostConfig();", "if (! ports.isEmpty()) {",