Checkstyle exception handling fix (Neutron-spi)
[neutron.git] / neutron-spi / src / test / java / org / opendaylight / neutron / spi / NeutronVPNLifetimeJAXBTest.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 NeutronVPNLifetimeJAXBTest {
16
17     private static final String NeutronVPNLifetimeTest_sourceJson = "{" + "\"units\": \"seconds\", "
18             + "\"value\": 3600 }";
19
20     @Test
21     public void test_NeutronVPNLifetime_JAXB() throws JAXBException {
22         NeutronVPNLifetime dummyObject = new NeutronVPNLifetime();
23
24         NeutronVPNLifetime testObject = (NeutronVPNLifetime) JaxbTestHelper.jaxbUnmarshall(dummyObject,
25                 NeutronVPNLifetimeTest_sourceJson);
26         Assert.assertEquals("NeutronVPNLifetime JAXB Test 1: Testing units failed", "seconds",
27                 testObject.getUnits());
28
29         Assert.assertEquals("NeutronVPNLifetime JAXB Test 2: Testing value failed", new Integer(3600),
30                 testObject.getValue());
31     }
32 }