Bump upstream versions
[neutron.git] / neutron-spi / src / test / java / org / opendaylight / neutron / spi / NeutronMeteringLabelRuleJAXBTest.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 javax.xml.bind.JAXBException;
12 import org.junit.Assert;
13 import org.junit.Test;
14
15 public class NeutronMeteringLabelRuleJAXBTest {
16
17     private static final String NEUTRON_METERING_LABEL_RULE_SOURCE_JSON = "{ "
18             + "\"metering_label_id\": \"e131d186-b02d-4c0b-83d5-0c0725c4f812\", "
19             + "\"remote_ip_prefix\": \"10.0.0.0/24\", " + "\"direction\": \"ingress\", " + "\"excluded\": false , "
20             + "\"id\": \"4e8e5957-649f-477b-9e5b-f1f75b21c03c\" }";
21
22     @Test
23     public void test_NeutronMeteringLabelRule_JAXB()  throws JAXBException {
24         NeutronMeteringLabelRule testObject = JaxbTestHelper
25                 .jaxbUnmarshall(NeutronMeteringLabelRule.class, NEUTRON_METERING_LABEL_RULE_SOURCE_JSON);
26         Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 1: Testing metering_label_id failed",
27                 "e131d186-b02d-4c0b-83d5-0c0725c4f812", testObject.getMeteringLabelRuleLabelID());
28
29         Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 2: Testing remote_ip_prefix failed", "10.0.0.0/24",
30                 testObject.getMeteringLabelRuleRemoteIpPrefix());
31
32         Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 3: Testing direction failed", "ingress",
33                 testObject.getMeteringLabelRuleDirection());
34
35         Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 4: Testing excluded failed", false,
36                 testObject.getMeteringLabelRuleExcluded());
37
38         Assert.assertEquals("NeutronMeteringLabelRule JAXB Test 5: Testing id failed",
39                 "4e8e5957-649f-477b-9e5b-f1f75b21c03c", testObject.getID());
40     }
41 }