diff options
author | Zhaoxing <meng.zhaoxing1@zte.com.cn> | 2017-10-31 12:46:47 +0800 |
---|---|---|
committer | Zhaoxing <meng.zhaoxing1@zte.com.cn> | 2017-10-31 12:46:47 +0800 |
commit | 20babe4f7936a82c54d43e715efebe1fbc680525 (patch) | |
tree | 5535dd53598f574ea35e120721a25981429d1064 | |
parent | 436b17e7478c6b337a9a241102b900bba3ea7e4d (diff) |
Fix the docker build error for vfc-nfvo-wfengine
Change-Id: Ib46e0db064e5a834aa45a4d7448430992afcfd21
Issue-id: VFC-445
Signed-off-by: Zhaoxing <meng.zhaoxing1@zte.com.cn>
5 files changed, 21 insertions, 3 deletions
diff --git a/activiti-extension/src/main/docker/activiti-docker-build_image.sh b/activiti-extension/src/main/docker/activiti-docker-build_image.sh index 94bc305..4235c18 100644 --- a/activiti-extension/src/main/docker/activiti-docker-build_image.sh +++ b/activiti-extension/src/main/docker/activiti-docker-build_image.sh @@ -103,7 +103,8 @@ mv activiti-5.22.0/wars/activiti-rest.war . echo "download activiti-extension ${VERSION}" #curl "${CURLPROXY}" -m 600 -O -J -L "${NEXUS_REPOS_URL}/service/local/artifact/maven/content?r=${NEXUSREPONAME}&g=org.onap.vfc.nfvo.wfengine&a=activiti-extension&e=jar&v=${VERSION}" -wget -O activiti-extension.jar "${NEXUS_REPOS_URL}/service/local/artifact/maven/content?r=${NEXUSREPONAME}&g=org.onap.vfc.nfvo.wfengine&a=activiti-extension&e=jar&v=${VERSION}" +#wget -O activiti-extension.jar "${NEXUS_REPOS_URL}/service/local/artifact/maven/content?r=${NEXUSREPONAME}&g=org.onap.vfc.nfvo.wfengine&a=activiti-extension&e=jar&v=${VERSION}" +wget -O activiti-extension.jar "${NEXUS_REPOS_URL}/service/local/artifact/maven/content?r=snapshots&g=org.onap.vfc.nfvo.wfengine&a=activiti-extension&e=jar&v=1.0.0-SNAPSHOT" rm -Rf ./temp/ mkdir -p ./temp/WEB-INF/lib/ cp -f activiti-extension*.jar ./temp/WEB-INF/lib/activiti-extension.jar diff --git a/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh b/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh index b4cdc47..c3d321e 100644 --- a/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh +++ b/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh @@ -76,7 +76,8 @@ echo "CURLPROXY=${CURLPROXY}" rm -f ./bin/workflow-engine-mgr-service*.jar echo "${CURLPROXY}" -m 300 -O -J -L "${NEXUS_REPOS_URL}/service/local/artifact/maven/content?r=${NEXUSREPONAME}&g=org.onap.vfc.nfvo.wfengine&a=workflow-engine-mgr-service&e=jar&v=${VERSION}" LATEST #curl "${CURLPROXY}" -m 300 -O -J -L "${NEXUS_REPOS_URL}/service/local/artifact/maven/content?r=${NEXUSREPONAME}&g=org.onap.vfc.nfvo.wfengine&a=workflow-engine-mgr-service&e=jar&v=${VERSION}" -wget -O workflow-engine-mgr-service.jar "${NEXUS_REPOS_URL}/service/local/artifact/maven/content?r=${NEXUSREPONAME}&g=org.onap.vfc.nfvo.wfengine&a=workflow-engine-mgr-service&e=jar&v=${VERSION}" +#wget -O workflow-engine-mgr-service.jar "${NEXUS_REPOS_URL}/service/local/artifact/maven/content?r=${NEXUSREPONAME}&g=org.onap.vfc.nfvo.wfengine&a=workflow-engine-mgr-service&e=jar&v=${VERSION}" +wget -O workflow-engine-mgr-service.jar "${NEXUS_REPOS_URL}/service/local/artifact/maven/content?r=snapshots&g=org.onap.vfc.nfvo.wfengine&a=workflow-engine-mgr-service&e=jar&v=1.0.0-SNAPSHOT" mv workflow-engine-mgr-service*.jar ./bin/workflow-engine-mgr-service.jar function build_image { diff --git a/wfenginemgrservice/src/test/java/org/onap/workflow/externalservice/service/activitiservice/ActivitiServiceConsumerTest.java b/wfenginemgrservice/src/test/java/org/onap/workflow/externalservice/service/activitiservice/ActivitiServiceConsumerTest.java index e644626..af90c41 100644 --- a/wfenginemgrservice/src/test/java/org/onap/workflow/externalservice/service/activitiservice/ActivitiServiceConsumerTest.java +++ b/wfenginemgrservice/src/test/java/org/onap/workflow/externalservice/service/activitiservice/ActivitiServiceConsumerTest.java @@ -16,13 +16,16 @@ package org.onap.workflow.externalservice.service.activitiservice;
import static org.mockito.Mockito.mock;
+import static org.powermock.api.mockito.PowerMockito.when;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.apache.http.client.ClientProtocolException;
import org.junit.Assert;
import org.junit.Test;
+import org.mockito.Mockito;
import org.onap.workflow.WorkflowAppConfig;
import org.onap.workflow.common.Config;
import org.onap.workflow.common.RestClient;
@@ -95,6 +98,8 @@ public class ActivitiServiceConsumerTest { workflowAppConfig.setMsbClientConfig(msbClientConfig);
Config.setWorkflowAppConfig(workflowAppConfig);
InputStream ins = mock(InputStream.class);
+ // Byte b[]=(Byte) mock(Byte.class);
+ when(ins.read(Mockito.anyObject())).thenReturn(-21);
ActivitiDeployResponse result = ActivitiServiceConsumer.deploybpmnfile(ins, "result");
Assert.assertTrue(result == null);
RestClient.isTest = false;
diff --git a/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowInstanceWrapperTest.java b/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowInstanceWrapperTest.java index ea84226..487051f 100644 --- a/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowInstanceWrapperTest.java +++ b/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowInstanceWrapperTest.java @@ -16,6 +16,7 @@ package org.onap.workflow.resources;
import static org.powermock.api.mockito.PowerMockito.mock;
+import static org.powermock.api.mockito.PowerMockito.when;
import java.io.InputStream;
@@ -25,6 +26,7 @@ import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import org.mockito.Mockito;
import org.onap.workflow.common.RestClient;
import org.onap.workflow.common.RestResponse;
import org.onap.workflow.entity.StartProcessRequest;
@@ -46,6 +48,7 @@ public class WorkflowInstanceWrapperTest { InputStream fileInputStream = mock(InputStream.class);
FormDataContentDisposition f = mock(FormDataContentDisposition.class);
String filename = "test";
+ when(fileInputStream.read(Mockito.anyObject())).thenReturn(-21);
Response reponse = workflowInstanceWrapper.deployBpmnFile(filename, fileInputStream, f);
Assert.assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), reponse.getStatus());
RestClient.isTest = false;
diff --git a/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowResourceTest.java b/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowResourceTest.java index e7d6523..7d8b194 100644 --- a/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowResourceTest.java +++ b/wfenginemgrservice/src/test/java/org/onap/workflow/resources/WorkflowResourceTest.java @@ -21,6 +21,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.when;
+import java.io.IOException;
import java.io.InputStream;
import javax.ws.rs.core.Response;
@@ -55,7 +56,14 @@ public class WorkflowResourceTest { FormDataContentDisposition fileDetail = mock(FormDataContentDisposition.class);
Response result = Response.ok("success").build();
-
+ // when(fileInputStream.read()).thenReturn(-1);
+ try {
+ when(fileInputStream.read(Mockito.anyObject())).thenReturn(-21);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
when(workflowInstanceWrapper.deployBpmnFile(Mockito.anyString(), Mockito.anyObject(), Mockito.anyObject())).thenReturn(result);
assertThat(workflowResource.deployBpmnFile(fileInputStream,fileDetail), is(result));
|