tapaas: tapaas support
[neutron.git] / neutron-spi / src / test / java / org / opendaylight / neutron / spi / NeutronTapFlowJAXBTest.java
1 /*
2  * Copyright (C) 2017 Intel, Corp.
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 NeutronTapFlowJAXBTest {
16
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\" " + "}";
24
25     @Test
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());
32
33         Assert.assertEquals("NeutronTapFlow JAXB Test 2: Testing tenant_id failed",
34                 "aa902936679e4ea29bfe1158e3450a13", neutronObject.getTenantID());
35
36         Assert.assertEquals("NeutronTapFlow JAXB Test 3 : Testing name failed", "tap-flow-test",
37                 neutronObject.getName());
38
39         Assert.assertEquals("NeutronTapFlow JAXB Test 4 : Testing tap_service_id failed",
40                 "b6440bbb-35f3-48ab-8eae-69c60aef3546", neutronObject.getTapFlowServiceID());
41
42         Assert.assertEquals("NeutronTapFlow JAXB Test 5 : Testing source_port failed",
43                 "411d75c3-4da8-4267-8aed-6dbb19a3dcfe", neutronObject.getTapFlowSourcePort());
44
45         Assert.assertEquals("NeutronTapFlow JAXB Test 6: Testing direction failed",
46                 "BOTH", neutronObject.getTapFlowDirection());
47
48     }
49 }