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