summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakenihan <adam.kenihan@est.tech>2024-10-22 17:49:23 +0100
committerakenihan <adam.kenihan@est.tech>2024-10-23 16:43:33 +0100
commitbc949bab9233b43224d9d9fab5243f7b62b7751e (patch)
tree0af8b531cc1b8d3a74b1031dd0587646001c950e
parent6b164a94d894c969811c9388b6af8c9a1fca2be2 (diff)
Improve coverage on testsuites module in apex-pdp
Issue-ID: POLICY-5059 Change-Id: I56ce8c31c9c291b11e1036bcf1abec71eb4b8aeb Signed-off-by: akenihan <adam.kenihan@est.tech>
-rw-r--r--lombok.config2
-rw-r--r--testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextByteItemTest.java34
-rw-r--r--testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateItemTest.java39
-rw-r--r--testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItemTest.java44
-rw-r--r--testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItemTest.java39
-rw-r--r--testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDoubleItemTest.java34
-rw-r--r--testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextFloatItemTest.java34
-rw-r--r--testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextIntItemTest.java35
-rw-r--r--testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextLongItemTest.java34
-rw-r--r--testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextLongObjectItemTest.java34
-rw-r--r--testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextTreeSetItemTest.java36
11 files changed, 365 insertions, 0 deletions
diff --git a/lombok.config b/lombok.config
new file mode 100644
index 000000000..a23edb413
--- /dev/null
+++ b/lombok.config
@@ -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
index 000000000..c46525cbe
--- /dev/null
+++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextByteItemTest.java
@@ -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
index 000000000..d57ba689a
--- /dev/null
+++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateItemTest.java
@@ -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
index 000000000..69e3ffed9
--- /dev/null
+++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItemTest.java
@@ -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
index 000000000..fa03c2903
--- /dev/null
+++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItemTest.java
@@ -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
index 000000000..5c2b61855
--- /dev/null
+++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextDoubleItemTest.java
@@ -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
index 000000000..aca53885d
--- /dev/null
+++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextFloatItemTest.java
@@ -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
index 000000000..b0dd8746a
--- /dev/null
+++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextIntItemTest.java
@@ -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
index 000000000..dd9347e68
--- /dev/null
+++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextLongItemTest.java
@@ -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
index 000000000..c78566ea0
--- /dev/null
+++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextLongObjectItemTest.java
@@ -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
index 000000000..cc7f485fa
--- /dev/null
+++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/context/test/concepts/TestContextTreeSetItemTest.java
@@ -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);
+ }
+}