5539748633cb2e838160a99ff30e6315899b60b2
[neutron.git] / neutron-spi / src / test / java / org / opendaylight / neutron / spi / NeutronPort_AllowedAddressPairsJAXBTest.java
1 /*
2  * Copyright Tata Consultancy Services, 2015.  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 org.junit.Assert;
12 import org.junit.Test;
13 import org.opendaylight.neutron.spi.JaxbTestHelper;
14 import org.opendaylight.neutron.spi.NeutronPort_AllowedAddressPairs;
15
16 public class NeutronPort_AllowedAddressPairsJAXBTest {
17
18     private static final String NeutronPort_AllowedAddressPairs_sourceJson = "{ "
19             + "\"ip_address\": \"192.168.199.1\", " + "\"port_id\": \"65c0ee9f-d634-4522-8954-51021b570b0d\", "
20             + "\"mac_address\": \"fa:16:3e:c9:cb:f0\" }";
21
22     @Test
23     public void test_NeutronPort_AllowedAddressPairs_JAXB() {
24         NeutronPort_AllowedAddressPairs portObject = new NeutronPort_AllowedAddressPairs();
25         try {
26             NeutronPort_AllowedAddressPairs testObject = (NeutronPort_AllowedAddressPairs) JaxbTestHelper
27                     .jaxbUnmarshall(portObject, NeutronPort_AllowedAddressPairs_sourceJson);
28             Assert.assertEquals("NeutronPort Allowed Address Pairs JAXB Test 1: Testing ip_address failed",
29                     "192.168.199.1", testObject.getIpAddress());
30
31             Assert.assertEquals("NeutronPort Allowed Address Pairs JAXB Test 2: Testing port_id failed",
32                     "65c0ee9f-d634-4522-8954-51021b570b0d", testObject.getPortID());
33
34             Assert.assertEquals("NeutronPort Allowed Address Pairs JAXB Test 10: Testing mac_address failed",
35                     "fa:16:3e:c9:cb:f0", testObject.getMacAddress());
36
37         } catch (Exception e) {
38             Assert.assertFalse("Tests Failed", true);
39         }
40     }
41
42 }