From 1cb526d1675874ec7ffc3e6bfe2b4c89b0affa4d Mon Sep 17 00:00:00 2001 From: asgar Date: Fri, 14 Sep 2018 15:15:54 +0530 Subject: sonar fixes in MRClientFactory.java Change-Id: Ic01e466f2a64bb02b614b48d13de65a7a48a8e74 Issue-ID: DMAAP-777 Signed-off-by: Mohamed Asgar Samiulla --- .../com/att/nsa/mr/client/MRClientFactoryTest.java | 279 ++++++++++----------- 1 file changed, 138 insertions(+), 141 deletions(-) (limited to 'src/test') diff --git a/src/test/java/com/att/nsa/mr/client/MRClientFactoryTest.java b/src/test/java/com/att/nsa/mr/client/MRClientFactoryTest.java index 08bf23a..7ea091b 100644 --- a/src/test/java/com/att/nsa/mr/client/MRClientFactoryTest.java +++ b/src/test/java/com/att/nsa/mr/client/MRClientFactoryTest.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright © 2018 IBM. + * ================================================================================ * 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 @@ -38,218 +40,213 @@ import com.att.nsa.mr.client.MRClientFactory; public class MRClientFactoryTest { - private Collection hostSet = new ArrayList(); - - private MRClientFactory factory = null; - - private String[] hostArray = new String[10]; - - @Before - public void setUp() throws Exception { + private Collection hostSet = new ArrayList(); - for (int i = 0; i < 10; i++) { - hostSet.add("host" + (i + 1)); - hostArray[i] = "host" + (i + 1); - } + private String[] hostArray = new String[10]; - factory = new MRClientFactory(); + @Before + public void setUp() throws Exception { - } + for (int i = 0; i < 10; i++) { + hostSet.add("host" + (i + 1)); + hostArray[i] = "host" + (i + 1); + } + } - @After - public void tearDown() throws Exception { + @After + public void tearDown() throws Exception { - } + } - @Test - public void testCreateConsumer() { + @Test + public void testCreateConsumer() { - MRClientFactory.createConsumer("hostList hostList2", "testTopic"); - assertTrue(true); + MRClientFactory.createConsumer("hostList hostList2", "testTopic"); + assertTrue(true); - } + } - @Test - public void testCreateConsumer2() { + @Test + public void testCreateConsumer2() { - MRClientFactory.createConsumer(hostSet, "testTopic"); - assertTrue(true); + MRClientFactory.createConsumer(hostSet, "testTopic"); + assertTrue(true); - } + } - @Test - public void testCreateConsumer3() { + @Test + public void testCreateConsumer3() { - MRClientFactory.createConsumer(hostSet, "testTopic", "filter"); - assertTrue(true); + MRClientFactory.createConsumer(hostSet, "testTopic", "filter"); + assertTrue(true); - } + } - @Test - public void testCreateConsumer4() { + @Test + public void testCreateConsumer4() { - MRClientFactory.createConsumer(hostSet, "testTopic", "CG1", "22"); - assertTrue(true); + MRClientFactory.createConsumer(hostSet, "testTopic", "CG1", "22"); + assertTrue(true); - } + } - @Test - public void testCreateConsumer5() { + @Test + public void testCreateConsumer5() { - MRClientFactory.createConsumer(hostSet, "testTopic", "CG1", "22", 100, 100); - assertTrue(true); + MRClientFactory.createConsumer(hostSet, "testTopic", "CG1", "22", 100, 100); + assertTrue(true); - } + } - @Test - public void testCreateConsumer6() { + @Test + public void testCreateConsumer6() { - MRClientFactory.createConsumer("hostList", "testTopic", "CG1", "22", 100, 100, "filter", "apikey", "apisecret"); - assertTrue(true); + MRClientFactory.createConsumer("hostList", "testTopic", "CG1", "22", 100, 100, "filter", "apikey", "apisecret"); + assertTrue(true); - } + } - @Test - public void testCreateConsumer7() { + @Test + public void testCreateConsumer7() { - MRClientFactory.createConsumer(hostSet, "testTopic", "CG1", "22", 100, 100, "filter", "apikey", "apisecret"); - assertTrue(true); + MRClientFactory.createConsumer(hostSet, "testTopic", "CG1", "22", 100, 100, "filter", "apikey", "apisecret"); + assertTrue(true); - } + } - @Test - public void testCreateSimplePublisher() { + @Test + public void testCreateSimplePublisher() { - MRClientFactory.createSimplePublisher("hostList", "testTopic"); - assertTrue(true); + MRClientFactory.createSimplePublisher("hostList", "testTopic"); + assertTrue(true); - } + } - @Test - public void testCreateBatchingPublisher1() { + @Test + public void testCreateBatchingPublisher1() { - MRClientFactory.createBatchingPublisher("hostList", "testTopic", 100, 10); - assertTrue(true); + MRClientFactory.createBatchingPublisher("hostList", "testTopic", 100, 10); + assertTrue(true); - } + } - @Test - public void testCreateBatchingPublisher2() { + @Test + public void testCreateBatchingPublisher2() { - MRClientFactory.createBatchingPublisher("hostList", "testTopic", 100, 10, true); - assertTrue(true); + MRClientFactory.createBatchingPublisher("hostList", "testTopic", 100, 10, true); + assertTrue(true); - } + } - @Test - public void testCreateBatchingPublisher3() { + @Test + public void testCreateBatchingPublisher3() { - MRClientFactory.createBatchingPublisher(hostArray, "testTopic", 100, 10, true); - assertTrue(true); + MRClientFactory.createBatchingPublisher(hostArray, "testTopic", 100, 10, true); + assertTrue(true); - } + } - @Test - public void testCreateBatchingPublisher4() { + @Test + public void testCreateBatchingPublisher4() { - MRClientFactory.createBatchingPublisher(hostSet, "testTopic", 100, 10, true); - assertTrue(true); + MRClientFactory.createBatchingPublisher(hostSet, "testTopic", 100, 10, true); + assertTrue(true); - } + } - @Test - public void testCreateBatchingPublisher5() { + @Test + public void testCreateBatchingPublisher5() { - MRClientFactory.createBatchingPublisher("host", "testTopic", "username", "password", 100, 10, true, - "protocolFlag", "/producer"); - assertTrue(true); + MRClientFactory.createBatchingPublisher("host", "testTopic", "username", "password", 100, 10, true, + "protocolFlag"); + assertTrue(true); - } + } - @Test - public void testCreateBatchingPublisher6() { + @Test + public void testCreateBatchingPublisher6() { - try { - MRClientFactory.createBatchingPublisher("/producer"); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - assertTrue(true); + try { + MRClientFactory.createBatchingPublisher("/producer"); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + assertTrue(true); - } + } - @Test - public void testCreateBatchingPublisher7() { + @Test + public void testCreateBatchingPublisher7() { - try { - MRClientFactory.createBatchingPublisher("/producer", true); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - assertTrue(true); + try { + MRClientFactory.createBatchingPublisher("/producer", true); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + assertTrue(true); - } + } - @Test - public void testCreateIdentityManager() { + @Test + public void testCreateIdentityManager() { - MRClientFactory.createIdentityManager(hostSet, "apikey", "apisecret"); + MRClientFactory.createIdentityManager(hostSet, "apikey", "apisecret"); - assertTrue(true); + assertTrue(true); - } + } - @Test - public void testCreateTopicManager() { + @Test + public void testCreateTopicManager() { - MRClientFactory.createTopicManager(hostSet, "apikey", "apisecret"); + MRClientFactory.createTopicManager(hostSet, "apikey", "apisecret"); - assertTrue(true); + assertTrue(true); - } + } - @Test - public void testCreateConsumer8() { + @Test + public void testCreateConsumer8() { - try { - MRClientFactory.createConsumer("/consumer"); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + try { + MRClientFactory.createConsumer("/consumer"); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } - assertTrue(true); + assertTrue(true); - } + } - @Test - public void testCreateConsumer9() { + @Test + public void testCreateConsumer9() { - MRClientFactory.createConsumer("host", "topic", "username", "password", "group", "23", "protocolFlag", - "/consumer", 1, 2); + MRClientFactory.createConsumer("host", "topic", "username", "password", "group", "23", "protocolFlag", + "/consumer", 1, 2); - assertTrue(true); + assertTrue(true); - } + } - @Test - public void testCreateConsumer10() { + @Test + public void testCreateConsumer10() { - MRClientFactory.createConsumer("host", "topic", "username", "password", "group", "23", 1, 2, "protocolFlag", - "/consumer"); + MRClientFactory.createConsumer("host", "topic", "username", "password", "group", "23", 1, 2, "protocolFlag", + "/consumer"); - assertTrue(true); + assertTrue(true); - } - - @Test - public void test$testInject() { + } + + @Test + public void test$testInject() { - MRClientFactory.$testInject(null); - assertTrue(true); + MRClientFactory.$testInject(null); + assertTrue(true); - } + } } \ No newline at end of file -- cgit 1.2.3-korg