aboutsummaryrefslogtreecommitdiffstats
path: root/PolicyEngineAPI/src/test/java/org/onap
diff options
context:
space:
mode:
authorTej, Tarun <tt3868@att.com>2017-08-21 20:00:50 -0400
committerTarun Tej Velaga <tt3868@att.com>2017-08-23 17:29:35 +0000
commit80f072f60509ef3a35369a60857fe05f6c2a993a (patch)
tree7dca6266b225be3f192623fdc859ca80f4d1d493 /PolicyEngineAPI/src/test/java/org/onap
parentc53fa990ea27ec074859eb94bcb7ec6deaa2157b (diff)
Fixes for sonar critical issues
Fixes for critical and blocker issues reported in sonar. Issue-Id: POLICY-113 Change-Id: I50969fe93a94b0497f3fb30864a6c45e63208fe6 Signed-off-by: Tej, Tarun <tt3868@att.com>
Diffstat (limited to 'PolicyEngineAPI/src/test/java/org/onap')
-rw-r--r--PolicyEngineAPI/src/test/java/org/onap/policy/std/test/AutoClientUEBTest.java388
-rw-r--r--PolicyEngineAPI/src/test/java/org/onap/policy/test/ActionPolicyApiTest.java4
-rw-r--r--PolicyEngineAPI/src/test/java/org/onap/policy/test/ConfigBasePolicyTest.java4
-rw-r--r--PolicyEngineAPI/src/test/java/org/onap/policy/test/ConfigFirewallPolicyTest.java4
-rw-r--r--PolicyEngineAPI/src/test/java/org/onap/policy/test/DecisionPolicyApiTest.java4
-rw-r--r--PolicyEngineAPI/src/test/java/org/onap/policy/test/PolicyEngineInterfaceTest.java4
6 files changed, 13 insertions, 395 deletions
diff --git a/PolicyEngineAPI/src/test/java/org/onap/policy/std/test/AutoClientUEBTest.java b/PolicyEngineAPI/src/test/java/org/onap/policy/std/test/AutoClientUEBTest.java
index 94c2ac781..eef76bdd7 100644
--- a/PolicyEngineAPI/src/test/java/org/onap/policy/std/test/AutoClientUEBTest.java
+++ b/PolicyEngineAPI/src/test/java/org/onap/policy/std/test/AutoClientUEBTest.java
@@ -120,369 +120,6 @@ public class AutoClientUEBTest {
}
/**
- * Run the boolean isRunning() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testIsRunning_1()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(), "", "");
- fixture.isRunning = true;
-
- boolean result = fixture.isRunning();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- assertTrue(result);
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_1()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(), "", "");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_2()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(), "", "");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_3()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(), "", "");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_4()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(), "", "");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_5()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_6()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_7()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_8()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_9()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_10()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_11()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_12()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_13()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_14()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_15()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void run() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testRun_16()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
- fixture.isRunning = true;
-
- fixture.run();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
- * Run the void setAuto(NotificationScheme,NotificationHandler) method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testSetAuto_1()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
- fixture.isRunning = true;
- NotificationScheme scheme = NotificationScheme.AUTO_ALL_NOTIFICATIONS;
- NotificationHandler handler = null;
-
- fixture.setAuto(scheme, handler);
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
* Run the void setScheme(NotificationScheme) method test.
*
* @throws Exception
@@ -502,26 +139,6 @@ public class AutoClientUEBTest {
}
/**
- * Run the void terminate() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:40 PM
- */
- @Test
- public void testTerminate_1()
- throws Exception {
- AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
- fixture.isRunning = true;
-
- fixture.terminate();
-
- // add additional test code here
- // An unexpected exception was thrown in user code while executing this test:
- // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
- }
-
- /**
* Perform pre-test initialization.
*
* @throws Exception
@@ -535,9 +152,10 @@ public class AutoClientUEBTest {
// add set up code here
List<String> urlList = new LinkedList<String>();
urlList.add("test2.com");
- AutoClientUEB client = new AutoClientUEB("test.com", urlList, "testKey", "testSecret");
+ @SuppressWarnings("unused")
+ AutoClientUEB client = new AutoClientUEB("test.com", urlList, "testKey", "testSecret");
NotificationHandler handler = null;
- client.setAuto(NotificationScheme.AUTO_ALL_NOTIFICATIONS, handler);
+ AutoClientUEB.setAuto(NotificationScheme.AUTO_ALL_NOTIFICATIONS, handler);
}
/**
diff --git a/PolicyEngineAPI/src/test/java/org/onap/policy/test/ActionPolicyApiTest.java b/PolicyEngineAPI/src/test/java/org/onap/policy/test/ActionPolicyApiTest.java
index a66256432..ae971b405 100644
--- a/PolicyEngineAPI/src/test/java/org/onap/policy/test/ActionPolicyApiTest.java
+++ b/PolicyEngineAPI/src/test/java/org/onap/policy/test/ActionPolicyApiTest.java
@@ -51,7 +51,7 @@ public class ActionPolicyApiTest extends TestCase {
PolicyParameters policyParameters = new PolicyParameters();
@Before
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
try {
policyEngine = new PolicyEngine("Test/config_pass.properties");
} catch (PolicyEngineException e) {
@@ -80,7 +80,7 @@ public class ActionPolicyApiTest extends TestCase {
policyParameters.setRequestID(UUID.randomUUID());
}
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
super.tearDown();
}
diff --git a/PolicyEngineAPI/src/test/java/org/onap/policy/test/ConfigBasePolicyTest.java b/PolicyEngineAPI/src/test/java/org/onap/policy/test/ConfigBasePolicyTest.java
index 5d5a076ae..b5fb75c42 100644
--- a/PolicyEngineAPI/src/test/java/org/onap/policy/test/ConfigBasePolicyTest.java
+++ b/PolicyEngineAPI/src/test/java/org/onap/policy/test/ConfigBasePolicyTest.java
@@ -64,7 +64,7 @@ public class ConfigBasePolicyTest extends TestCase {
*
* @see TestCase#setUp()
*/
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
try {
policyEngine = new PolicyEngine("Test/config_pass.properties");
} catch (PolicyEngineException e) {
@@ -102,7 +102,7 @@ public class ConfigBasePolicyTest extends TestCase {
*
* @see TestCase#tearDown()
*/
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
super.tearDown();
// Add additional tear down code here
}
diff --git a/PolicyEngineAPI/src/test/java/org/onap/policy/test/ConfigFirewallPolicyTest.java b/PolicyEngineAPI/src/test/java/org/onap/policy/test/ConfigFirewallPolicyTest.java
index 78ae2493b..c50b3de47 100644
--- a/PolicyEngineAPI/src/test/java/org/onap/policy/test/ConfigFirewallPolicyTest.java
+++ b/PolicyEngineAPI/src/test/java/org/onap/policy/test/ConfigFirewallPolicyTest.java
@@ -59,7 +59,7 @@ public class ConfigFirewallPolicyTest extends TestCase {
*
* @see TestCase#setUp()
*/
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
try {
policyEngine = new PolicyEngine("Test/config_pass.properties");
} catch (PolicyEngineException e) {
@@ -101,7 +101,7 @@ public class ConfigFirewallPolicyTest extends TestCase {
*
* @see TestCase#tearDown()
*/
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
super.tearDown();
// Add additional tear down code here
}
diff --git a/PolicyEngineAPI/src/test/java/org/onap/policy/test/DecisionPolicyApiTest.java b/PolicyEngineAPI/src/test/java/org/onap/policy/test/DecisionPolicyApiTest.java
index a80093470..7c9eb3e10 100644
--- a/PolicyEngineAPI/src/test/java/org/onap/policy/test/DecisionPolicyApiTest.java
+++ b/PolicyEngineAPI/src/test/java/org/onap/policy/test/DecisionPolicyApiTest.java
@@ -63,7 +63,7 @@ public class DecisionPolicyApiTest extends TestCase {
*
* @see TestCase#setUp()
*/
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
try {
policyEngine = new PolicyEngine("Test/config_pass.properties");
} catch (PolicyEngineException e) {
@@ -106,7 +106,7 @@ public class DecisionPolicyApiTest extends TestCase {
*
* @see TestCase#tearDown()
*/
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
super.tearDown();
// Add additional tear down code here
}
diff --git a/PolicyEngineAPI/src/test/java/org/onap/policy/test/PolicyEngineInterfaceTest.java b/PolicyEngineAPI/src/test/java/org/onap/policy/test/PolicyEngineInterfaceTest.java
index be9e0e7e8..2adf3b0bf 100644
--- a/PolicyEngineAPI/src/test/java/org/onap/policy/test/PolicyEngineInterfaceTest.java
+++ b/PolicyEngineAPI/src/test/java/org/onap/policy/test/PolicyEngineInterfaceTest.java
@@ -104,7 +104,7 @@ public class PolicyEngineInterfaceTest extends TestCase {
*
* @see TestCase#setUp()
*/
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
try {
policyEngine = new PolicyEngine("Test/config_pass.properties");
} catch (PolicyEngineException e) {
@@ -126,7 +126,7 @@ public class PolicyEngineInterfaceTest extends TestCase {
*
* @see TestCase#tearDown()
*/
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
super.tearDown();
// Add additional tear down code here
}