From b078c9d89a9d6c07f7cb6e7196b34caf797138d6 Mon Sep 17 00:00:00 2001 From: Parshad Patel Date: Thu, 15 Nov 2018 11:59:54 +0900 Subject: Rename test classes in drools-applications Make test classes name consistence by putting 'Test' at end as per google java style guide Issue-ID: POLICY-1258 Change-Id: Id79e5d3fe3688f7f2569b7996613595cc6b746e7 Signed-off-by: Parshad Patel --- .../test/java/org/onap/policy/rest/GetTest.java | 66 ++++++++++++++++++++++ .../test/java/org/onap/policy/rest/PairTest.java | 42 ++++++++++++++ .../test/java/org/onap/policy/rest/PostTest.java | 50 ++++++++++++++++ .../test/java/org/onap/policy/rest/TestGet.java | 66 ---------------------- .../test/java/org/onap/policy/rest/TestPair.java | 42 -------------- .../test/java/org/onap/policy/rest/TestPost.java | 50 ---------------- 6 files changed, 158 insertions(+), 158 deletions(-) create mode 100755 controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/GetTest.java create mode 100755 controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/PairTest.java create mode 100755 controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/PostTest.java delete mode 100755 controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestGet.java delete mode 100755 controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPair.java delete mode 100755 controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPost.java (limited to 'controlloop/common/model-impl/rest/src/test') diff --git a/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/GetTest.java b/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/GetTest.java new file mode 100755 index 000000000..11366c6a0 --- /dev/null +++ b/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/GetTest.java @@ -0,0 +1,66 @@ +/* + * ============LICENSE_START======================================================= + * rest + * ================================================================================ + * Copyright (C) 2017-2018 AT&T Intellectual Property. 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.rest; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; +import org.onap.policy.rest.RESTManager.Pair; + +public class GetTest { + + @Test(expected = NullPointerException.class) + public void testUrlNull() { + RESTManager mgr = new RESTManager(); + mgr.get(null, "user", null, null); + } + + @Test + public void testUsernameNull() { + RESTManager mgr = new RESTManager(); + + Pair result = mgr.get("http://www.example.org", null, null, null); + assertEquals((Integer)200, result.first); + assertTrue(result.second != null); + assertTrue(result.second.length() > 0); + } + + @Test + public void testUsernameEmpty() { + RESTManager mgr = new RESTManager(); + + Pair result = mgr.get("http://www.example.org", "", null, null); + assertEquals((Integer)200, result.first); + assertTrue(result.second != null); + assertTrue(result.second.length() > 0); + } + + @Test + public void testUrlExampleOrg() { + RESTManager mgr = new RESTManager(); + + Pair result = mgr.get("http://www.example.org", "user", null, null); + assertEquals((Integer)200, result.first); + assertTrue(result.second != null); + assertTrue(result.second.length() > 0); + } +} \ No newline at end of file diff --git a/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/PairTest.java b/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/PairTest.java new file mode 100755 index 000000000..e245eabdb --- /dev/null +++ b/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/PairTest.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * rest + * ================================================================================ + * + * ================================================================================ + * 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 org.onap.policy.rest; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.onap.policy.rest.RESTManager.Pair; + +public class PairTest { + + @Test + public void testPair() { + RESTManager mgr = new RESTManager(); + + Pair pii = mgr.new Pair<>(1, 2); + assertEquals((Integer) 1, (Integer) pii.first); + assertEquals((Integer) 2, (Integer) pii.second); + + Pair pis = mgr.new Pair<>(1, "test"); + assertEquals((Integer) 1, (Integer) pis.first); + assertEquals("test", pis.second); + } +} diff --git a/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/PostTest.java b/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/PostTest.java new file mode 100755 index 000000000..aedd0b288 --- /dev/null +++ b/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/PostTest.java @@ -0,0 +1,50 @@ +/* + * ============LICENSE_START======================================================= + * rest + * ================================================================================ + * Copyright (C) 2017-2018 AT&T Intellectual Property. 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.rest; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.onap.policy.rest.RESTManager.Pair; + +public class PostTest { + + @Test + public void testUsernameNull() { + RESTManager mgr = new RESTManager(); + Pair result = mgr.post("http://www.example.org", null, null, null, null, null); + assertEquals(null, result); + } + + @Test + public void testUsernameEmpty() { + RESTManager mgr = new RESTManager(); + Pair result = mgr.post("http://www.example.org", "", null, null, null, null); + assertEquals(null, result); + } + + @Test + public void testBodyNull() { + RESTManager mgr = new RESTManager(); + Pair result = mgr.post("http://www.example.org", "user", null, null, null, null); + assertEquals(null, result); + } +} diff --git a/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestGet.java b/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestGet.java deleted file mode 100755 index 7e881df51..000000000 --- a/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestGet.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * rest - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. 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. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.rest; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; -import org.onap.policy.rest.RESTManager.Pair; - -public class TestGet { - - @Test(expected = NullPointerException.class) - public void testUrlNull() { - RESTManager mgr = new RESTManager(); - mgr.get(null, "user", null, null); - } - - @Test - public void testUsernameNull() { - RESTManager mgr = new RESTManager(); - - Pair result = mgr.get("http://www.example.org", null, null, null); - assertEquals((Integer)200, result.first); - assertTrue(result.second != null); - assertTrue(result.second.length() > 0); - } - - @Test - public void testUsernameEmpty() { - RESTManager mgr = new RESTManager(); - - Pair result = mgr.get("http://www.example.org", "", null, null); - assertEquals((Integer)200, result.first); - assertTrue(result.second != null); - assertTrue(result.second.length() > 0); - } - - @Test - public void testUrlExampleOrg() { - RESTManager mgr = new RESTManager(); - - Pair result = mgr.get("http://www.example.org", "user", null, null); - assertEquals((Integer)200, result.first); - assertTrue(result.second != null); - assertTrue(result.second.length() > 0); - } -} \ No newline at end of file diff --git a/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPair.java b/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPair.java deleted file mode 100755 index 28e9934d1..000000000 --- a/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPair.java +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * rest - * ================================================================================ - * - * ================================================================================ - * 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 org.onap.policy.rest; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; -import org.onap.policy.rest.RESTManager.Pair; - -public class TestPair { - - @Test - public void testPair() { - RESTManager mgr = new RESTManager(); - - Pair pii = mgr.new Pair<>(1, 2); - assertEquals((Integer) 1, (Integer) pii.first); - assertEquals((Integer) 2, (Integer) pii.second); - - Pair pis = mgr.new Pair<>(1, "test"); - assertEquals((Integer) 1, (Integer) pis.first); - assertEquals("test", pis.second); - } -} diff --git a/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPost.java b/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPost.java deleted file mode 100755 index 58ba5d247..000000000 --- a/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPost.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * rest - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. 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. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.rest; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; -import org.onap.policy.rest.RESTManager.Pair; - -public class TestPost { - - @Test - public void testUsernameNull() { - RESTManager mgr = new RESTManager(); - Pair result = mgr.post("http://www.example.org", null, null, null, null, null); - assertEquals(null, result); - } - - @Test - public void testUsernameEmpty() { - RESTManager mgr = new RESTManager(); - Pair result = mgr.post("http://www.example.org", "", null, null, null, null); - assertEquals(null, result); - } - - @Test - public void testBodyNull() { - RESTManager mgr = new RESTManager(); - Pair result = mgr.post("http://www.example.org", "user", null, null, null, null); - assertEquals(null, result); - } -} -- cgit 1.2.3-korg