From: Madhu Venugopal Date: Thu, 9 Jan 2014 08:09:29 +0000 (+0000) Subject: Merge "Unitests: remove conditions that are always true/false." X-Git-Tag: jenkins-controller-bulk-release-prepare-only-2-1~123 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=515e60d60ac7dd08aa2440468cd8dab42892e7d0;hp=56af902306c727ef1db5185c101b878b5cb386a7;p=controller.git Merge "Unitests: remove conditions that are always true/false." --- diff --git a/opendaylight/hosttracker/implementation/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerTest.java b/opendaylight/hosttracker/implementation/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerTest.java index d7c60e67a9..e222fcd7e4 100644 --- a/opendaylight/hosttracker/implementation/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerTest.java +++ b/opendaylight/hosttracker/implementation/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerTest.java @@ -25,7 +25,6 @@ public class HostTrackerTest extends TestCase { HostTracker hostTracker = null; hostTracker = new HostTracker(); - Assert.assertFalse(hostTracker == null); InetAddress hostIP = InetAddress.getByName("192.168.0.8"); IHostId id = IPHostId.fromIP(hostIP); @@ -44,7 +43,6 @@ public class HostTrackerTest extends TestCase { public void testHostTracker() throws UnknownHostException { HostTracker hostTracker = null; hostTracker = new HostTracker(); - Assert.assertFalse(hostTracker == null); InetAddress hostIP_1 = InetAddress.getByName("192.168.0.8"); IHostId id1 = IPHostId.fromIP(hostIP_1); diff --git a/opendaylight/northbound/commons/src/test/java/org/opendaylight/controller/northbound/commons/exception/CommonsNorthboundExceptionTest.java b/opendaylight/northbound/commons/src/test/java/org/opendaylight/controller/northbound/commons/exception/CommonsNorthboundExceptionTest.java index 65790ad17c..0a282b9b28 100644 --- a/opendaylight/northbound/commons/src/test/java/org/opendaylight/controller/northbound/commons/exception/CommonsNorthboundExceptionTest.java +++ b/opendaylight/northbound/commons/src/test/java/org/opendaylight/controller/northbound/commons/exception/CommonsNorthboundExceptionTest.java @@ -23,7 +23,6 @@ public class CommonsNorthboundExceptionTest extends TestCase { try { throw new InternalServerErrorException("Internal Server Exception"); } catch (InternalServerErrorException e) { - Assert.assertTrue(e instanceof InternalServerErrorException); Assert.assertTrue(e.getResponse().getEntity() .equals("Internal Server Exception")); } @@ -34,7 +33,6 @@ public class CommonsNorthboundExceptionTest extends TestCase { try { throw new MethodNotAllowedException("Method Not Allowed Exception"); } catch (MethodNotAllowedException e) { - Assert.assertTrue(e instanceof MethodNotAllowedException); Assert.assertTrue(e.getResponse().getEntity() .equals("Method Not Allowed Exception")); } @@ -45,7 +43,6 @@ public class CommonsNorthboundExceptionTest extends TestCase { try { throw new NotAcceptableException("Not Acceptable Exception"); } catch (NotAcceptableException e) { - Assert.assertTrue(e instanceof NotAcceptableException); Assert.assertTrue(e.getResponse().getEntity() .equals("Not Acceptable Exception")); } @@ -56,7 +53,6 @@ public class CommonsNorthboundExceptionTest extends TestCase { try { throw new ResourceConflictException("Resource Conflict Exception"); } catch (ResourceConflictException e) { - Assert.assertTrue(e instanceof ResourceConflictException); Assert.assertTrue(e.getResponse().getEntity() .equals("Resource Conflict Exception")); } @@ -67,7 +63,6 @@ public class CommonsNorthboundExceptionTest extends TestCase { try { throw new ResourceForbiddenException("Resource Forbidden Exception"); } catch (ResourceForbiddenException e) { - Assert.assertTrue(e instanceof ResourceForbiddenException); Assert.assertTrue(e.getResponse().getEntity() .equals("Resource Forbidden Exception")); } @@ -78,7 +73,6 @@ public class CommonsNorthboundExceptionTest extends TestCase { try { throw new ResourceGoneException("Resource Gone Exception"); } catch (ResourceGoneException e) { - Assert.assertTrue(e instanceof ResourceGoneException); Assert.assertTrue(e.getResponse().getEntity() .equals("Resource Gone Exception")); } @@ -89,7 +83,6 @@ public class CommonsNorthboundExceptionTest extends TestCase { try { throw new ResourceNotFoundException("Resource Not Found Exception"); } catch (ResourceNotFoundException e) { - Assert.assertTrue(e instanceof ResourceNotFoundException); Assert.assertTrue(e.getResponse().getEntity() .equals("Resource Not Found Exception")); } @@ -101,7 +94,6 @@ public class CommonsNorthboundExceptionTest extends TestCase { throw new ServiceUnavailableException( "Service Unavailable Exception"); } catch (ServiceUnavailableException e) { - Assert.assertTrue(e instanceof ServiceUnavailableException); Assert.assertTrue(e.getResponse().getEntity() .equals("Service Unavailable Exception")); } @@ -112,7 +104,6 @@ public class CommonsNorthboundExceptionTest extends TestCase { try { throw new UnauthorizedException("Unauthorized Exception"); } catch (UnauthorizedException e) { - Assert.assertTrue(e instanceof UnauthorizedException); Assert.assertTrue(e.getResponse().getEntity() .equals("Unauthorized Exception")); } @@ -124,7 +115,6 @@ public class CommonsNorthboundExceptionTest extends TestCase { throw new UnsupportedMediaTypeException( "Unsupported Media Type Exception"); } catch (UnsupportedMediaTypeException e) { - Assert.assertTrue(e instanceof UnsupportedMediaTypeException); Assert.assertTrue(e.getResponse().getEntity() .equals("Unsupported Media Type Exception")); } diff --git a/opendaylight/samples/loadbalancer/src/test/java/org/opendaylight/controller/samples/loadbalancer/internal/LoadBalancerTest.java b/opendaylight/samples/loadbalancer/src/test/java/org/opendaylight/controller/samples/loadbalancer/internal/LoadBalancerTest.java index 45d041c3e1..4fd3f4a32d 100644 --- a/opendaylight/samples/loadbalancer/src/test/java/org/opendaylight/controller/samples/loadbalancer/internal/LoadBalancerTest.java +++ b/opendaylight/samples/loadbalancer/src/test/java/org/opendaylight/controller/samples/loadbalancer/internal/LoadBalancerTest.java @@ -29,7 +29,6 @@ public class LoadBalancerTest extends TestCase { public void testRoundRobinPolicy() { ConfigManager cm = null; cm = new ConfigManager(); - Assert.assertFalse(cm== null); Pool pool = cm.createPool("TestPool","roundrobin"); VIP vip = cm.createVIP("TestVIP","10.0.0.9","TCP",(short)5550,"TestPool");