2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
3 * This program and the accompanying materials are made available under the
4 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
5 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.sal.connector.remoterpc;
12 import com.fasterxml.jackson.core.JsonParseException;
13 import org.junit.Assert;
14 import org.junit.Test;
15 import org.opendaylight.controller.sal.connector.api.RpcRouter;
16 import org.opendaylight.controller.sal.connector.remoterpc.dto.RouteIdentifierImpl;
17 import org.opendaylight.yangtools.yang.common.QName;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
21 public class RouteIdentifierImplTest {
23 Logger _logger = LoggerFactory.getLogger(RouteIdentifierImplTest.class);
25 private final URI namespace = URI.create("http://cisco.com/example");
26 private final QName QNAME = new QName(namespace, "heartbeat");
29 public void testToString() throws Exception {
30 RouteIdentifierImpl rId = new RouteIdentifierImpl();
33 _logger.debug(rId.toString());
35 Assert.assertTrue(true);
40 public void testFromString() throws Exception {
41 RouteIdentifierImpl rId = new RouteIdentifierImpl();
44 String s = rId.toString();
45 _logger.debug("serialized route: {}", s);
47 RpcRouter.RouteIdentifier ref = new RouteIdentifierImpl().fromString(s);
48 _logger.debug("deserialized route: {}", ref);
50 Assert.assertTrue(true);
53 @Test(expected = JsonParseException.class)
54 public void testFromInvalidString() throws Exception {
55 String invalidInput = "aklhdgadfa;;;;;;;]]]]=]ag" ;
56 RouteIdentifierImpl rId = new RouteIdentifierImpl();
57 rId.fromString(invalidInput);
59 _logger.debug("" + rId);
60 Assert.assertTrue(true);