Adding Junit 83/35983/1
authorAS00465059 <AS00465059@techmahindra.com>
Thu, 15 Mar 2018 12:09:15 +0000 (17:39 +0530)
committerAS00465059 <AS00465059@techmahindra.com>
Thu, 15 Mar 2018 12:09:15 +0000 (17:39 +0530)
Adding Junit for:
1.AriaClientFactory.java
2.ExecutionDetails.java
3.ExecutionImpl.java
4.InputImpl.java
5.NodeTemplateImpl.java
6.OutputImpl.java
7.ServiceImpl.java
8.ServiceTemplateImpl.java
9.ValidationResultImpl.java
10.WorkflowImpl.java

Sonar Link:
https://sonar.onap.org/code?id=org.onap.so%3Aso&selected=org.onap.so%3Aaria-client%3Asrc%2Fmain%2Fjava%2Fcom%2Fgigaspaces%2Faria%2Frest%2Fclient

Change-Id: I3b817a3b38d9ec68bb8cfb44c350867617e5e59d
Issue-ID: SO-485
Signed-off-by: AS00465059 <AS00465059@techmahindra.com>
aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/AriaClientFactoryTest.java [new file with mode: 0644]
aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ExecutionDetailsTest.java [new file with mode: 0644]
aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ExecutionImplTest.java [new file with mode: 0644]
aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/InputImpTest.java [new file with mode: 0644]
aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/NodeTemplateImplTest.java [new file with mode: 0644]
aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/OutputImplTest.java [new file with mode: 0644]
aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ServiceImplTest.java [new file with mode: 0644]
aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ServiceTemplateImplTest.java [new file with mode: 0644]
aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ValidationResultImplTest.java [new file with mode: 0644]
aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/WorkflowimplTest.java [new file with mode: 0644]

