2 * Copyright (C) 2017 Intel, Corp.
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 NeutronTapFlowJAXBTest {
17 private static final String NEUTRON_TAP_FLOW_SOURCE_JSON = "{"
18 + "\"id\": \"f6220bbb-35f3-48ab-8eae-69c60aef3546\","
19 + "\"tenant_id\": \"aa902936679e4ea29bfe1158e3450a13\","
20 + "\"name\": \"tap-flow-test\","
21 + "\"tap_service_id\": \"b6440bbb-35f3-48ab-8eae-69c60aef3546\","
22 + "\"source_port\": \"411d75c3-4da8-4267-8aed-6dbb19a3dcfe\","
23 + "\"direction\": \"BOTH\" " + "}";
26 public void test_NeutronTapFlow_JAXB() throws JAXBException {
27 NeutronTapFlow testObject = new NeutronTapFlow();
28 NeutronTapFlow neutronObject = (NeutronTapFlow) JaxbTestHelper.jaxbUnmarshall(testObject,
29 NEUTRON_TAP_FLOW_SOURCE_JSON);
30 Assert.assertEquals("NeutronTapFlow JAXB Test 1: Testing id failed", "f6220bbb-35f3-48ab-8eae-69c60aef3546",
31 neutronObject.getID());
33 Assert.assertEquals("NeutronTapFlow JAXB Test 2: Testing tenant_id failed",
34 "aa902936679e4ea29bfe1158e3450a13", neutronObject.getTenantID());
36 Assert.assertEquals("NeutronTapFlow JAXB Test 3 : Testing name failed", "tap-flow-test",
37 neutronObject.getName());
39 Assert.assertEquals("NeutronTapFlow JAXB Test 4 : Testing tap_service_id failed",
40 "b6440bbb-35f3-48ab-8eae-69c60aef3546", neutronObject.getTapFlowServiceID());
42 Assert.assertEquals("NeutronTapFlow JAXB Test 5 : Testing source_port failed",
43 "411d75c3-4da8-4267-8aed-6dbb19a3dcfe", neutronObject.getTapFlowSourcePort());
45 Assert.assertEquals("NeutronTapFlow JAXB Test 6: Testing direction failed",
46 "BOTH", neutronObject.getTapFlowDirection());