X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fnorthbound%2Fcommons%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnorthbound%2Fcommons%2Fexception%2FCommonsNorthboundExceptionTest.java;h=8784950330ecc19c3681e405dd672466f68d43bd;hb=6fd408a04fe4a3611843e2246ece6d7c34b76903;hp=65790ad17ca1383b7e6ae387aa4666dfbd283d3b;hpb=6d0b0caf96f0a6993ffd09e9827e44f493ded186;p=controller.git 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..8784950330 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 @@ -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")); }