Migrate away from DataNodeIterator
[mdsal.git] / binding / mdsal-binding-generator-util / src / test / java / org / opendaylight / mdsal / binding / model / util / BindingGeneratorUtilTest.java
index ca8496ea64064b2793e35d60e3a3dc37bc7ea658..76240b31266d0f463ed52b20cf1208c2fcd2c0c1 100644 (file)
@@ -19,7 +19,6 @@ import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Range;
 import java.io.Serializable;
-import java.util.List;
 import java.util.Optional;
 import java.util.Set;
 import org.junit.Rule;
@@ -43,7 +42,7 @@ import org.opendaylight.yangtools.yang.model.api.type.DecimalTypeDefinition;
 import org.opendaylight.yangtools.yang.model.api.type.Int16TypeDefinition;
 import org.opendaylight.yangtools.yang.model.api.type.Uint16TypeDefinition;
 import org.opendaylight.yangtools.yang.model.util.BaseConstraints;
-import org.opendaylight.yangtools.yang.model.util.DataNodeIterator;
+import org.opendaylight.yangtools.yang.model.util.SchemaNodeUtils;
 import org.opendaylight.yangtools.yang.model.util.type.BaseTypes;
 import org.opendaylight.yangtools.yang.model.util.type.DerivedTypes;
 import org.opendaylight.yangtools.yang.model.util.type.InvalidLengthConstraintException;
@@ -52,7 +51,7 @@ import org.opendaylight.yangtools.yang.model.util.type.StringTypeBuilder;
 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 
 public class BindingGeneratorUtilTest {
-    private static final SchemaPath ROOT_PATH = SchemaPath.create(true, QName.create("test", "/root"));
+    private static final SchemaPath ROOT_PATH = SchemaPath.create(true, QName.create("test", "root"));
 
     @Rule
     public ExpectedException expectedEx = ExpectedException.none();
@@ -86,10 +85,8 @@ public class BindingGeneratorUtilTest {
                 "org.opendaylight.yang.gen.v1.urn.m.o.d.u.l.e.n.a.m.e.t.e.s.t._case._1digit.rev130910", packageName);
 
         // test of the method packageNameForGeneratedType()
-        DataNodeIterator it = new DataNodeIterator(module);
-        List<ContainerSchemaNode> schemaContainers = it.allContainers();
         String subPackageNameForDataNode = "";
-        for (ContainerSchemaNode containerSchemaNode : schemaContainers) {
+        for (ContainerSchemaNode containerSchemaNode : SchemaNodeUtils.getAllContainers(module)) {
             if (containerSchemaNode.getQName().getLocalName().equals("cont-inner")) {
                 subPackageNameForDataNode = BindingGeneratorUtil.packageNameForGeneratedType(packageName,
                         containerSchemaNode.getPath());