import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
+
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.impl.TestUtils;
import org.opendaylight.yangtools.yang.data.impl.schema.transform.dom.DomUtils;
import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
@Before
public void setUp() throws Exception {
- File leafRefTestYang = new File(getClass().getResource("/leafref-test.yang").toURI());
- schema = TestUtils.parseYangSources(leafRefTestYang);
+ final File leafRefTestYang = new File(getClass().getResource("/leafref-test.yang").toURI());
+ schema = YangParserTestUtils.parseYangSources(leafRefTestYang);
}
public static Document readXmlToDocument(final String xmlContent) throws SAXException, IOException {
final Element identityLeafRefElement = (Element) document.getDocumentElement().getFirstChild().getNextSibling();
final Module leafrefModule = schema.findModuleByNamespaceAndRevision(namespaceUri, null);
- final ContainerSchemaNode cont2 = (ContainerSchemaNode) leafrefModule.getDataChildByName(CONT_2);
- final DataSchemaNode identityLeafRefSchema = cont2.getDataChildByName(IDENTITY_LEAFREF);
+ final ContainerSchemaNode cont2 = (ContainerSchemaNode) leafrefModule.getDataChildByName(QName.create(
+ leafrefModule.getQNameModule(), CONT_2));
+ final DataSchemaNode identityLeafRefSchema = cont2.getDataChildByName(QName.create(
+ leafrefModule.getQNameModule(), IDENTITY_LEAFREF));
final Object parsedValue = DomUtils.parseXmlValue(identityLeafRefElement, DomUtils.defaultValueCodecProvider(),
identityLeafRefSchema, ((LeafSchemaNode) identityLeafRefSchema).getType(), schema);