diff options
14 files changed, 434 insertions, 326 deletions
diff --git a/aria/aria-rest-server/build.py b/aria/aria-rest-server/build.py new file mode 100644 index 0000000000..cc36d2f855 --- /dev/null +++ b/aria/aria-rest-server/build.py @@ -0,0 +1,95 @@ +# +# ============LICENSE_START=================================================== +# Copyright (c) 2017 Cloudify.co. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy +# of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# ============LICENSE_END==================================================== +# + +import subprocess +import os +import sys +import glob +import xml.etree.ElementTree as etree + +# create and enter venv +def create_venv( name): + if subprocess.call("virtualenv {}".format(name), shell = True): + raise Exception("virtualenv create failed") + ret = subprocess.call(". {}/bin/activate && python {} run". \ + format(name,__file__), shell = True) + sys.exit(ret) + +def init_venv(): + subprocess.call("pip install -U pip", shell = True) + subprocess.call("pip install -U setuptools", shell = True) + subprocess.call("pip install wheel", shell = True) + subprocess.call("pip install twine", shell = True) + + +if len(sys.argv) == 1: + create_venv ("mavenvenv") +else: + init_venv() + + if os.environ['MVN_PHASE'] == 'package': + wheelname = os.environ['WHEEL_NAME'] + inputdir = os.environ['INPUT_DIR'] + outputdir = os.environ['OUTPUT_DIR'] + savedir = os.getcwd() + os.chdir(inputdir) + + if subprocess.call( [ "python", + "setup.py", + "bdist_wheel", + "-d", + outputdir + ]): + sys.stderr("wheel create failed") + sys.exit(1) + f = glob.glob(outputdir+"/*.whl")[0] + os.rename(f , outputdir+"/"+ wheelname) + + elif os.environ['MVN_PHASE'] == 'deploy': + + it = etree.iterparse(os.environ['SETTINGS_FILE']) + for _, el in it: + el.tag = el.tag.split('}', 1)[1] # strip namespace + settings = it.root + + username = settings.find('.//server[id="{}"]/username'.format( + os.environ['PYPI_SERVERID'])).text + password = settings.find('.//server[id="{}"]/password'.format( + os.environ['PYPI_SERVERID'])).text + + try: + if subprocess.call( [ "twine", + "upload", + "--username", + username, + "--password", + password, + "--repository-url", + os.environ["PYPI_SERVER_BASEURL"], + os.environ["WHEEL_PATH"] + ] ): + sys.stderr.write("pypi upload failed") + sys.exit(1) + finally: + subprocess.call("rm -rf mavenvenv", shell = True) + + sys.exit(0) + else: + sys.stderr.write("Unrecognized phase '{}'\n".format( + os.environ('MVN_PHASE'))) + sys.exit(1) diff --git a/aria/aria-rest-server/pom.xml b/aria/aria-rest-server/pom.xml index 7af381c220..d7e4a49311 100644 --- a/aria/aria-rest-server/pom.xml +++ b/aria/aria-rest-server/pom.xml @@ -33,18 +33,13 @@ <version>1.1.0-SNAPSHOT</version> </parent> - <pluginRepositories> - <pluginRepository> - <id>jitpack.io</id> - <url>https://jitpack.io</url> - </pluginRepository> - </pluginRepositories> - <properties> - <python_version>2.7</python_version> + <python_version>2</python_version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <wheel.name>${project.artifactId}-${python_version}-py2-none-any.whl</wheel.name> + <wheel.name>${project.artifactId}-${project.version}-py${python_version}-none-any.whl</wheel.name> <python.sourceDirectory>${project.basedir}/src/main/python/aria-rest</python.sourceDirectory> + <onap.nexus.pypiserver.baseurl>http://192.168.33.1:8081/repository/pypi-internal/</onap.nexus.pypiserver.baseurl> + <onap.nexus.pypiserver.serverid>ecomp-snapshots</onap.nexus.pypiserver.serverid> </properties> <build> <plugins> @@ -67,48 +62,51 @@ <failIfNoMatch>false</failIfNoMatch> </configuration> </execution> - <execution> - <id>attach-artifacts</id> - <phase>package</phase> - <goals> - <goal>attach-artifact</goal> - </goals> - <configuration> - <artifacts> - <artifact> - <file>${project.build.directory}/maven-python/dist/${wheel.name}</file> - <type>whl</type> - </artifact> - </artifacts> - </configuration> - </execution> </executions> </plugin> <plugin> - <groupId>com.github.UltimateDogg</groupId> - <artifactId>maven-python-distribute-plugin</artifactId> - <version>0.2.0</version> - <configuration> - <packageVersion>${python_version}</packageVersion> - <sourceDirectory>${python.sourceDirectory}</sourceDirectory> - <distributionType>wheel</distributionType> - </configuration> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>1.6.0</version> <executions> <execution> - <id>package</id> - <phase>prepare-package</phase> - <goals> - <goal>package</goal> - </goals> - </execution> - <execution> - <id>process</id> - <phase>process-sources</phase> - <goals> - <goal>process-sources</goal> - </goals> + <id>package</id> + <phase>package</phase> + <goals><goal>exec</goal></goals> + <configuration> + <executable>python</executable> + <arguments> + <argument>${project.basedir}/build.py</argument> + </arguments> + <environmentVariables> + <MVN_PHASE>package</MVN_PHASE> + <WHEEL_NAME>${wheel.name}</WHEEL_NAME> + <INPUT_DIR>${project.basedir}/src/main/python/aria-rest</INPUT_DIR> + <OUTPUT_DIR>${project.build.directory}</OUTPUT_DIR> + </environmentVariables> + </configuration> </execution> - </executions> + <execution> + <id>deploy</id> + <phase>deploy</phase> + <goals><goal>exec</goal></goals> + <configuration> + <executable>python</executable> + <arguments> + <argument>${project.basedir}/build.py</argument> + </arguments> + <environmentVariables> + <MVN_PHASE>deploy</MVN_PHASE> + <PROJECT_VERSION>${project.version}</PROJECT_VERSION> + <DOCKERREGISTRY_SNAPSHOT>${onap.nexus.dockerregistry.snapshot}</DOCKERREGISTRY_SNAPSHOT> + <DOCKERREGISTRY_RELEASE>${onap.nexus.dockerregistry.release}</DOCKERREGISTRY_RELEASE> + <PYPI_SERVER_BASEURL>${onap.nexus.pypiserver.baseurl}</PYPI_SERVER_BASEURL> + <PYPI_SERVERID>${onap.nexus.pypiserver.serverid}</PYPI_SERVERID> + <WHEEL_PATH>${project.build.directory}/${wheel.name}</WHEEL_PATH> + </environmentVariables> + </configuration> + </execution> + </executions> </plugin> </plugins> </build> diff --git a/aria/aria-rest-server/src/main/python/aria-rest/setup.py b/aria/aria-rest-server/src/main/python/aria-rest/setup.py index 81beb0f9a7..84e9a19560 100644 --- a/aria/aria-rest-server/src/main/python/aria-rest/setup.py +++ b/aria/aria-rest-server/src/main/python/aria-rest/setup.py @@ -34,6 +34,7 @@ setup( license='LICENSE', description='Aria REST API for ONAP', install_requires=[ + 'distribute', 'Flask==0.12.2', 'flask-autodoc==0.1.2', 'apache-ariatosca==0.1.1' diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy index 70050422ee..3b97cad585 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy @@ -18,20 +18,20 @@ * ============LICENSE_END========================================================= */ package org.openecomp.mso.bpmn.vcpe.scripts -
-
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.runtime.Execution
+ + +import org.camunda.bpm.engine.ProcessEngineServices +import org.camunda.bpm.engine.RepositoryService +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.camunda.bpm.engine.repository.ProcessDefinition +import org.camunda.bpm.engine.runtime.Execution import org.junit.Before -import org.junit.BeforeClass
-import org.junit.Rule
+import org.junit.BeforeClass +import org.junit.Rule import org.junit.Test -import org.junit.Ignore
+import org.junit.Ignore import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.BpmnError import org.openecomp.mso.bpmn.core.WorkflowException import org.openecomp.mso.bpmn.mock.FileUtil @@ -41,7 +41,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.patch import static com.github.tomakehurst.wiremock.client.WireMock.put import static com.github.tomakehurst.wiremock.client.WireMock.stubFor import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching -import static org.junit.Assert.*;
+import static org.junit.Assert.*; import static org.mockito.Mockito.* import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition @@ -53,28 +53,27 @@ import org.openecomp.mso.bpmn.core.RollbackData import org.openecomp.mso.bpmn.vcpe.scripts.MapGetter import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter -import com.github.tomakehurst.wiremock.junit.WireMockRule
-
+import com.github.tomakehurst.wiremock.junit.WireMockRule + class CreateVcpeResCustServiceTest extends GroovyTestBase { - private static String request
-
- @Rule
+ private static String request + + @Rule public WireMockRule wireMockRule = new WireMockRule(PORT) -
+ String Prefix = "CVRCS_" - String RbType = "DCRENI_"
+ String RbType = "DCRENI_" @BeforeClass public static void setUpBeforeClass() { - super.setUpBeforeClass() request = FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/request.json") } -
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
+ + @Before + public void init() + { + MockitoAnnotations.initMocks(this) } public CreateVcpeResCustServiceTest() { @@ -82,19 +81,19 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase { } - // ***** preProcessRequest *****
-
- @Test
- // @Ignore
- public void preProcessRequest() {
+ // ***** preProcessRequest ***** + + @Test + // @Ignore + public void preProcessRequest() { ExecutionEntity mex = setupMock() def map = setupMap(mex) initPreProcess(mex) -
- CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService()
- CreateVcpeResCustService.preProcessRequest(mex)
-
- verify(mex).getVariable(DBGFLAG)
+ + CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() + CreateVcpeResCustService.preProcessRequest(mex) + + verify(mex).getVariable(DBGFLAG) verify(mex).setVariable("prefix", Prefix) verify(mex).setVariable("aaiDistDelay", "aaidelay") verify(mex).setVariable("createVcpeServiceRequest", request) @@ -115,7 +114,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase { def reqinfo = map.get(Prefix+"requestInfo") assertTrue(reqinfo.indexOf("<request-id>mri</") >= 0) - assertTrue(reqinfo.indexOf("<source>VID</") >= 0)
+ assertTrue(reqinfo.indexOf("<source>VID</") >= 0) } @Test @@ -1260,6 +1259,6 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase { private initProcessJavaException(ExecutionEntity mex) { when(mex.getVariable(DBGFLAG)).thenReturn("true") - }
-
+ } + } diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy index 65c9e456e4..af56f34bce 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy @@ -18,20 +18,20 @@ * ============LICENSE_END========================================================= */ package org.openecomp.mso.bpmn.vcpe.scripts -
-
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.runtime.Execution
+ + +import org.camunda.bpm.engine.ProcessEngineServices +import org.camunda.bpm.engine.RepositoryService +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.camunda.bpm.engine.repository.ProcessDefinition +import org.camunda.bpm.engine.runtime.Execution import org.junit.Before -import org.junit.BeforeClass
-import org.junit.Rule
+import org.junit.BeforeClass +import org.junit.Rule import org.junit.Test -import org.junit.Ignore
+import org.junit.Ignore import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.BpmnError import org.openecomp.mso.bpmn.core.WorkflowException import org.openecomp.mso.bpmn.mock.FileUtil @@ -41,7 +41,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.patch import static com.github.tomakehurst.wiremock.client.WireMock.put import static com.github.tomakehurst.wiremock.client.WireMock.stubFor import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching -import static org.junit.Assert.*;
+import static org.junit.Assert.*; import static org.mockito.Mockito.* import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition @@ -53,28 +53,27 @@ import org.openecomp.mso.bpmn.core.RollbackData import org.openecomp.mso.bpmn.vcpe.scripts.MapGetter import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter -import com.github.tomakehurst.wiremock.junit.WireMockRule
-
+import com.github.tomakehurst.wiremock.junit.WireMockRule + class DeleteVcpeResCustServiceTest extends GroovyTestBase { - private static String request
-
- @Rule
+ private static String request + + @Rule public WireMockRule wireMockRule = new WireMockRule(PORT) -
+ String Prefix = "DVRCS_" - String RbType = "DCRENI_"
+ String RbType = "DCRENI_" @BeforeClass public static void setUpBeforeClass() { - super.setUpBeforeClass() request = FileUtil.readResourceFile("__files/VCPE/DeleteVcpeResCustService/request.json") } -
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
+ + @Before + public void init() + { + MockitoAnnotations.initMocks(this) } public DeleteVcpeResCustServiceTest() { @@ -82,18 +81,18 @@ class DeleteVcpeResCustServiceTest extends GroovyTestBase { } - // ***** preProcessRequest *****
-
- @Test
-// @Ignore
- public void preProcessRequest() {
+ // ***** preProcessRequest ***** + + @Test +// @Ignore + public void preProcessRequest() { ExecutionEntity mex = setupMock() def map = setupMap(mex) initPreProcess(mex) -
- DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService()
- DeleteVcpeResCustService.preProcessRequest(mex)
-
+ + DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() + DeleteVcpeResCustService.preProcessRequest(mex) + verify(mex).getVariable(DBGFLAG) assertEquals(Prefix, map.get("prefix")) @@ -116,7 +115,7 @@ class DeleteVcpeResCustServiceTest extends GroovyTestBase { def reqinfo = map.get(Prefix+"requestInfo") assertTrue(reqinfo.indexOf("<request-id>mri</") >= 0) - assertTrue(reqinfo.indexOf("<source>VID</") >= 0)
+ assertTrue(reqinfo.indexOf("<source>VID</") >= 0) } @Test @@ -771,5 +770,5 @@ class DeleteVcpeResCustServiceTest extends GroovyTestBase { .withStatus(status) .withHeader("Content-Type", "text/xml") .withBodyFile("VCPE/DeleteVcpeResCustService/" + fileResp))); - }
+ } } diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy index af532e733c..bbe9d52225 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy @@ -18,20 +18,20 @@ * ============LICENSE_END========================================================= */ package org.openecomp.mso.bpmn.vcpe.scripts -
-
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.runtime.Execution
+ + +import org.camunda.bpm.engine.ProcessEngineServices +import org.camunda.bpm.engine.RepositoryService +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.camunda.bpm.engine.repository.ProcessDefinition +import org.camunda.bpm.engine.runtime.Execution import org.junit.Before -import org.junit.BeforeClass
-import org.junit.Rule
+import org.junit.BeforeClass +import org.junit.Rule import org.junit.Test -import org.junit.Ignore
+import org.junit.Ignore import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.BpmnError import org.openecomp.mso.bpmn.core.WorkflowException import org.openecomp.mso.bpmn.mock.FileUtil @@ -39,7 +39,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.aResponse import static com.github.tomakehurst.wiremock.client.WireMock.get import static com.github.tomakehurst.wiremock.client.WireMock.stubFor import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching -import static org.junit.Assert.*;
+import static org.junit.Assert.*; import static org.mockito.Mockito.* import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource @@ -47,25 +47,25 @@ import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResou import org.openecomp.mso.bpmn.core.RollbackData -import com.github.tomakehurst.wiremock.junit.WireMockRule
-
-class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
-
- @Rule
+import com.github.tomakehurst.wiremock.junit.WireMockRule + +class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase { + + @Rule public WireMockRule wireMockRule = new WireMockRule(PORT) -
+ String Prefix = "DCARBRGRB_" - String RbType = "DCARBRG_"
+ String RbType = "DCARBRG_" @BeforeClass public static void setUpBeforeClass() { - super.setUpBeforeClass() + // nothing for now } -
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
+ + @Before + public void init() + { + MockitoAnnotations.initMocks(this) } public DoCreateAllottedResourceBRGRollbackTest() { @@ -73,18 +73,18 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase { } - // ***** preProcessRequest *****
-
- @Test
-// @Ignore
- public void preProcessRequest() {
+ // ***** preProcessRequest ***** + + @Test +// @Ignore + public void preProcessRequest() { ExecutionEntity mex = setupMock() initPreProcess(mex) -
- DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
- DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
-
- verify(mex).getVariable(DBGFLAG)
+ + DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() + DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) + + verify(mex).getVariable(DBGFLAG) verify(mex).setVariable("prefix", Prefix) verify(mex).setVariable("serviceInstanceId", "sii") verify(mex).setVariable("parentServiceInstanceId", "psii") @@ -99,7 +99,7 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase { verify(mex).setVariable("sdncDeleteRequest", "createreq") verify(mex).setVariable("sdncUnassignRequest", "assignreq") - verify(mex, never()).setVariable("skipRollback", true)
+ verify(mex, never()).setVariable("skipRollback", true) } @Test @@ -648,6 +648,6 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase { private initProcessRollbackJavaException(ExecutionEntity mex) { when(mex.getVariable(DBGFLAG)).thenReturn("true") - }
-
+ } + } diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy index 89c13f179c..acc6970dd1 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy @@ -18,20 +18,20 @@ * ============LICENSE_END========================================================= */ package org.openecomp.mso.bpmn.vcpe.scripts -
-
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.runtime.Execution
+ + +import org.camunda.bpm.engine.ProcessEngineServices +import org.camunda.bpm.engine.RepositoryService +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.camunda.bpm.engine.repository.ProcessDefinition +import org.camunda.bpm.engine.runtime.Execution import org.junit.Before -import org.junit.BeforeClass
-import org.junit.Rule
+import org.junit.BeforeClass +import org.junit.Rule import org.junit.Test -import org.junit.Ignore
+import org.junit.Ignore import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.BpmnError import org.openecomp.mso.bpmn.core.WorkflowException import org.openecomp.mso.bpmn.mock.FileUtil @@ -39,7 +39,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.aResponse import static com.github.tomakehurst.wiremock.client.WireMock.put import static com.github.tomakehurst.wiremock.client.WireMock.stubFor import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching -import static org.junit.Assert.*;
+import static org.junit.Assert.*; import static org.mockito.Mockito.* import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource @@ -49,24 +49,24 @@ import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutAllottedResourc import org.openecomp.mso.bpmn.core.RollbackData import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter -import com.github.tomakehurst.wiremock.junit.WireMockRule
-
+import com.github.tomakehurst.wiremock.junit.WireMockRule + class DoCreateAllottedResourceBRGTest extends GroovyTestBase { -
- @Rule
+ + @Rule public WireMockRule wireMockRule = new WireMockRule(PORT) -
- String Prefix = "DCARBRG_"
+ + String Prefix = "DCARBRG_" @BeforeClass public static void setUpBeforeClass() { - super.setUpBeforeClass() + // nothing for now } -
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
+ + @Before + public void init() + { + MockitoAnnotations.initMocks(this) } public DoCreateAllottedResourceBRGTest() { @@ -74,19 +74,19 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase { } - // ***** preProcessRequest *****
-
- @Test
-// @Ignore
- public void preProcessRequest() {
+ // ***** preProcessRequest ***** + + @Test +// @Ignore + public void preProcessRequest() { ExecutionEntity mex = setupMock() initPreProcess(mex) -
- DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
- DoCreateAllottedResourceBRG.preProcessRequest(mex)
-
- verify(mex).getVariable(DBGFLAG)
- verify(mex).setVariable("prefix", Prefix)
+ + DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG() + DoCreateAllottedResourceBRG.preProcessRequest(mex) + + verify(mex).getVariable(DBGFLAG) + verify(mex).setVariable("prefix", Prefix) assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdncadapter_callback")) assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdnc_replication_delay")) @@ -97,7 +97,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase { assertTrue(checkMissingPreProcessRequest("vgmuxBearerIP")) assertTrue(checkMissingPreProcessRequest("brgWanMacAddress")) assertTrue(checkMissingPreProcessRequest("allottedResourceRole")) - assertTrue(checkMissingPreProcessRequest("allottedResourceType"))
+ assertTrue(checkMissingPreProcessRequest("allottedResourceType")) } @@ -992,6 +992,6 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase { private initUpdateAaiAROrchStatus(ExecutionEntity mex) { when(mex.getVariable(DBGFLAG)).thenReturn("true") when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) - }
-
+ } + } diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy index e5635deba7..02352cf6af 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy @@ -59,7 +59,7 @@ class DoCreateAllottedResourceTXCRollbackTest extends GroovyTestBase { @BeforeClass public static void setUpBeforeClass() { - super.setUpBeforeClass() + // nothing for now } @Before diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy index b27e368316..2de6e44a2f 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy @@ -18,20 +18,20 @@ * ============LICENSE_END========================================================= */ package org.openecomp.mso.bpmn.vcpe.scripts -
-
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.runtime.Execution
+ + +import org.camunda.bpm.engine.ProcessEngineServices +import org.camunda.bpm.engine.RepositoryService +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.camunda.bpm.engine.repository.ProcessDefinition +import org.camunda.bpm.engine.runtime.Execution import org.junit.Before -import org.junit.BeforeClass
-import org.junit.Rule
+import org.junit.BeforeClass +import org.junit.Rule import org.junit.Test -import org.junit.Ignore
+import org.junit.Ignore import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.BpmnError import org.openecomp.mso.bpmn.core.WorkflowException import org.openecomp.mso.bpmn.mock.FileUtil @@ -39,7 +39,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.aResponse import static com.github.tomakehurst.wiremock.client.WireMock.put import static com.github.tomakehurst.wiremock.client.WireMock.stubFor import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching -import static org.junit.Assert.*;
+import static org.junit.Assert.*; import static org.mockito.Mockito.* import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource @@ -51,28 +51,24 @@ import java.util.Map import org.openecomp.mso.bpmn.core.RollbackData import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter -import com.github.tomakehurst.wiremock.junit.WireMockRule
-
-class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
-
- @Rule
+import com.github.tomakehurst.wiremock.junit.WireMockRule + +class DoCreateAllottedResourceTXCTest extends GroovyTestBase { + + @Rule public WireMockRule wireMockRule = new WireMockRule(PORT) -
- String Prefix = "DCARTXC_"
+ + String Prefix = "DCARTXC_" @BeforeClass public static void setUpBeforeClass() { - def fr = new FileReader("src/test/resources/mso.bpmn.urn.properties") - urnProps.load(fr) - fr.close() - - aaiUriPfx = urnProps.get("aai.endpoint") + // nothing for now } -
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
+ + @Before + public void init() + { + MockitoAnnotations.initMocks(this) } public DoCreateAllottedResourceTXCTest() { @@ -80,19 +76,19 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase { } - // ***** preProcessRequest *****
-
- @Test
- // @Ignore
- public void preProcessRequest() {
+ // ***** preProcessRequest ***** + + @Test + // @Ignore + public void preProcessRequest() { ExecutionEntity mex = setupMock() initPreProcess(mex) -
- DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC()
- DoCreateAllottedResourceTXC.preProcessRequest(mex)
-
- verify(mex).getVariable(DBGFLAG)
- verify(mex).setVariable("prefix", Prefix)
+ + DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() + DoCreateAllottedResourceTXC.preProcessRequest(mex) + + verify(mex).getVariable(DBGFLAG) + verify(mex).setVariable("prefix", Prefix) assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdncadapter_callback")) assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdnc_replication_delay")) @@ -101,7 +97,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase { assertTrue(checkMissingPreProcessRequest("allottedResourceModelInfo")) assertTrue(checkMissingPreProcessRequest("brgWanMacAddress")) assertTrue(checkMissingPreProcessRequest("allottedResourceRole")) - assertTrue(checkMissingPreProcessRequest("allottedResourceType"))
+ assertTrue(checkMissingPreProcessRequest("allottedResourceType")) } @@ -950,6 +946,6 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase { private initUpdateAaiAROrchStatus(ExecutionEntity mex) { when(mex.getVariable(DBGFLAG)).thenReturn("true") when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) - }
-
+ } + } diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy index ec65347f5e..4e62a566a7 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy @@ -18,20 +18,20 @@ * ============LICENSE_END========================================================= */ package org.openecomp.mso.bpmn.vcpe.scripts -
-
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.runtime.Execution
+ + +import org.camunda.bpm.engine.ProcessEngineServices +import org.camunda.bpm.engine.RepositoryService +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.camunda.bpm.engine.repository.ProcessDefinition +import org.camunda.bpm.engine.runtime.Execution import org.junit.Before -import org.junit.BeforeClass
-import org.junit.Rule
+import org.junit.BeforeClass +import org.junit.Rule import org.junit.Test -import org.junit.Ignore
+import org.junit.Ignore import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.BpmnError import org.openecomp.mso.bpmn.core.WorkflowException import org.openecomp.mso.bpmn.mock.FileUtil @@ -42,7 +42,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.patch import static com.github.tomakehurst.wiremock.client.WireMock.put import static com.github.tomakehurst.wiremock.client.WireMock.stubFor import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching -import static org.junit.Assert.*;
+import static org.junit.Assert.*; import static org.mockito.Mockito.* import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource @@ -54,24 +54,24 @@ import java.util.Map import org.openecomp.mso.bpmn.core.RollbackData import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter -import com.github.tomakehurst.wiremock.junit.WireMockRule
-
-class DoDeleteAllottedResourceBRGTest extends GroovyTestBase {
-
- @Rule
+import com.github.tomakehurst.wiremock.junit.WireMockRule + +class DoDeleteAllottedResourceBRGTest extends GroovyTestBase { + + @Rule public WireMockRule wireMockRule = new WireMockRule(PORT) -
- String Prefix = "DDARBRG_"
+ + String Prefix = "DDARBRG_" @BeforeClass public static void setUpBeforeClass() { - super.setUpBeforeClass() + // nothing for now } -
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
+ + @Before + public void init() + { + MockitoAnnotations.initMocks(this) } public DoDeleteAllottedResourceBRGTest() { @@ -79,24 +79,24 @@ class DoDeleteAllottedResourceBRGTest extends GroovyTestBase { } - // ***** preProcessRequest *****
-
- @Test
-// @Ignore
- public void preProcessRequest() {
+ // ***** preProcessRequest ***** + + @Test +// @Ignore + public void preProcessRequest() { ExecutionEntity mex = setupMock() initPreProcess(mex) -
- DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
- DoDeleteAllottedResourceBRG.preProcessRequest(mex)
-
- verify(mex).getVariable(DBGFLAG)
+ + DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() + DoDeleteAllottedResourceBRG.preProcessRequest(mex) + + verify(mex).getVariable(DBGFLAG) verify(mex).setVariable("prefix", Prefix) - verify(mex).setVariable("sdncCallbackUrl", "sdncurn")
+ verify(mex).setVariable("sdncCallbackUrl", "sdncurn") assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdncadapter_callback")) assertTrue(checkMissingPreProcessRequest("serviceInstanceId")) - assertTrue(checkMissingPreProcessRequest("allottedResourceId"))
+ assertTrue(checkMissingPreProcessRequest("allottedResourceId")) } @Test @@ -599,6 +599,6 @@ class DoDeleteAllottedResourceBRGTest extends GroovyTestBase { when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) when(mex.getVariable("aaiARResourceVersion")).thenReturn("myvers") when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx) - }
-
+ } + } diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy index adf6313a2a..33273c55a6 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy @@ -65,7 +65,7 @@ class DoDeleteAllottedResourceTXCTest extends GroovyTestBase { @BeforeClass public static void setUpBeforeClass() { - super.setUpBeforeClass() + // nothing for now } @Before diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/GroovyTestBase.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/GroovyTestBase.groovy index 121583ec10..01ca53ba97 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/GroovyTestBase.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/GroovyTestBase.groovy @@ -18,20 +18,20 @@ * ============LICENSE_END========================================================= */ package org.openecomp.mso.bpmn.vcpe.scripts -
-
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.runtime.Execution
+ + +import org.camunda.bpm.engine.ProcessEngineServices +import org.camunda.bpm.engine.RepositoryService +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.camunda.bpm.engine.repository.ProcessDefinition +import org.camunda.bpm.engine.runtime.Execution import org.junit.Before -import org.junit.BeforeClass
-import org.junit.Rule
+import org.junit.BeforeClass +import org.junit.Rule import org.junit.Test -import org.junit.Ignore
+import org.junit.Ignore import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.BpmnError import org.openecomp.mso.bpmn.core.WorkflowException import org.openecomp.mso.bpmn.mock.FileUtil @@ -41,14 +41,14 @@ import static com.github.tomakehurst.wiremock.client.WireMock.patch import static com.github.tomakehurst.wiremock.client.WireMock.put import static com.github.tomakehurst.wiremock.client.WireMock.stubFor import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching -import static org.junit.Assert.*;
+import static org.junit.Assert.*; import static org.mockito.Mockito.* import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource import org.openecomp.mso.bpmn.core.RollbackData import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter -import com.github.tomakehurst.wiremock.junit.WireMockRule
-
+import com.github.tomakehurst.wiremock.junit.WireMockRule + class GroovyTestBase { static final int PORT = 28090 @@ -60,20 +60,24 @@ class GroovyTestBase { static final String ARID = "arId-1" static final String VERS = "myvers" - static final String DBGFLAG = "isDebugLogEnabled"
+ static final String DBGFLAG = "isDebugLogEnabled" static Properties urnProps = new Properties() static String aaiUriPfx - String processName
+ String processName - public static void setUpBeforeClass() { + static { def fr = new FileReader("src/test/resources/mso.bpmn.urn.properties") urnProps.load(fr) fr.close() - + aaiUriPfx = urnProps.get("aai.endpoint") } + + public static void setUpBeforeClass() { + // moved to the above static block to get the static aaiUriPfx assignment correctly. + } public GroovyTestBase(String processName) { this.processName = processName @@ -88,37 +92,37 @@ class GroovyTestBase { } catch(BpmnError e) { return true; } - }
-
- public ExecutionEntity setupMock() {
-
- ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
- when(mockProcessDefinition.getKey()).thenReturn(processName)
- RepositoryService mockRepositoryService = mock(RepositoryService.class)
- when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
- when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn(processName)
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
- ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
- when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
-
- ExecutionEntity mex = mock(ExecutionEntity.class)
-
- when(mex.getId()).thenReturn("100")
- when(mex.getProcessDefinitionId()).thenReturn(processName)
- when(mex.getProcessInstanceId()).thenReturn(processName)
- when(mex.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
+ } + + public ExecutionEntity setupMock() { + + ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) + when(mockProcessDefinition.getKey()).thenReturn(processName) + RepositoryService mockRepositoryService = mock(RepositoryService.class) + when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) + when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn(processName) + when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") + ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) + when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) + + ExecutionEntity mex = mock(ExecutionEntity.class) + + when(mex.getId()).thenReturn("100") + when(mex.getProcessDefinitionId()).thenReturn(processName) + when(mex.getProcessInstanceId()).thenReturn(processName) + when(mex.getProcessEngineServices()).thenReturn(mockProcessEngineServices) when(mex.getProcessEngineServices().getRepositoryService().getProcessDefinition(mex.getProcessDefinitionId())).thenReturn(mockProcessDefinition) when(mex.getVariable("isAsyncProcess")).thenReturn("true") - when(mex.getVariable(processName+"WorkflowResponseSent")).thenReturn("false")
-
- return mex
+ when(mex.getVariable(processName+"WorkflowResponseSent")).thenReturn("false") + + return mex } public Map<String,Object> setupMap(ExecutionEntity mex) { MapSetter mapset = new MapSetter(); doAnswer(mapset).when(mex).setVariable(any(), any()) return mapset.getMap(); - }
-
+ } + } diff --git a/packages/docker/src/main/docker/docker-files/Dockerfile.aria b/packages/docker/src/main/docker/docker-files/Dockerfile.aria index ee16d73733..26f672e51d 100644 --- a/packages/docker/src/main/docker/docker-files/Dockerfile.aria +++ b/packages/docker/src/main/docker/docker-files/Dockerfile.aria @@ -15,15 +15,30 @@ # the License. # ============LICENSE_END==================================================== # - FROM httpd:alpine +ARG aria_rest_url +ARG aria_rest_branch RUN apk update RUN apk add python2 py2-pip gcc python2-dev linux-headers musl-dev git curl - -RUN pip install apache-ariatosca==0.2.0 jinja2==2.8 aria-extension-cloudify==4.1 -RUN curl -sL http://github.com/dfilppi/aria-rest/archive/master.tar.gz|tar xzf - -WORKDIR aria-rest-master +WORKDIR /tmp +RUN git clone -b 0.1.1 https://github.com/cloudify-cosmo/aria-extension-cloudify +WORKDIR /tmp/aria-extension-cloudify +RUN pip install -U setuptools +RUN pip install . +RUN pip install apache-ariatosca==0.1.1 jinja2==2.8 +WORKDIR /tmp +RUN git clone -b ${aria_rest_branch} ${aria_rest_url} +WORKDIR /tmp/so/aria/aria-rest-server/src/main/python/aria-rest RUN pip install . +WORKDIR /tmp +RUN git clone -b 2.0.1 https://github.com/cloudify-cosmo/cloudify-openstack-plugin +RUN wagon create ./cloudify-openstack-plugin +RUN aria plugins install cloudify_openstack_plugin-2.0.1-py27-none-linux_x86_64.wgn +RUN rm cloudify_openstack_plugin-2.0.1-py27-none-linux_x86_64.wgn +RUN git clone -b 1.4.10 https://github.com/cloudify-cosmo/cloudify-aws-plugin +RUN wagon create ./cloudify-aws-plugin +RUN aria plugins install cloudify_aws_plugin-1.4.10-py27-none-linux_x86_64.wgn +RUN rm cloudify_aws_plugin-1.4.10-py27-none-linux_x86_64.wgn CMD aria-rest @@ -32,6 +32,7 @@ <module>status-control</module> <module>bpmn</module> <module>packages</module> + <module>aria/aria-rest-server</module> </modules> <properties> <project.mso.base.folder>.</project.mso.base.folder> |