Change mapping of uint{8,16,32,64}
[mdsal.git] / binding / mdsal-binding-generator-impl / src / test / java / org / opendaylight / mdsal / binding / generator / impl / ChoiceCaseGenTypesTest.java
index 8129af65a792ce14f01e522f879f5a2b13168912..93a7e1dc5c74bce30715cbee097a26500d3df3cb 100644 (file)
@@ -13,17 +13,13 @@ import static org.junit.Assert.assertNotNull;
 import static org.opendaylight.mdsal.binding.generator.impl.SupportTestUtil.containsInterface;
 import static org.opendaylight.mdsal.binding.generator.impl.SupportTestUtil.containsMethods;
 
-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.GeneratedTransferObject;
 import org.opendaylight.mdsal.binding.model.api.GeneratedType;
 import org.opendaylight.mdsal.binding.model.api.Type;
 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 ChoiceCaseGenTypesTest extends AbstractTypesTest {
@@ -58,18 +54,19 @@ public class ChoiceCaseGenTypesTest extends AbstractTypesTest {
     }
 
     @Test
-    public void choiceCaseResolvingTypeTest() throws IOException, SourceException, ReactorException {
+    public void choiceCaseResolvingTypeTest() {
         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);
         assertFalse("genTypes is empty", genTypes.isEmpty());
 
         // test for file choice-monitoring
-        String pcgPref = "org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.choice.monitoring.rev130701.netconf.state.datastores.datastore.locks";
+        String pcgPref = "org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.choice.monitoring.rev130701."
+                + "netconf.state.datastores.datastore.locks";
         GeneratedType genType = null;
 
         checkGeneratedType(genTypes, "LockType", pcgPref); // choice
@@ -124,7 +121,7 @@ public class ChoiceCaseGenTypesTest extends AbstractTypesTest {
 
         genType = checkGeneratedType(genTypes, "AnonymousLock", pcgPref
                 + ".netconf.state.datastores.datastore.locks.lock.type"); // choice
-        containsMethods(genType, new NameTypePattern("getLockTime", "Long"));
+        containsMethods(genType, new NameTypePattern("getLockTime", "Uint32"));
         containsInterface("LockType", genType);
 
         genType = checkGeneratedType(genTypes, "LeafAugCase", pcgPref
@@ -157,20 +154,22 @@ public class ChoiceCaseGenTypesTest extends AbstractTypesTest {
         containsMethods(genType, new NameTypePattern("getStorageFormat", "StorageFormat"));
         containsInterface("Augmentation<Datastore>", genType);
 
-        genType = checkGeneratedType(genTypes, "StorageFormat", pcgPref + ".netconf.state.datastores.datastore"); // choice
+        // choice
+        genType = checkGeneratedType(genTypes, "StorageFormat", pcgPref + ".netconf.state.datastores.datastore");
 
         genType = checkGeneratedType(genTypes, "UnknownFiles", pcgPref
                 + ".netconf.state.datastores.datastore.storage.format"); // case
         containsMethods(genType, new NameTypePattern("getFiles", "List<Files>"));
         containsInterface("StorageFormat", genType);
 
-        genType = checkGeneratedType(genTypes, "Xml", pcgPref + ".netconf.state.datastores.datastore.storage.format"); // case
+        // case
+        genType = checkGeneratedType(genTypes, "Xml", pcgPref + ".netconf.state.datastores.datastore.storage.format");
         containsMethods(genType, new NameTypePattern("getXmlDef", "XmlDef"));
         containsInterface("StorageFormat", genType);
 
-        genType = checkGeneratedType(genTypes, "Yang", pcgPref + ".netconf.state.datastores.datastore.storage.format"); // case
+        // case
+        genType = checkGeneratedType(genTypes, "Yang", pcgPref + ".netconf.state.datastores.datastore.storage.format");
         containsMethods(genType, new NameTypePattern("getYangFileName", "String"));
         containsInterface("StorageFormat", genType);
-
     }
 }