2 * Copyright (c) 2015 Tata Consultancy Services. 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
9 package org.opendaylight.neutron.spi;
11 import javax.xml.bind.JAXBException;
12 import org.junit.Assert;
13 import org.junit.Test;
15 public class NeutronLoadBalancer_SessionPersistenceJAXBTest {
17 private static final String NEUTRON_LOAD_BALANCER_SESSION_PERSISTENCE_SOURCE_JSON = "{ "
18 + "\"cookie_name\": \"NeutronLoadBalancer_SessionPersistence_Cookie\", " + "\"type\": \"HTTP_COOKIE\" }";
21 public void test_NeutronLoadBalancer_SessionPersistence_JAXB() throws JAXBException {
22 NeutronLoadBalancer_SessionPersistence dummyObject = new NeutronLoadBalancer_SessionPersistence();
24 NeutronLoadBalancer_SessionPersistence testObject = (NeutronLoadBalancer_SessionPersistence) JaxbTestHelper
25 .jaxbUnmarshall(dummyObject, NEUTRON_LOAD_BALANCER_SESSION_PERSISTENCE_SOURCE_JSON);
26 Assert.assertEquals("NeutronLoadBalancer JAXB Test 1: Testing id failed",
27 "NeutronLoadBalancer_SessionPersistence_Cookie", testObject.getCookieName());
29 Assert.assertEquals("NeutronLoadBalancer JAXB Test 2: Testing LoadBalancer Name failed", "HTTP_COOKIE",
30 testObject.getType());