make default 'execution mode' as null 57/122957/4 istanbul
authorsharath reddy <bs.reddy@huawei.com>
Thu, 29 Jul 2021 11:53:55 +0000 (17:23 +0530)
committersharath reddy <bs.reddy@huawei.com>
Fri, 30 Jul 2021 07:24:05 +0000 (12:54 +0530)
Issue-ID: VNFSDK-792

Signed-off-by: sharath reddy <bs.reddy@huawei.com>
Change-Id: I5e689cb6acc434c6a7ce4752014d169dd7642422
Signed-off-by: sharath reddy <bs.reddy@huawei.com>
vnfmarket-be/vnf-sdk-marketplace/src/main/resources/vtp.properties
vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPExecutionResourceTest.java
vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/execution/VTPExecutionResourceTest.java

index fa33e5f..a373a77 100644 (file)
@@ -17,7 +17,7 @@ vtp.grpc.port = 50051
 vtp.artifact.store = /tmp/data/vtp-artifacts
 vtp.file.store = /tmp/data/vtp-tmp-files
 #
-vtp.execution.mode = dist
+vtp.execution.mode = ''
 vtp.manager.server = localhost
 vtp.manager.port = 9090
 #60 seconds
@@ -26,5 +26,5 @@ vtp.grpc.timeout = 60
 #scenario��testsuit��testcase store
 vtp.yaml.store = /opt/oclip/open-cli-schema/vtp
 vtp.script.store = /opt/oclip/script/vtp
-vtp.manager.mode = dist
+vtp.manager.mode = ''
 vtp.manager.url = http://localhost:8088/
index 0c6ddd6..cec0a6c 100644 (file)
@@ -370,50 +370,16 @@ public class VTPExecutionResourceTest {
         // given
         String testStartTime = "2020-08-10T08:50:20.845";
         String testEndTime = "2020-08-11T08:51:50.845";
-        String testRequestId = "test-03-request-id";
         String testProduct = "VTP Scenario 3";
         String testCommand = "s1.ts1.testcase-3";
         String testSuiteName = "testsuite-3";
+        String testRequestId = "test-03-request-id";
         String testProfile = "open-cli-schema";
 
-        new MockUp<DistManager>(){
-            @mockit.Mock
-            protected JsonElement getExecutionJson(int count, int index) {
-                String values = "[{\"tester_id\":\"1\", \"end-time\":\"end-time\", " +
-                        "\"id\":\"2\", \"product\":\"product\"," +
-                        "\"service\":\"service\", \"command\":\"command\", " +
-                        "\"profile\":\"profile\", \"status\":\"status\", \"execution_id\":\"test-01-request-id-execution-id\"}]";
-                JsonParser jsonParser = new JsonParser();
-                return jsonParser.parse(values);
-            }
-        };
-        new MockUp<DistManager>(){
-            @mockit.Mock
-            protected JsonElement getResponseFromTester(Client client, String managerURL, String testerPath) {
-                String values = "{\"tester_id\":\"1\", \"end-time\":\"end-time\", " +
-                        "\"iP\":\"localhost\", \"port\":\"55130\"," +
-                        "\"service\":\"service\", \"command\":\"command\", " +
-                        "\"profile\":\"profile\", \"status\":\"status\", \"execution-id\":\"123456\"}";
-                JsonParser jsonParser = new JsonParser();
-                return jsonParser.parse(values);
-            }
-        };
-
-        new MockUp<OpenRemoteCli>(){
-            @mockit.Mock
-            protected Result run(String vtpTestCenterIp, int vtpTestCenterPort, List<String> args, int timeout) throws  OpenInterfaceGrpcTimeoutExecption {
-                  throw new OpenInterfaceGrpcClient.OpenInterfaceGrpcTimeoutExecption("Timed Out");
-                 }
-             };
-
-        /*
-         * // when exceptionRule.expect(VTPError.VTPException.class); exceptionRule.
-         * expectMessage("Timed out. Please use request-id to track the progress.");
-         */
-             VTPTestExecutionList list =     vtpExecutionResource.listTestExecutionsHandler(
-            testRequestId, testProduct, testSuiteName, testCommand, testProfile, testStartTime, testEndTime,1,0
-        );
-             assertEquals(0, list.getExecutions().size());// during exception the list size is empty
+        exceptionRule.expect(VTPError.VTPException.class);
+        exceptionRule.expectMessage("Timed out. Please use request-id to track the progress.");
+        vtpExecutionResource.listTestExecutionsHandler(
+                testRequestId, testProduct, testSuiteName, testCommand, testProfile, testStartTime, testEndTime, 1, 0);
 
     }
 
index e558a6b..6d6afd5 100644 (file)
@@ -296,39 +296,10 @@ public class VTPExecutionResourceTest {
                 return result;
             }
         };
-        new MockUp<VTPResource>(){
-            @mockit.Mock
-            protected Result makeRpc(List<String> args,int count,int index) throws VTPError.VTPException {
-                Result result = Result.newBuilder().build();
-                return result;
-            }
-        };
-        new MockUp<VTPResource>(){
-            @mockit.Mock
-            protected JsonElement makeRpcAndGetJson(List<String> args,int count,int index, int timeout) throws VTPError.VTPException {
-                  String values = "[{\"start-time\":\"start-time\", \"end-time\":\"end-time\", " +
-                          "\"request-id\":\"request-id\", \"product\":\"product\"," +
-                          "\"service\":\"service\", \"command\":\"command\", " +
-                          "\"profile\":\"profile\", \"status\":\"status\", \"execution-id\":\"execution-id\"}]";
-                  JsonParser jsonParser = new JsonParser();
-                  return jsonParser.parse(values);
-            }
-        };
-        new MockUp<VTPResource>(){
-            @mockit.Mock
-            protected JsonElement makeRpcAndGetJson(List<String> args,int count,int index) throws VTPError.VTPException {
-                  String values = "[{\"start-time\":\"start-time\", \"end-time\":\"end-time\", " +
-                          "\"request-id\":\"request-id\", \"product\":\"product\"," +
-                          "\"service\":\"service\", \"command\":\"command\", " +
-                          "\"profile\":\"profile\", \"status\":\"status\", \"execution-id\":\"execution-id\"}]";
-                  JsonParser jsonParser = new JsonParser();
-                  return jsonParser.parse(values);
-            }
-        };
         new MockUp<Result>(){
             @mockit.Mock
             public String getOutput() {
-                return "{\"product\":\"tutorial\"}";
+                return "[{\"product\":\"tutorial\"}]";
             }
         };
         VTPTestExecution.VTPTestExecutionList vtpTestExecutionList = vtpExecutionResource1.listTestExecutionsHandler(requestId,"tutorial","ut","list-users","abc","123","123",1,0);