diff options
author | AS00465059 <AS00465059@techmahindra.com> | 2018-03-15 17:39:15 +0530 |
---|---|---|
committer | AS00465059 <AS00465059@techmahindra.com> | 2018-03-15 17:39:15 +0530 |
commit | 49a8109233c5ba93a04a718ab69be71316d1a996 (patch) | |
tree | ee8bd076068a9ac4ddbe60ae18ac539cd493cb3f /aria/aria-rest-java-client/src/test/java/com | |
parent | aee3d223f92a6f250f43e17558a2dfd576ff7294 (diff) |
Adding Junit
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>
Diffstat (limited to 'aria/aria-rest-java-client/src/test/java/com')
10 files changed, 390 insertions, 0 deletions
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 index 0000000000..7082c0add0 --- /dev/null +++ b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/AriaClientFactoryTest.java @@ -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 index 0000000000..71933497bf --- /dev/null +++ b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ExecutionDetailsTest.java @@ -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 index 0000000000..75781f8933 --- /dev/null +++ b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ExecutionImplTest.java @@ -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 index 0000000000..533067a7e1 --- /dev/null +++ b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/InputImpTest.java @@ -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 index 0000000000..b23e825ffb --- /dev/null +++ b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/NodeTemplateImplTest.java @@ -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 index 0000000000..f088572365 --- /dev/null +++ b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/OutputImplTest.java @@ -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 index 0000000000..c289968187 --- /dev/null +++ b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ServiceImplTest.java @@ -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 index 0000000000..92a71c4a67 --- /dev/null +++ b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ServiceTemplateImplTest.java @@ -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 index 0000000000..1181fe67c0 --- /dev/null +++ b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/ValidationResultImplTest.java @@ -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 index 0000000000..fe5def8ff1 --- /dev/null +++ b/aria/aria-rest-java-client/src/test/java/com/gigaspaces/aria/rest/client/WorkflowimplTest.java @@ -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(); + } +} |