edca88fb831f7b4717680dcd7a68777f02adc0d5
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / test / java / org / opendaylight / mdsal / binding / dom / adapter / invoke / ClassBasedRpcServiceInvokerTest.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  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 package org.opendaylight.mdsal.binding.dom.adapter.invoke;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNotNull;
12
13 import com.google.common.collect.ImmutableMap;
14 import org.junit.Test;
15 import org.opendaylight.yangtools.yang.binding.DataContainer;
16 import org.opendaylight.yangtools.yang.binding.RpcService;
17 import org.opendaylight.yangtools.yang.common.QName;
18
19 public class ClassBasedRpcServiceInvokerTest {
20
21     @Test
22     public void qnameToKeyTest() throws Exception {
23         final ClassBasedRpcServiceInvoker classBasedRpcServiceInvoker =
24                 new ClassBasedRpcServiceInvoker(ImmutableMap.of());
25         assertNotNull(classBasedRpcServiceInvoker);
26         assertNotNull(ClassBasedRpcServiceInvoker.instanceFor(TestInterface.class));
27         assertEquals("localName", classBasedRpcServiceInvoker.qnameToKey(QName.create("testNamespace", "localName")));
28     }
29
30     interface TestInterface extends DataContainer, RpcService {}
31 }