Improve coverage on testsuites module in apex-pdp 58/139258/2
authorakenihan <adam.kenihan@est.tech>
Tue, 22 Oct 2024 16:49:23 +0000 (17:49 +0100)
committerakenihan <adam.kenihan@est.tech>
Wed, 23 Oct 2024 15:43:33 +0000 (16:43 +0100)
Issue-ID: POLICY-5059
Change-Id: I56ce8c31c9c291b11e1036bcf1abec71eb4b8aeb
Signed-off-by: akenihan <adam.kenihan@est.tech>
lombok.config [new file with mode: 0644]
testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextByteItemTest.java [new file with mode: 0644]
testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateItemTest.java [new file with mode: 0644]
testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItemTest.java [new file with mode: 0644]
testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItemTest.java [new file with mode: 0644]
testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDoubleItemTest.java [new file with mode: 0644]
testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextFloatItemTest.java [new file with mode: 0644]
testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextIntItemTest.java [new file with mode: 0644]
testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextLongItemTest.java [new file with mode: 0644]
testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextLongObjectItemTest.java [new file with mode: 0644]
testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextTreeSetItemTest.java [new file with mode: 0644]

diff --git a/lombok.config b/lombok.config
new file mode 100644 (file)
index 0000000..a23edb4
--- /dev/null
@@ -0,0 +1,2 @@
+config.stopBubbling = true
+lombok.addLombokGeneratedAnnotation = true
\ No newline at end of file
diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextByteItemTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextByteItemTest.java
new file mode 100644 (file)
index 0000000..c46525c
--- /dev/null
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2024 Nordix Foundation. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.apex.context.test.concepts;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+
+class TestContextByteItemTest {
+
+    @Test
+    void getIncrementedByteValueTest() {
+        TestContextByteItem tcbi = new TestContextByteItem();
+        assertEquals(1, (int) tcbi.getIncrementedByteValue());
+    }
+}
diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateItemTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateItemTest.java
new file mode 100644 (file)
index 0000000..d57ba68
--- /dev/null
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2024 Nordix Foundation. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.apex.context.test.concepts;
+
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+import java.util.Date;
+import org.junit.jupiter.api.Test;
+
+class TestContextDateItemTest {
+
+    @Test
+    void contextDateItemDateTest() {
+        TestContextDateItem tcdi = new TestContextDateItem();
+        assertNotEquals(tcdi.getDateValue(), new Date(2323223232L));
+        assertNotEquals(new TestContextDateItem(null), new TestContextDateItem(new Date(2323223232L)));
+        tcdi.setDateValue(new Date(32323232223L));
+        assertNotEquals(new TestContextDateItem(2323223232L), tcdi);
+        tcdi.setDateValue(null);
+    }
+}
diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItemTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItemTest.java
new file mode 100644 (file)
index 0000000..69e3ffe
--- /dev/null
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2024 Nordix Foundation. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.apex.context.test.concepts;
+
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+import java.util.TimeZone;
+import org.junit.jupiter.api.Test;
+
+
+class TestContextDateLocaleItemTest {
+
+    @Test
+    void contextDateLocaleItemTest() {
+        TestContextDateLocaleItem tcdli = new TestContextDateLocaleItem();
+        TestContextDateItem tcdi = new TestContextDateItem();
+        String tzValue = TimeZone.getTimeZone("Europe/London").getDisplayName();
+        assertNotEquals(new TestContextDateLocaleItem(tcdi, tzValue, false, 0, "English", "England"),
+                new TestContextDateLocaleItem());
+        assertNotEquals(tcdli, new TestContextDateLocaleItem(tcdli));
+        tcdli.setTzValue(TimeZone.getTimeZone("Europe/Dublin").getDisplayName());
+        TestContextDateLocaleItem nullTcdli = new TestContextDateLocaleItem();
+        nullTcdli.setTzValue(null);
+        assertNotEquals(tcdli, nullTcdli);
+    }
+}
diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItemTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItemTest.java
new file mode 100644 (file)
index 0000000..fa03c29
--- /dev/null
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2024 Nordix Foundation. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.apex.context.test.concepts;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+import org.junit.jupiter.api.Test;
+
+class TestContextDateTzItemTest {
+
+    @Test
+    void contextDateTzItemTest() {
+        TestContextDateTzItem tcdti = new TestContextDateTzItem();
+        TestContextDateTzItem tcdti1 = new TestContextDateTzItem();
+        tcdti1.setTzValue("Europe/London");
+        tcdti.setTzValue(null);
+        assertNotEquals(tcdti, tcdti1);
+        assertEquals(tcdti, new TestContextDateTzItem(tcdti));
+    }
+}
diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDoubleItemTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDoubleItemTest.java
new file mode 100644 (file)
index 0000000..5c2b618
--- /dev/null
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2024 Nordix Foundation. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.apex.context.test.concepts;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+
+class TestContextDoubleItemTest {
+
+    @Test
+    void getIncrementedDoubleValueTest() {
+        TestContextDoubleItem tcdi = new TestContextDoubleItem();
+        assertEquals(tcdi.getIncrementedDoubleValue(), tcdi.getDoubleValue() + 1);
+    }
+}
diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextFloatItemTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextFloatItemTest.java
new file mode 100644 (file)
index 0000000..aca5388
--- /dev/null
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2024 Nordix Foundation. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.apex.context.test.concepts;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+
+class TestContextFloatItemTest {
+
+    @Test
+    void getIncrementedFloatValueTest() {
+        TestContextFloatItem tcfi = new TestContextFloatItem();
+        assertEquals(1, tcfi.getIncrementedFloatValue());
+    }
+}
diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextIntItemTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextIntItemTest.java
new file mode 100644 (file)
index 0000000..b0dd874
--- /dev/null
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2024 Nordix Foundation. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.apex.context.test.concepts;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+
+class TestContextIntItemTest {
+
+    @Test
+    void getIncrementedIntValueTest() {
+        TestContextIntItem tcii = new TestContextIntItem();
+        TestContextIntItem tcii1 = new TestContextIntItem(tcii);
+        assertEquals(1, tcii1.getIncrementedIntValue());
+    }
+}
diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextLongItemTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextLongItemTest.java
new file mode 100644 (file)
index 0000000..dd9347e
--- /dev/null
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2024 Nordix Foundation. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.apex.context.test.concepts;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+
+class TestContextLongItemTest {
+
+    @Test
+    void getIncrementedLongValueTest() {
+        TestContextLongItem tcli = new TestContextLongItem();
+        assertEquals(1, tcli.getIncrementedLongValue());
+    }
+}
diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextLongObjectItemTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextLongObjectItemTest.java
new file mode 100644 (file)
index 0000000..c78566e
--- /dev/null
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2024 Nordix Foundation. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.apex.context.test.concepts;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+
+class TestContextLongObjectItemTest {
+
+    @Test
+    void getIncrementedLongValueTest() {
+        TestContextLongObjectItem tcloi = new TestContextLongObjectItem();
+        assertEquals(1, tcloi.getIncrementedLongValue());
+    }
+}
diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextTreeSetItemTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextTreeSetItemTest.java
new file mode 100644 (file)
index 0000000..cc7f485
--- /dev/null
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2024 Nordix Foundation. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.apex.context.test.concepts;
+
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+import org.junit.jupiter.api.Test;
+
+class TestContextTreeSetItemTest {
+
+    @Test
+    void contextTreeSetItemTest() {
+        TestContextTreeSetItem tctsi = new TestContextTreeSetItem();
+        String[] arr = {"test1", "test2"};
+        TestContextTreeSetItem tctsi1 = new TestContextTreeSetItem(arr);
+        assertNotEquals(tctsi, tctsi1);
+    }
+}