Merge "Increase timeout for waiting for broker service in sal-binding-it."
[controller.git] / opendaylight / northbound / commons / src / test / java / org / opendaylight / controller / northbound / commons / exception / CommonsNorthboundExceptionTest.java
index 65790ad17ca1383b7e6ae387aa4666dfbd283d3b..8784950330ecc19c3681e405dd672466f68d43bd 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.controller.northbound.commons.exception;
 
 import javax.ws.rs.core.Response;
@@ -5,9 +12,7 @@ import javax.ws.rs.core.Response;
 import org.junit.Assert;
 import org.junit.Test;
 
-import junit.framework.TestCase;
-
-public class CommonsNorthboundExceptionTest extends TestCase {
+public class CommonsNorthboundExceptionTest {
 
     @Test
     public void testMethodNotAllowed() {
@@ -23,7 +28,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 +38,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 +48,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 +58,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 +68,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 +78,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 +88,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 +99,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 +109,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 +120,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"));
         }