Checkstyle exception handling fix (Neutron-spi)
[neutron.git] / neutron-spi / src / test / java / org / opendaylight / neutron / spi / NeutronMeteringLabelRuleJAXBTest.java
index 0d0e7e7e4a98bb0f4d3ece3b8cb728f1aedd47b9..e792ae89708f26dbf6c9718ca47e86938bfa236f 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.neutron.spi;
 
+import javax.xml.bind.JAXBException;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -19,28 +20,24 @@ public class NeutronMeteringLabelRuleJAXBTest {
             + "\"id\": \"4e8e5957-649f-477b-9e5b-f1f75b21c03c\" }";
 
     @Test
-    public void test_NeutronMeteringLabelRule_JAXB() {
+    public void test_NeutronMeteringLabelRule_JAXB()  throws JAXBException {
         NeutronMeteringLabelRule meteringObject = new NeutronMeteringLabelRule();
-        try {
-            NeutronMeteringLabelRule testObject = (NeutronMeteringLabelRule) JaxbTestHelper
-                    .jaxbUnmarshall(meteringObject, NeutronMeteringLabelRule_sourceJson);
-            Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 1: Testing metering_label_id failed",
-                    "e131d186-b02d-4c0b-83d5-0c0725c4f812", testObject.getMeteringLabelRuleLabelID());
-
-            Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 2: Testing remote_ip_prefix failed", "10.0.0.0/24",
-                    testObject.getMeteringLabelRuleRemoteIPPrefix());
-
-            Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 3: Testing direction failed", "ingress",
-                    testObject.getMeteringLabelRuleDirection());
-
-            Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 4: Testing excluded failed", false,
-                    testObject.getMeteringLabelRuleExcluded());
-
-            Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 5: Testing id failed",
-                    "4e8e5957-649f-477b-9e5b-f1f75b21c03c", testObject.getID());
-        } catch (Exception e) {
-            Assert.fail("Test failed");
-        }
-    }
 
+        NeutronMeteringLabelRule testObject = (NeutronMeteringLabelRule) JaxbTestHelper
+                .jaxbUnmarshall(meteringObject, NeutronMeteringLabelRule_sourceJson);
+        Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 1: Testing metering_label_id failed",
+                "e131d186-b02d-4c0b-83d5-0c0725c4f812", testObject.getMeteringLabelRuleLabelID());
+
+        Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 2: Testing remote_ip_prefix failed", "10.0.0.0/24",
+                testObject.getMeteringLabelRuleRemoteIPPrefix());
+
+        Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 3: Testing direction failed", "ingress",
+                testObject.getMeteringLabelRuleDirection());
+
+        Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 4: Testing excluded failed", false,
+                testObject.getMeteringLabelRuleExcluded());
+
+        Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 5: Testing id failed",
+                "4e8e5957-649f-477b-9e5b-f1f75b21c03c", testObject.getID());
+    }
 }