Checkstyle exception handling fix (Neutron-spi)
[neutron.git] / neutron-spi / src / test / java / org / opendaylight / neutron / spi / NeutronMeteringLabelJAXBTest.java
1 /*
2  * Copyright (c) 2015 Tata Consultancy Services.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.neutron.spi;
10
11 import javax.xml.bind.JAXBException;
12 import org.junit.Assert;
13 import org.junit.Test;
14
15 public class NeutronMeteringLabelJAXBTest {
16
17     private static final String NeutronMeteringLabel_sourceJson = "{ "
18             + "\"id\": \"4e8e5957-649f-477b-9e5b-f1f75b21c03c\", " + "\"name\": \"net1\", "
19             + "\"description\": \"Provides allowed address pairs\", "
20             + "\"tenant_id\": \"9bacb3c5d39d41a79512987f338cf177\"}";
21
22     @Test
23     public void test_NeutronMeteringLabel_JAXB()  throws JAXBException {
24         NeutronMeteringLabel meteringObject = new NeutronMeteringLabel();
25
26         NeutronMeteringLabel testObject = (NeutronMeteringLabel) JaxbTestHelper.jaxbUnmarshall(meteringObject,
27                 NeutronMeteringLabel_sourceJson);
28         Assert.assertEquals("NeutronMeteringLabel JAXB Test 1: Testing id failed",
29                 "4e8e5957-649f-477b-9e5b-f1f75b21c03c", testObject.getID());
30
31         Assert.assertEquals("NeutronMeteringLabel JAXB Test 2: Testing name failed", "net1",
32                 testObject.getMeteringLabelName());
33
34         Assert.assertEquals("NeutronMeteringLabel JAXB Test 4: Testing tenant_id failed",
35                 "9bacb3c5d39d41a79512987f338cf177", testObject.getTenantID());
36     }
37 }