<extensions>true</extensions>
<configuration>
<instructions>
- <Automatic-Module-Name>org.opendaylight.yangtools.yang.data.impl</Automatic-Module-Name>
<!-- FIXME: do not export data.impl -->
+ <!-- FIXME: use OSGi annotations when we have R7 -->
<Export-Package>
{local-packages},
org.opendaylight.yangtools.yang.data.impl.*,
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
+ <scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>osgi.cmpn</artifactId>
+ <artifactId>org.osgi.service.component.annotations</artifactId>
</dependency>
<dependency>
--- /dev/null
+/*
+ * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeFactory;
+import org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeFactory;
+
+module org.opendaylight.yangtools.yang.data.impl {
+ // FIXME: do not export data.impl.*
+ exports org.opendaylight.yangtools.yang.data.impl.codec;
+ exports org.opendaylight.yangtools.yang.data.impl.leafref;
+ exports org.opendaylight.yangtools.yang.data.impl.schema;
+ exports org.opendaylight.yangtools.yang.data.impl.schema.builder.api;
+ exports org.opendaylight.yangtools.yang.data.impl.schema.builder.impl;
+ exports org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.valid;
+ exports org.opendaylight.yangtools.yang.data.impl.schema.nodes;
+ exports org.opendaylight.yangtools.yang.data.impl.schema.tree;
+
+ provides DataTreeFactory with InMemoryDataTreeFactory;
+
+ requires transitive org.opendaylight.yangtools.yang.data.api;
+ requires transitive org.opendaylight.yangtools.rfc7952.data.api;
+ requires org.opendaylight.yangtools.util;
+ requires org.opendaylight.yangtools.rfc7952.data.util;
+ requires org.opendaylight.yangtools.rfc8528.data.util;
+ requires org.opendaylight.yangtools.yang.model.util;
+ requires org.slf4j;
+
+ // Annotations
+ requires static transitive org.eclipse.jdt.annotation;
+ requires static org.osgi.service.component.annotations;
+ requires static javax.inject;
+ requires static metainf.services;
+}
import static com.google.common.base.Preconditions.checkArgument;
import java.util.Optional;
+import javax.inject.Inject;
import javax.inject.Singleton;
import org.eclipse.jdt.annotation.NonNull;
import org.kohsuke.MetaInfServices;
private static final @NonNull NormalizedNode<?, ?> ROOT_CONTAINER =
ImmutableNodes.containerNode(SchemaContext.NAME);
+ @Inject
+ public InMemoryDataTreeFactory() {
+ // Exposed for DI
+ }
+
@Override
public DataTree create(final DataTreeConfiguration treeConfig) {
return new InMemoryDataTree(TreeNodeFactory.createTreeNode(createRoot(treeConfig.getRootPath()),
}
private static void testPresenceContainer() throws DataValidationFailedException {
- final EffectiveModelContext schemaContext = TestModel.createTestContext("/bug5830/foo-presence.yang");
+ final EffectiveModelContext schemaContext = TestModel.createTestContext("/bug-5830/foo-presence.yang");
assertNotNull("Schema context must not be null.", schemaContext);
testContainerIsNotPresent(schemaContext);
}
private static void testNonPresenceContainer() throws DataValidationFailedException {
- final EffectiveModelContext schemaContext = TestModel.createTestContext("/bug5830/foo-non-presence.yang");
+ final EffectiveModelContext schemaContext = TestModel.createTestContext("/bug-5830/foo-non-presence.yang");
assertNotNull("Schema context must not be null.", schemaContext);
try {
}
private static void testMultipleContainers() throws DataValidationFailedException {
- final EffectiveModelContext schemaContext = TestModel.createTestContext("/bug5830/foo-multiple.yang");
+ final EffectiveModelContext schemaContext = TestModel.createTestContext("/bug-5830/foo-multiple.yang");
assertNotNull("Schema context must not be null.", schemaContext);
testContainerIsNotPresent(schemaContext);
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
public class Bug5968MergeTest {
- private static final String NS = "foo";
+ private static final String NS = "bug5968";
private static final String REV = "2016-07-28";
private static final QName ROOT = QName.create(NS, REV, "root");
private static final QName MY_LIST = QName.create(NS, REV, "my-list");
@BeforeClass
public static void beforeClass() {
- SCHEMA_CONTEXT = TestModel.createTestContext("/bug5968/foo.yang");
+ SCHEMA_CONTEXT = TestModel.createTestContext("/bug5968.yang");
}
@AfterClass
inMemoryDataTree.commit(prepare);
fail("Should fail due to missing mandatory leaf.");
} catch (final IllegalArgumentException e) {
- assertEquals(
- "Node (foo?revision=2016-07-28)my-list[{(foo?revision=2016-07-28)list-id=1}] is missing mandatory "
- + "descendant /(foo?revision=2016-07-28)mandatory-leaf", e.getMessage());
+ assertEquals("Node (bug5968?revision=2016-07-28)my-list[{(bug5968?revision=2016-07-28)list-id=1}] is "
+ + "missing mandatory descendant /(bug5968?revision=2016-07-28)mandatory-leaf", e.getMessage());
}
}
inMemoryDataTree.commit(prepare);
fail("Should fail due to missing mandatory leaf.");
} catch (final IllegalArgumentException e) {
- assertEquals(
- "Node (foo?revision=2016-07-28)my-list[{(foo?revision=2016-07-28)list-id=1}] is missing mandatory "
- + "descendant /(foo?revision=2016-07-28)mandatory-leaf", e.getMessage());
+ assertEquals("Node (bug5968?revision=2016-07-28)my-list[{(bug5968?revision=2016-07-28)list-id=1}] is "
+ + "missing mandatory descendant /(bug5968?revision=2016-07-28)mandatory-leaf", e.getMessage());
}
}
inMemoryDataTree.commit(prepare);
fail("Should fail due to missing mandatory leaf.");
} catch (final IllegalArgumentException e) {
- assertEquals(
- "Node (foo?revision=2016-07-28)my-list[{(foo?revision=2016-07-28)list-id=1}] is missing mandatory "
- + "descendant /(foo?revision=2016-07-28)mandatory-leaf", e.getMessage());
+ assertEquals("Node (bug5968?revision=2016-07-28)my-list[{(bug5968?revision=2016-07-28)list-id=1}] is "
+ + "missing mandatory descendant /(bug5968?revision=2016-07-28)mandatory-leaf", e.getMessage());
}
}
inMemoryDataTree.commit(prepare);
fail("Should fail due to missing mandatory leaf.");
} catch (final IllegalArgumentException e) {
- assertEquals(
- "Node (foo?revision=2016-07-28)my-list[{(foo?revision=2016-07-28)list-id=1}] is missing mandatory "
- + "descendant /(foo?revision=2016-07-28)mandatory-leaf", e.getMessage());
+ assertEquals("Node (bug5968?revision=2016-07-28)my-list[{(bug5968?revision=2016-07-28)list-id=1}] is "
+ + "missing mandatory descendant /(bug5968?revision=2016-07-28)mandatory-leaf", e.getMessage());
}
}
inMemoryDataTree.commit(prepare);
fail("Should fail due to missing mandatory leaf.");
} catch (final IllegalArgumentException e) {
- assertEquals(
- "Node (foo?revision=2016-07-28)my-list[{(foo?revision=2016-07-28)list-id=1}] is missing mandatory "
- + "descendant /(foo?revision=2016-07-28)mandatory-leaf", e.getMessage());
+ assertEquals("Node (bug5968?revision=2016-07-28)my-list[{(bug5968?revision=2016-07-28)list-id=1}] is "
+ + "missing mandatory descendant /(bug5968?revision=2016-07-28)mandatory-leaf", e.getMessage());
}
}
inMemoryDataTree.commit(prepare2);
fail("Should fail due to missing mandatory leaf.");
} catch (final IllegalArgumentException e) {
- assertEquals(
- "Node (foo?revision=2016-07-28)my-list[{(foo?revision=2016-07-28)list-id=2}] is missing mandatory "
- + "descendant /(foo?revision=2016-07-28)mandatory-leaf", e.getMessage());
+ assertEquals("Node (bug5968?revision=2016-07-28)my-list[{(bug5968?revision=2016-07-28)list-id=2}] is "
+ + "missing mandatory descendant /(bug5968?revision=2016-07-28)mandatory-leaf", e.getMessage());
}
}
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
public class Bug5968Test {
- private static final String NS = "foo";
+ private static final String NS = "bug5968";
private static final String REV = "2016-07-28";
private static final QName ROOT = QName.create(NS, REV, "root");
private static final QName MY_LIST = QName.create(NS, REV, "my-list");
@BeforeClass
public static void beforeClass() {
- SCHEMA_CONTEXT = TestModel.createTestContext("/bug5968/foo.yang");
+ SCHEMA_CONTEXT = TestModel.createTestContext("/bug5968.yang");
}
@AfterClass
inMemoryDataTree.commit(prepare);
fail("Should fail due to missing mandatory leaf.");
} catch (final IllegalArgumentException e) {
- assertEquals(
- "Node (foo?revision=2016-07-28)my-list[{(foo?revision=2016-07-28)list-id=1}] is missing mandatory "
- + "descendant /(foo?revision=2016-07-28)mandatory-leaf", e.getMessage());
+ assertEquals("Node (bug5968?revision=2016-07-28)my-list[{(bug5968?revision=2016-07-28)list-id=1}] is "
+ + "missing mandatory descendant /(bug5968?revision=2016-07-28)mandatory-leaf", e.getMessage());
}
}
inMemoryDataTree.commit(prepare);
fail("Should fail due to missing mandatory leaf.");
} catch (final IllegalArgumentException e) {
- assertEquals(
- "Node (foo?revision=2016-07-28)my-list[{(foo?revision=2016-07-28)list-id=1}] is missing mandatory "
- + "descendant /(foo?revision=2016-07-28)mandatory-leaf", e.getMessage());
+ assertEquals("Node (bug5968?revision=2016-07-28)my-list[{(bug5968?revision=2016-07-28)list-id=1}] is "
+ + "missing mandatory descendant /(bug5968?revision=2016-07-28)mandatory-leaf", e.getMessage());
}
}
inMemoryDataTree.commit(prepare);
fail("Should fail due to missing mandatory leaf.");
} catch (final IllegalArgumentException e) {
- assertEquals(
- "Node (foo?revision=2016-07-28)my-list[{(foo?revision=2016-07-28)list-id=1}] is missing mandatory "
- + "descendant /(foo?revision=2016-07-28)mandatory-leaf", e.getMessage());
+ assertEquals("Node (bug5968?revision=2016-07-28)my-list[{(bug5968?revision=2016-07-28)list-id=1}] is "
+ + "missing mandatory descendant /(bug5968?revision=2016-07-28)mandatory-leaf", e.getMessage());
}
}
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
public class Bug8291Test {
- private static final String NS = "foo";
+ private static final String NS = "bug8291";
private static final QName ROOT = QName.create(NS, "root");
private static final QName OUTER_LIST = QName.create(NS, "outer-list");
private static final QName OUTER_LIST_ID = QName.create(NS, "id");
@Before
public void init() {
- this.schemaContext = TestModel.createTestContext("/bug8291/foo.yang");
+ this.schemaContext = TestModel.createTestContext("/bug8291.yang");
assertNotNull("Schema context must not be null.", this.schemaContext);
}
@BeforeClass
public static void beforeClass() {
- SCHEMA_CONTEXT = TestModel.createTestContext("/yt776/yt776.yang");
+ SCHEMA_CONTEXT = TestModel.createTestContext("/yt776.yang");
}
@AfterClass
-module foo {
+module bug5968 {
yang-version 1;
- namespace "foo";
- prefix foo;
+ namespace bug5968;
+ prefix bug5968;
revision 2016-07-28 {
description "test";
-module odl-datastore-test {
+module bug8291 {
yang-version 1;
- namespace "foo";
- prefix foo;
+ namespace bug8291;
+ prefix bug8291;
container root {
list outer-list {
}
}
}
-}
\ No newline at end of file
+}