2 * Copyright (c) 2016 Brocade Communications Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.neutron.spi;
11 import javax.xml.bind.JAXBException;
12 import org.junit.Assert;
13 import org.junit.Test;
16 * Created by Anil Vishnoi (avishnoi@Brocade.com)
18 public class NeutronSFCPortPairJAXBTest {
20 private static final String NeutronSFCPortPair_sourceJson = "{ "
21 + "\"name\": \"portpair1\", "
22 + "\"ingress\": \"5e8e5957-649f-477b-9e5b-f1f75b21c03c\", "
23 + "\"egress\": \"6e8e5957-649f-477b-9e5b-f1f75b21c03c\", "
24 + "\"service_function_parameters\": [ "
26 + "\"correlation\": \"value\" "
29 + "\"tenant_id\": \"4969c491a3c74ee4af974e6d800c62de\", "
30 + "\"id\": \"4e8e5957-649f-477b-9e5b-f1f75b21c03c\" }";
33 public void test_NeutronSFCPortPair_JAXB() throws JAXBException {
34 NeutronSFCPortPair testObject = new NeutronSFCPortPair();
35 NeutronSFCPortPair neutronObject
36 = (NeutronSFCPortPair) JaxbTestHelper.jaxbUnmarshall(testObject
37 , NeutronSFCPortPair_sourceJson);
39 Assert.assertEquals("NeutronSFCPortPair JAXB Test 1: Testing id failed"
40 , "4e8e5957-649f-477b-9e5b-f1f75b21c03c",neutronObject.getID());
42 Assert.assertEquals("NeutronSFCPortPair JAXB Test 2: Testing tenant_id failed",
43 "4969c491a3c74ee4af974e6d800c62de", neutronObject.getTenantID());
45 Assert.assertEquals("NeutronSFCPortPair JAXB Test 3: Testing ingress failed",
46 "5e8e5957-649f-477b-9e5b-f1f75b21c03c", neutronObject.getIngressPortUUID());
48 Assert.assertEquals("NeutronSFCPortPair JAXB Test 4: Testing egress failed",
49 "6e8e5957-649f-477b-9e5b-f1f75b21c03c", neutronObject.getEgressPortUUID());
51 Map<String, String> param = neutronObject.getServiceFunctionParameters();
52 Assert.assertEquals("NeutronSFCPortPair JAXB Test 5: Testing service_function_parameters list length " +
53 "failed", 1, param.size());