import java.io.Writer;
import java.net.URI;
import java.net.URISyntaxException;
+import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.opendaylight.yangtools.yang.common.QName;
public class Bug5446Test {
- private static QNameModule fooModuleQName;
- private static QName rootQName;
- private static QName ipAddressQName;
+ private static final QNameModule FOO_MODULE = QNameModule.create(URI.create("foo"), Revision.of("2015-11-05"));
+ private static final QName ROOT_QNAME = QName.create(FOO_MODULE, "root");
+ private static final QName IP_ADDRESS_QNAME = QName.create(FOO_MODULE, "ip-address");
private static SchemaContext schemaContext;
@BeforeClass
public static void init() {
- fooModuleQName = QNameModule.create(URI.create("foo"), Revision.of("2015-11-05"));
- rootQName = QName.create(fooModuleQName, "root");
- ipAddressQName = QName.create(fooModuleQName, "ip-address");
-
schemaContext = YangParserTestUtils.parseYangResources(Bug5446Test.class, "/bug5446/yang/foo.yang");
}
+ @AfterClass
+ public static void cleanup() {
+ schemaContext = null;
+ }
+
@Test
public void test() throws IOException, JsonIOException, JsonSyntaxException, URISyntaxException {
final DataContainerChild<? extends PathArgument, ?> rootNode = createRootNode();
}
private static ContainerNode createRootNode() {
- LeafNode<byte[]> ipAddress = ImmutableNodes.leafNode(ipAddressQName, BaseEncoding.base64().decode("fwAAAQ=="));
- return ImmutableContainerNodeBuilder.create().withNodeIdentifier(new NodeIdentifier(rootQName))
+ LeafNode<byte[]> ipAddress = ImmutableNodes.leafNode(IP_ADDRESS_QNAME,
+ BaseEncoding.base64().decode("fwAAAQ=="));
+ return ImmutableContainerNodeBuilder.create().withNodeIdentifier(new NodeIdentifier(ROOT_QNAME))
.withChild(ipAddress).build();
}
}