694c807c1f8c4ad5ad0a518f69f1413c24fbe6d8
[mdsal.git] / yang / yang-binding / src / test / java / org / opendaylight / yangtools / yang / binding / util / BindingReflectionsTest.java
1 /*
2  * Copyright (c) 2014 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.yangtools.yang.binding.util;
9
10 import org.junit.Test;
11 import org.opendaylight.yangtools.yang.binding.DataObject;
12
13 import java.util.Collections;
14
15 import static org.junit.Assert.assertEquals;
16 import static org.junit.Assert.assertFalse;
17 import static org.junit.Assert.assertTrue;
18
19 public class BindingReflectionsTest {
20
21     @Test
22     public void testBindingWithDummyObject() {
23         assertEquals("Package name should be equal to string", "org.opendaylight.yang.gen.v1.test.rev990939",
24                 BindingReflections.getModelRootPackageName("org.opendaylight.yang.gen.v1.test.rev990939"));
25         assertEquals("ModuleInfoClassName should be equal to string", "test.$YangModuleInfoImpl",
26                 BindingReflections.getModuleInfoClassName("test"));
27         assertEquals("Module info should be empty Set", Collections.EMPTY_SET,
28                 BindingReflections.loadModuleInfos());
29         assertFalse("Should not be RpcType", BindingReflections.isRpcType(DataObject.class));
30         assertFalse("Should not be AugmentationChild", BindingReflections.isAugmentationChild(DataObject.class));
31         assertTrue("Should be BindingClass", BindingReflections.isBindingClass(DataObject.class));
32         assertFalse("Should not be Notification", BindingReflections.isNotification(DataObject.class));
33     }
34 }