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 NeutronNetworkSegmentJAXBTest {
17 private static final String NEUTRON_NETWORK_SEGMENT_SOURCE_JSON = "{ " + "\"provider:network_type\": \"vlan\", "
18 + "\"provider:physical_network\": \"physnet1\", " + "\"provider:segmentation_id\": \"1001\" }";
21 public void test_NeutronNetworkSegment_JAXB() throws JAXBException {
22 NeutronNetworkSegment segmentObject = new NeutronNetworkSegment();
24 NeutronNetworkSegment testObject = (NeutronNetworkSegment) JaxbTestHelper.jaxbUnmarshall(segmentObject,
25 NEUTRON_NETWORK_SEGMENT_SOURCE_JSON);
27 Assert.assertEquals("NeutronNetworkSegment JAXB Test 1: Testing provider:network_type failed", "vlan",
28 testObject.getProviderNetworkType());
30 Assert.assertEquals("NeutronNetworkSegment JAXB Test 2: Testing provider:physical_network failed",
31 "physnet1", testObject.getProviderPhysicalNetwork());
33 Assert.assertEquals("NeutronNetworkSegment JAXB Test 3: Testing provider:segmentation_id failed", "1001",
34 testObject.getProviderSegmentationID());