import static org.junit.Assert.assertEquals;
-import java.io.IOException;
-import java.net.URISyntaxException;
import java.util.Collections;
import org.junit.BeforeClass;
import org.junit.Test;
import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
-import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
public class InstanceIdToNodesTest {
private final NodeWithValue<?> leafListWithValue = new NodeWithValue<>(
leafList.getNodeType(), "abcd");
- static SchemaContext createTestContext() throws URISyntaxException, ReactorException, IOException,
- YangSyntaxErrorException {
+ static SchemaContext createTestContext() {
return YangParserTestUtils.parseYangResources(InstanceIdToNodesTest.class, "/filter-test.yang");
}
@BeforeClass
- public static void setUp() throws Exception {
+ public static void setUp() {
ctx = createTestContext();
-
}
@Test
- public void testInAugment() throws Exception {
+ public void testInAugment() {
final LeafNode<?> leaf = Builders.leafBuilder().withNodeIdentifier(augmentedLeaf).withValue("").build();
final ContainerNode expectedFilter = Builders
.containerBuilder()
}
@Test
- public void testInAugmentLeafOverride() throws Exception {
+ public void testInAugmentLeafOverride() {
final LeafNode<Object> lastLeaf = Builders.leafBuilder().withNodeIdentifier(augmentedLeaf)
.withValue("randomValue").build();
}
@Test
- public void testListChoice() throws Exception {
+ public void testListChoice() {
final LeafNode<?> leaf = Builders.leafBuilder().withNodeIdentifier(leafFromCase).withValue("").build();
final ContainerNode expectedFilter = Builders
.containerBuilder()
}
@Test
- public void testTopContainerLastChildOverride() throws Exception {
+ public void testTopContainerLastChildOverride() {
final ContainerNode expectedStructure = Builders
.containerBuilder()
.withNodeIdentifier(rootContainer)
}
@Test
- public void testListLastChildOverride() throws Exception {
+ public void testListLastChildOverride() {
final MapEntryNode outerListEntry = Builders
.mapEntryBuilder()
.withNodeIdentifier(outerListWithKey)
}
@Test
- public void testLeafList() throws Exception {
+ public void testLeafList() {
final ContainerNode expectedFilter = Builders
.containerBuilder()
.withNodeIdentifier(rootContainer)