From 3504265229c589ecc166e3ad4c33bb198b11e4ce Mon Sep 17 00:00:00 2001 From: sunil unnava Date: Tue, 23 Oct 2018 12:18:59 -0400 Subject: update the package name Issue-ID: DMAAP-858 Change-Id: I49ae6eb9c51a261b64b911e607fcbbca46c5423c Signed-off-by: sunil unnava --- .../cambria/backends/memory/JUnitTestSuite.java | 43 --------- .../backends/memory/MemoryConsumerFactoryTest.java | 83 ---------------- .../backends/memory/MemoryMetaBrokerTest.java | 92 ------------------ .../backends/memory/MemoryQueuePublisherTest.java | 102 -------------------- .../cambria/backends/memory/MemoryQueueTest.java | 95 ------------------- .../cambria/backends/memory/MessageLoggerTest.java | 104 --------------------- .../nsa/cambria/backends/memory/TestRunner.java | 41 -------- 7 files changed, 560 deletions(-) delete mode 100644 src/test/java/com/att/nsa/cambria/backends/memory/JUnitTestSuite.java delete mode 100644 src/test/java/com/att/nsa/cambria/backends/memory/MemoryConsumerFactoryTest.java delete mode 100644 src/test/java/com/att/nsa/cambria/backends/memory/MemoryMetaBrokerTest.java delete mode 100644 src/test/java/com/att/nsa/cambria/backends/memory/MemoryQueuePublisherTest.java delete mode 100644 src/test/java/com/att/nsa/cambria/backends/memory/MemoryQueueTest.java delete mode 100644 src/test/java/com/att/nsa/cambria/backends/memory/MessageLoggerTest.java delete mode 100644 src/test/java/com/att/nsa/cambria/backends/memory/TestRunner.java (limited to 'src/test/java/com/att/nsa/cambria/backends/memory') diff --git a/src/test/java/com/att/nsa/cambria/backends/memory/JUnitTestSuite.java b/src/test/java/com/att/nsa/cambria/backends/memory/JUnitTestSuite.java deleted file mode 100644 index fc11552..0000000 --- a/src/test/java/com/att/nsa/cambria/backends/memory/JUnitTestSuite.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP Policy Engine - * ================================================================================ - * Copyright (C) 2017 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 com.att.nsa.cambria.backends.memory; - -import junit.framework.TestSuite; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; -import org.apache.log4j.Logger; - -@RunWith(Suite.class) -@SuiteClasses({ MemoryConsumerFactoryTest.class, MemoryMetaBrokerTest.class, MemoryQueueTest.class, - MemoryQueuePublisherTest.class, MessageLoggerTest.class, }) -public class JUnitTestSuite { - private static final Logger LOGGER = Logger.getLogger(JUnitTestSuite.class); - - public static void main(String[] args) { - LOGGER.info("Running the test suite"); - - TestSuite tstSuite = new TestSuite(); - LOGGER.info("Total Test Counts " + tstSuite.countTestCases()); - } - -} diff --git a/src/test/java/com/att/nsa/cambria/backends/memory/MemoryConsumerFactoryTest.java b/src/test/java/com/att/nsa/cambria/backends/memory/MemoryConsumerFactoryTest.java deleted file mode 100644 index d6fe6e6..0000000 --- a/src/test/java/com/att/nsa/cambria/backends/memory/MemoryConsumerFactoryTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP Policy Engine - * ================================================================================ - * Copyright (C) 2017 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 com.att.nsa.cambria.backends.memory; - -import static org.junit.Assert.*; - -import java.io.IOException; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import com.att.dmf.mr.backends.memory.MemoryConsumerFactory; - -public class MemoryConsumerFactoryTest { - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testGetConsumerFor() { - MemoryConsumerFactory factory = new MemoryConsumerFactory(null); - - - String topic = "testTopic"; - String consumerGroupId = "CG1"; - String clientId = "C1"; - String remoteHost="remoteHost"; - int timeoutMs = 1000; - factory.getConsumerFor(topic, consumerGroupId, clientId, timeoutMs,remoteHost); - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - @Test - public void testDropCache() { - MemoryConsumerFactory factory = new MemoryConsumerFactory(null); - - factory.dropCache(); - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - @Test - public void testGetConsumers() { - MemoryConsumerFactory factory = new MemoryConsumerFactory(null); - - factory.getConsumers(); - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - -} diff --git a/src/test/java/com/att/nsa/cambria/backends/memory/MemoryMetaBrokerTest.java b/src/test/java/com/att/nsa/cambria/backends/memory/MemoryMetaBrokerTest.java deleted file mode 100644 index 2c41068..0000000 --- a/src/test/java/com/att/nsa/cambria/backends/memory/MemoryMetaBrokerTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP Policy Engine - * ================================================================================ - * Copyright (C) 2017 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 com.att.nsa.cambria.backends.memory; - -import static org.junit.Assert.*; - -import java.io.IOException; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import com.att.dmf.mr.backends.memory.MemoryMetaBroker; -import com.att.dmf.mr.metabroker.Broker.TopicExistsException; - -public class MemoryMetaBrokerTest { - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testGetAllTopics() { - MemoryMetaBroker broker = new MemoryMetaBroker(null, null); - - broker.getAllTopics(); - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - @Test - public void testGeTopic() { - MemoryMetaBroker broker = new MemoryMetaBroker(null, null); - - broker.getTopic("testTopic"); - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - @Test - public void testCreateTopic() { - - //uncommenting this gives a Null Pointer Exception - - MemoryMetaBroker broker = new MemoryMetaBroker(null, null); - - int timeoutMs = 1000; - try { - broker.createTopic("testTopic","topic for testing", "ABCD123", 1,3, true); - } catch (TopicExistsException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (NullPointerException e) { - // TODO Auto-generated catch block - assertTrue(true); - } - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - - - -} diff --git a/src/test/java/com/att/nsa/cambria/backends/memory/MemoryQueuePublisherTest.java b/src/test/java/com/att/nsa/cambria/backends/memory/MemoryQueuePublisherTest.java deleted file mode 100644 index 4522734..0000000 --- a/src/test/java/com/att/nsa/cambria/backends/memory/MemoryQueuePublisherTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP Policy Engine - * ================================================================================ - * Copyright (C) 2017 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 com.att.nsa.cambria.backends.memory; - -import static org.junit.Assert.*; - -import java.io.IOException; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import com.att.dmf.mr.backends.memory.MemoryQueuePublisher; - - -public class MemoryQueuePublisherTest { - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSendBatchMessage() { - MemoryQueuePublisher publisher = new MemoryQueuePublisher(null, null); - - try { - publisher.sendBatchMessageNew("testTopic", null); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - @Test - public void testSendMessage() { - MemoryQueuePublisher publisher = new MemoryQueuePublisher(null, null); - - try { - publisher.sendMessage("testTopic", null); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (NullPointerException e) { - // TODO Auto-generated catch block - assertTrue(true); - } - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - @Test - public void testSendMessages() { - MemoryQueuePublisher publisher = new MemoryQueuePublisher(null, null); - - - try { - publisher.sendMessages("testTopic", null); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (NullPointerException e) { - // TODO Auto-generated catch block - assertTrue(true); - } - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - - - -} diff --git a/src/test/java/com/att/nsa/cambria/backends/memory/MemoryQueueTest.java b/src/test/java/com/att/nsa/cambria/backends/memory/MemoryQueueTest.java deleted file mode 100644 index 637add2..0000000 --- a/src/test/java/com/att/nsa/cambria/backends/memory/MemoryQueueTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP Policy Engine - * ================================================================================ - * Copyright (C) 2017 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 com.att.nsa.cambria.backends.memory; - -import static org.junit.Assert.*; - - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import com.att.dmf.mr.backends.memory.MemoryQueue; - - -public class MemoryQueueTest { - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testCreateTopic() { - MemoryQueue queue = new MemoryQueue(); - - queue.createTopic("testTopic"); - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - - @Test - public void testRemoveTopic() { - MemoryQueue queue = new MemoryQueue(); - - queue.removeTopic("testTopic"); - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - @Test - public void testPut() { - MemoryQueue queue = new MemoryQueue(); - - try { - queue.put("testTopic", null); - } catch (NullPointerException e) { - // TODO Auto-generated catch block - assertTrue(true); - } - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - @Test - public void testGet() { - MemoryQueue queue = new MemoryQueue(); - - queue.get("testTopic", "consumer"); - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - - -} diff --git a/src/test/java/com/att/nsa/cambria/backends/memory/MessageLoggerTest.java b/src/test/java/com/att/nsa/cambria/backends/memory/MessageLoggerTest.java deleted file mode 100644 index 81e620c..0000000 --- a/src/test/java/com/att/nsa/cambria/backends/memory/MessageLoggerTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP Policy Engine - * ================================================================================ - * Copyright (C) 2017 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 com.att.nsa.cambria.backends.memory; - -import static org.junit.Assert.*; - -import java.io.IOException; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import com.att.dmf.mr.backends.memory.MessageLogger; - - -public class MessageLoggerTest { - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSendMessage() { - MessageLogger dropper = new MessageLogger(); - - try { - dropper.sendMessage("testTopic", null); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (NullPointerException e) { - // TODO Auto-generated catch block - assertTrue(true); - } - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - @Test - public void testSendMessages() { - MessageLogger dropper = new MessageLogger(); - - try { - dropper.sendMessages("testTopic", null); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (NullPointerException e) { - // TODO Auto-generated catch block - assertTrue(true); - } - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - @Test - public void testSendBatchMessage() { - MessageLogger dropper = new MessageLogger(); - - try { - dropper.sendBatchMessageNew("testTopic", null); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - String trueValue = "True"; - assertTrue(trueValue.equalsIgnoreCase("True")); - - } - - - -} - - - - diff --git a/src/test/java/com/att/nsa/cambria/backends/memory/TestRunner.java b/src/test/java/com/att/nsa/cambria/backends/memory/TestRunner.java deleted file mode 100644 index 2c75929..0000000 --- a/src/test/java/com/att/nsa/cambria/backends/memory/TestRunner.java +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP Policy Engine - * ================================================================================ - * Copyright (C) 2017 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 com.att.nsa.cambria.backends.memory; - -import org.junit.runner.JUnitCore; -import org.junit.runner.Result; -import org.junit.runner.notification.Failure; -import org.apache.log4j.Logger; - -public class TestRunner { - private static final Logger LOGGER = Logger.getLogger(TestRunner.class); - - public static void main(String[] args) { - // TODO Auto-generated method stub - Result result = JUnitCore.runClasses(JUnitTestSuite.class); - for (Failure failure : result.getFailures()) { - LOGGER.info(failure.toString()); - - } - LOGGER.info(result.wasSuccessful()); - } - -} -- cgit 1.2.3-korg