From e8b197315437cac84872752e2ea090d8fb233941 Mon Sep 17 00:00:00 2001 From: Parshad Patel Date: Tue, 20 Nov 2018 14:46:45 +0900 Subject: Rename test classes in apex-pdp Make test classes name consistence under auth, model, plugins, testsuits, tools projects Issue-ID: POLICY-1263 Change-Id: I49ec9a9f5b457d6381e693de2c04ec0268ad1b02 Signed-off-by: Parshad Patel --- .../model/utilities/typeutils/KeyComparerTest.java | 51 ++++++++++++++ .../utilities/typeutils/KeyedMapComparerTest.java | 77 ++++++++++++++++++++++ .../model/utilities/typeutils/TestKeyComparer.java | 51 -------------- .../utilities/typeutils/TestKeyedMapComparer.java | 77 ---------------------- 4 files changed, 128 insertions(+), 128 deletions(-) create mode 100644 model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/KeyComparerTest.java create mode 100644 model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/KeyedMapComparerTest.java delete mode 100644 model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/TestKeyComparer.java delete mode 100644 model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/TestKeyedMapComparer.java (limited to 'model/utilities/src') diff --git a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/KeyComparerTest.java b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/KeyComparerTest.java new file mode 100644 index 000000000..45afc2088 --- /dev/null +++ b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/KeyComparerTest.java @@ -0,0 +1,51 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. 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.model.utilities.typeutils; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; +import org.onap.policy.apex.model.utilities.comparison.KeyComparer; +import org.onap.policy.apex.model.utilities.comparison.KeyDifference; + +/** + * Test key comparisons. + * @author Liam Fallon (liam.fallon@ericsson.com) + */ +public class KeyComparerTest { + + @Test + public void test() { + KeyDifference keyDifference = new KeyComparer().compareKeys("Hello", "Goodbye"); + + assertFalse(keyDifference.isEqual()); + assertTrue("Hello".equals(keyDifference.getLeftKey().toString())); + assertTrue("Goodbye".equals(keyDifference.getRightKey().toString())); + + assertTrue("left key Hello and right key Goodbye differ\n".equals(keyDifference.asString(true))); + assertTrue("left key Hello and right key Goodbye differ\n".equals(keyDifference.asString(false))); + + KeyDifference keyDifference2 = new KeyComparer().compareKeys("Here", "Here"); + assertTrue("".equals(keyDifference2.asString(true))); + assertTrue("left key Here equals right key Here\n".equals(keyDifference2.asString(false))); + } +} diff --git a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/KeyedMapComparerTest.java b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/KeyedMapComparerTest.java new file mode 100644 index 000000000..7fb3a5bb7 --- /dev/null +++ b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/KeyedMapComparerTest.java @@ -0,0 +1,77 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. 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.model.utilities.typeutils; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.TreeMap; + +import org.junit.Test; +import org.onap.policy.apex.model.utilities.comparison.KeyedMapComparer; +import org.onap.policy.apex.model.utilities.comparison.KeyedMapDifference; + +/** + * Test key map comparisons. + * + * @author Liam Fallon (liam.fallon@ericsson.com) + */ +public class KeyedMapComparerTest { + + @Test + public void test() { + TreeMap leftMap = new TreeMap(); + leftMap.put("B", "BBBBB"); + leftMap.put("C", "CCCCC"); + leftMap.put("E", "EEEEE"); + leftMap.put("G", "GGGGG"); + + TreeMap rightMap = new TreeMap(); + rightMap.put("A", "AAAAA"); + rightMap.put("B", "B"); + rightMap.put("D", "DDDDD"); + rightMap.put("E", "EEEEE"); + rightMap.put("F", "FFFFF"); + rightMap.put("G", "G"); + + KeyedMapDifference kmComparedSame = new KeyedMapComparer().compareMaps(leftMap, + leftMap); + KeyedMapDifference kmComparedDiff = new KeyedMapComparer().compareMaps(leftMap, + rightMap); + + assertTrue(kmComparedSame.getIdenticalValues().equals(leftMap)); + assertEquals(1, kmComparedDiff.getLeftOnly().size()); + assertEquals(3, kmComparedDiff.getRightOnly().size()); + assertEquals(2, kmComparedDiff.getDifferentValues().size()); + assertEquals(1, kmComparedDiff.getIdenticalValues().size()); + + assertNotNull(kmComparedSame.asString(true, true)); + assertNotNull(kmComparedSame.asString(true, false)); + assertNotNull(kmComparedSame.asString(false, false)); + assertNotNull(kmComparedSame.asString(false, true)); + + assertNotNull(kmComparedDiff.asString(true, true)); + assertNotNull(kmComparedDiff.asString(true, false)); + assertNotNull(kmComparedDiff.asString(false, false)); + assertNotNull(kmComparedDiff.asString(false, true)); + } +} diff --git a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/TestKeyComparer.java b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/TestKeyComparer.java deleted file mode 100644 index 538028de0..000000000 --- a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/TestKeyComparer.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. 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.model.utilities.typeutils; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; -import org.onap.policy.apex.model.utilities.comparison.KeyComparer; -import org.onap.policy.apex.model.utilities.comparison.KeyDifference; - -/** - * Test key comparisons. - * @author Liam Fallon (liam.fallon@ericsson.com) - */ -public class TestKeyComparer { - - @Test - public void test() { - KeyDifference keyDifference = new KeyComparer().compareKeys("Hello", "Goodbye"); - - assertFalse(keyDifference.isEqual()); - assertTrue("Hello".equals(keyDifference.getLeftKey().toString())); - assertTrue("Goodbye".equals(keyDifference.getRightKey().toString())); - - assertTrue("left key Hello and right key Goodbye differ\n".equals(keyDifference.asString(true))); - assertTrue("left key Hello and right key Goodbye differ\n".equals(keyDifference.asString(false))); - - KeyDifference keyDifference2 = new KeyComparer().compareKeys("Here", "Here"); - assertTrue("".equals(keyDifference2.asString(true))); - assertTrue("left key Here equals right key Here\n".equals(keyDifference2.asString(false))); - } -} diff --git a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/TestKeyedMapComparer.java b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/TestKeyedMapComparer.java deleted file mode 100644 index de71ea164..000000000 --- a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/typeutils/TestKeyedMapComparer.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. 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.model.utilities.typeutils; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.TreeMap; - -import org.junit.Test; -import org.onap.policy.apex.model.utilities.comparison.KeyedMapComparer; -import org.onap.policy.apex.model.utilities.comparison.KeyedMapDifference; - -/** - * Test key map comparisons. - * - * @author Liam Fallon (liam.fallon@ericsson.com) - */ -public class TestKeyedMapComparer { - - @Test - public void test() { - TreeMap leftMap = new TreeMap(); - leftMap.put("B", "BBBBB"); - leftMap.put("C", "CCCCC"); - leftMap.put("E", "EEEEE"); - leftMap.put("G", "GGGGG"); - - TreeMap rightMap = new TreeMap(); - rightMap.put("A", "AAAAA"); - rightMap.put("B", "B"); - rightMap.put("D", "DDDDD"); - rightMap.put("E", "EEEEE"); - rightMap.put("F", "FFFFF"); - rightMap.put("G", "G"); - - KeyedMapDifference kmComparedSame = new KeyedMapComparer().compareMaps(leftMap, - leftMap); - KeyedMapDifference kmComparedDiff = new KeyedMapComparer().compareMaps(leftMap, - rightMap); - - assertTrue(kmComparedSame.getIdenticalValues().equals(leftMap)); - assertEquals(1, kmComparedDiff.getLeftOnly().size()); - assertEquals(3, kmComparedDiff.getRightOnly().size()); - assertEquals(2, kmComparedDiff.getDifferentValues().size()); - assertEquals(1, kmComparedDiff.getIdenticalValues().size()); - - assertNotNull(kmComparedSame.asString(true, true)); - assertNotNull(kmComparedSame.asString(true, false)); - assertNotNull(kmComparedSame.asString(false, false)); - assertNotNull(kmComparedSame.asString(false, true)); - - assertNotNull(kmComparedDiff.asString(true, true)); - assertNotNull(kmComparedDiff.asString(true, false)); - assertNotNull(kmComparedDiff.asString(false, false)); - assertNotNull(kmComparedDiff.asString(false, true)); - } -} -- cgit 1.2.3-korg