Generate code for action statements
[mdsal.git] / binding / mdsal-binding-generator-impl / src / test / java / org / opendaylight / mdsal / binding / generator / impl / AugmentRelativeXPathTest.java
index f0ba3c292108a4d660ad80ee36d05c2d21efb321..77d0fa4c5c0a25d6a22b7dbf4af92676105943e6 100644 (file)
@@ -11,19 +11,16 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-import java.io.IOException;
 import java.util.List;
 import org.junit.Test;
 import org.opendaylight.mdsal.binding.generator.api.BindingGenerator;
-import org.opendaylight.mdsal.binding.generator.impl.BindingGeneratorImpl;
 import org.opendaylight.mdsal.binding.model.api.GeneratedProperty;
 import org.opendaylight.mdsal.binding.model.api.GeneratedTransferObject;
 import org.opendaylight.mdsal.binding.model.api.GeneratedType;
 import org.opendaylight.mdsal.binding.model.api.MethodSignature;
 import org.opendaylight.mdsal.binding.model.api.Type;
+import org.opendaylight.yangtools.yang.binding.BindingMapping;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
-import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 
 public class AugmentRelativeXPathTest extends AbstractTypesTest {
@@ -33,12 +30,12 @@ public class AugmentRelativeXPathTest extends AbstractTypesTest {
     }
 
     @Test
-    public void AugmentationWithRelativeXPathTest() throws IOException, SourceException, ReactorException {
+    public void AugmentationWithRelativeXPathTest() {
 
         final SchemaContext context = YangParserTestUtils.parseYangFiles(testModels);
 
         assertNotNull("context is null", context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl(true);
+        final BindingGenerator bindingGen = new BindingGeneratorImpl();
         final List<Type> genTypes = bindingGen.generateTypes(context);
 
         assertNotNull("genTypes is null", genTypes);
@@ -69,7 +66,7 @@ public class AugmentRelativeXPathTest extends AbstractTypesTest {
         assertNotNull("Interface methods are null", gtInterfaceMethods);
         MethodSignature getIfcKeyMethod = null;
         for (final MethodSignature method : gtInterfaceMethods) {
-            if (method.getName().equals("getKey")) {
+            if (BindingMapping.IDENTIFIABLE_KEY_NAME.equals(method.getName())) {
                 getIfcKeyMethod = method;
                 break;
             }
@@ -101,7 +98,7 @@ public class AugmentRelativeXPathTest extends AbstractTypesTest {
         assertNotNull("Tunnel methods are null", tunnelMethods);
         MethodSignature getTunnelKeyMethod = null;
         for (MethodSignature method : tunnelMethods) {
-            if (method.getName().equals("getKey")) {
+            if (BindingMapping.IDENTIFIABLE_KEY_NAME.equals(method.getName())) {
                 getTunnelKeyMethod = method;
                 break;
             }