2 * Copyright (c) 2015 Tata Consultancy Services. All rights reserved.
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
9 package org.opendaylight.neutron.spi;
11 import javax.xml.bind.JAXBException;
12 import org.junit.Assert;
13 import org.junit.Test;
15 public class NeutronRouterInterfaceJAXBTest {
16 private static final String NEUTRON_ROUTER_INTERFACE_SOURCE_JSON = "{"
17 + "\"subnet_id\": \"3b80198d-4f7b-4f77-9ef5-774d54e17126\", "
18 + "\"port_id\": \"65c0ee9f-d634-4522-8954-51021b570b0d\", "
19 + "\"id\": \"7370da7f-234e-3f7a-ed12-e384131d886d\" }";
22 public void test_NeutronRouterInterface_JAXB() throws JAXBException {
23 NeutronRouterInterface dummyObject = new NeutronRouterInterface();
25 NeutronRouterInterface testObject = (NeutronRouterInterface) JaxbTestHelper.jaxbUnmarshall(dummyObject,
26 NEUTRON_ROUTER_INTERFACE_SOURCE_JSON);
28 Assert.assertEquals("NeutronRouterInterface JAXB Test 1: Testing subnet_id failed",
29 "3b80198d-4f7b-4f77-9ef5-774d54e17126", testObject.getSubnetUUID());
31 Assert.assertEquals("NeutronRouterInterface JAXB Test 2: Testing port_id failed",
32 "65c0ee9f-d634-4522-8954-51021b570b0d", testObject.portUUID);
34 Assert.assertEquals("NeutronRouterInterface JAXB Test 3: Testing id failed",
35 "7370da7f-234e-3f7a-ed12-e384131d886d", testObject.getID());