2 * Copyright (c) 2014 Cisco 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.yangtools.yang.binding.util;
10 import org.junit.Test;
11 import org.opendaylight.yangtools.yang.binding.DataObject;
13 import java.util.Collections;
15 import static org.junit.Assert.assertEquals;
16 import static org.junit.Assert.assertFalse;
17 import static org.junit.Assert.assertTrue;
19 public class BindingReflectionsTest {
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));