diff --git a/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/AriaClientFactoryTest.java b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/AriaClientFactoryTest.java
new file mode 100644 (file)
index 0000000..7082c0a
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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=========================================================
+*/
+
+package com.gigaspaces.aria.rest.client;
+
+import org.junit.Test;
+
+public class AriaClientFactoryTest {
+       
+       @Test
+       public void test() {
+               AriaClientFactory acf=new AriaClientFactory();
+               assert(acf!=null);
+               acf.createRestClient("https", "address", 9060, "V1");
+       }
+}
diff --git a/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ExecutionDetailsTest.java b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ExecutionDetailsTest.java
new file mode 100644 (file)
index 0000000..7193349
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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=========================================================
+*/
+
+package com.gigaspaces.aria.rest.client;
+
+import static org.junit.Assert.*;
+import java.util.Arrays;
+import java.util.List;
+import org.junit.Test;
+
+public class ExecutionDetailsTest {
+       
+private Input inputs;
+private ExecutionDetails ed;
+
+@Test
+       public void test() {    
+        List<Input> actual = Arrays.asList(inputs);
+               ed= new ExecutionDetails("",30,30,false,actual);
+               ed=new ExecutionDetails("");
+               ed.setExecutor("");
+               ed.setInputs(actual);
+               ed.setTaskMaxAttempts(30);
+               ed.setTaskRetryInterval(30);
+               ed.setRetry_failed_tasks(false);
+               assert(ed.getExecutor()).equals("");
+               assertFalse(ed.isRetry_failed_tasks());
+               assert(ed.getInputs().equals(actual));
+               assertEquals(30,ed.getTaskMaxAttempts());
+       assertEquals(30,ed.getTaskRetryInterval());
+       }
+}
diff --git a/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ExecutionImplTest.java b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ExecutionImplTest.java
new file mode 100644 (file)
index 0000000..75781f8
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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=========================================================
+*/
+
+package com.gigaspaces.aria.rest.client;
+
+import org.junit.Test;
+
+public class ExecutionImplTest {
+       
+       @Test
+       public void testExecutionImpl() {
+       ExecutionImpl eil = new ExecutionImpl();
+               
+    eil.getExecutionId();
+    eil.getServiceName();
+    eil.getServiceTemplateName();
+    eil.getStatus();
+    eil.getWorkflowName();
+       }
+}
diff --git a/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/InputImpTest.java b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/InputImpTest.java
new file mode 100644 (file)
index 0000000..533067a
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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=========================================================
+*/
+
+package com.gigaspaces.aria.rest.client;
+
+import org.junit.Test;
+
+public class InputImpTest {
+       private InputImpl ip;
+       
+       @Test
+       public void test() {
+               ip=new InputImpl("name","value","desc");
+           assert(ip.getName().equals("name"));
+           assert(ip.getValue().equals("value"));
+           assert(ip.getDescription().equals("desc"));
+       }
+}
diff --git a/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/NodeTemplateImplTest.java b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/NodeTemplateImplTest.java
new file mode 100644 (file)
index 0000000..b23e825
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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=========================================================
+*/
+
+package com.gigaspaces.aria.rest.client;
+
+import static org.junit.Assert.*;
+import org.junit.Test;
+
+public class NodeTemplateImplTest {
+
+       private NodeTemplateImpl nti;
+       
+       @Test
+       public void test() {    
+               nti=new NodeTemplateImpl(12, null, "desc", 12, "tname");
+        assertEquals(12,nti.getId());
+        assertEquals(12,nti.getServiceTemplateId());
+        assertEquals(null,nti.getName());
+        assertEquals("desc",nti.getDescription());
+        assertEquals("tname",nti.getTypeName());
+       }
+}
diff --git a/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/OutputImplTest.java b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/OutputImplTest.java
new file mode 100644 (file)
index 0000000..f088572
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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=========================================================
+*/
+
+package com.gigaspaces.aria.rest.client;
+
+import org.junit.Test;
+
+public class OutputImplTest {  
+       
+        @Test
+       public void test() {
+               OutputImpl oil= new OutputImpl();
+               oil.getDescription();
+               oil.getName();
+               oil.getValue();
+       }
+}
diff --git a/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ServiceImplTest.java b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ServiceImplTest.java
new file mode 100644 (file)
index 0000000..c289968
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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=========================================================
+*/
+
+package com.gigaspaces.aria.rest.client;
+
+import org.junit.Test;
+
+public class ServiceImplTest {
+
+       private ServiceImpl sil;
+       
+       @Test
+       public void test() {
+           sil=new ServiceImpl();
+           sil.getId();
+           sil.getDescription();
+           sil.getName();
+           sil.getServiceTemplate();
+           sil.getUpdated();
+           sil.getCreated();
+       }
+
+}
diff --git a/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ServiceTemplateImplTest.java b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ServiceTemplateImplTest.java
new file mode 100644 (file)
index 0000000..92a71c4
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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=========================================================
+*/
+
+package com.gigaspaces.aria.rest.client;
+
+import static org.junit.Assert.*;
+
+import java.net.URI;
+
+import org.junit.Test;
+
+public class ServiceTemplateImplTest {
+
+        private URI uri;
+        private byte[] csar_blob;
+        private ServiceTemplateImpl sti;
+       
+       @Test
+       public void test() {
+               sti=new ServiceTemplateImpl("name", uri, "filename", "description");
+               ServiceTemplateImpl stid=new ServiceTemplateImpl("name", csar_blob);
+               ServiceTemplateImpl std=new ServiceTemplateImpl("name", uri);
+               sti.setFilename("filename");
+               sti.setId(10);
+               sti.setName("name");
+               sti.setPath("path");
+               assertEquals(10,sti.getId());
+               assertEquals("name",sti.getName());
+               assertEquals(uri,sti.getURI());
+               assertEquals("filename",sti.getFilename());
+               assertEquals("description",sti.getDescription());
+               assertEquals(csar_blob,stid.getCSARBytes());    
+       }
+}
diff --git a/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ValidationResultImplTest.java b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ValidationResultImplTest.java
new file mode 100644 (file)
index 0000000..1181fe6
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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=========================================================
+*/
+
+package com.gigaspaces.aria.rest.client;
+
+import static org.junit.Assert.*;
+import org.junit.Test;
+
+public class ValidationResultImplTest {
+
+       private boolean failed=false;
+
+        private ValidationResultImpl vri;
+       
+       @Test
+       public void test() {
+        vri=new ValidationResultImpl();
+        vri.setFailed(failed);
+           assertFalse(vri.getFailed());
+       }
+}
diff --git a/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/WorkflowimplTest.java b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/WorkflowimplTest.java
new file mode 100644 (file)
index 0000000..fe5def8
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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=========================================================
+*/
+
+package com.gigaspaces.aria.rest.client;
+
+import org.junit.Test;
+
+public class WorkflowimplTest {
+
+       private WorkflowImpl wfi;
+       
+       @Test
+       public void test() {
+               wfi=new WorkflowImpl();
+               wfi.getName();
+       }   
+}