Code Review
/
yangtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Move NormalizedNode builders
[yangtools.git]
/
yang
/
yang-data-impl
/
src
/
test
/
java
/
org
/
opendaylight
/
yangtools
/
yang
/
data
/
impl
/
schema
/
tree
/
ErrorReportingTest.java
diff --git
a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ErrorReportingTest.java
b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ErrorReportingTest.java
index 2618589f1bd479412c8bd632e8e2d531d35bd64c..771cdfbf3af39d80d23bee91b642d1aeddac135c 100644
(file)
--- a/
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ErrorReportingTest.java
+++ b/
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ErrorReportingTest.java
@@
-13,26
+13,25
@@
import static org.junit.Assert.fail;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.yangtools.yang.data.api.schema.tree.ConflictingModificationAppliedException;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.yangtools.yang.data.api.schema.tree.ConflictingModificationAppliedException;
+import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeConfiguration;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeConfiguration;
+import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
import org.opendaylight.yangtools.yang.data.api.schema.tree.ModifiedNodeDoesNotExistException;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
import org.opendaylight.yangtools.yang.data.api.schema.tree.ModifiedNodeDoesNotExistException;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
-import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
-public class ErrorReportingTest {
+public class ErrorReportingTest
extends AbstractTestModelTest
{
- private
InMemory
DataTree tree;
+ private DataTree tree;
@Before
@Before
- public void setup() throws ReactorException {
- tree = (InMemoryDataTree) InMemoryDataTreeFactory.getInstance().create(
- DataTreeConfiguration.DEFAULT_OPERATIONAL);
- tree.setSchemaContext(TestModel.createTestContext());
+ public void setup() {
+ tree = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL, SCHEMA_CONTEXT);
}
@Test
public void writeWithoutParentExisting() {
}
@Test
public void writeWithoutParentExisting() {
-
InMemory
DataTreeModification modification = tree.takeSnapshot().newModification();
+ DataTreeModification modification = tree.takeSnapshot().newModification();
// We write node without creating parent
modification.write(TestModel.OUTER_LIST_PATH, ImmutableNodes.mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
.build());
// We write node without creating parent
modification.write(TestModel.OUTER_LIST_PATH, ImmutableNodes.mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
.build());
@@
-48,16
+47,16
@@
public class ErrorReportingTest {
}
@Test
}
@Test
- public void parentConcurrentlyDeletedExisting() {
-
InMemory
DataTreeModification initial = tree.takeSnapshot().newModification();
+ public void parentConcurrentlyDeletedExisting()
throws DataValidationFailedException
{
+ DataTreeModification initial = tree.takeSnapshot().newModification();
// We write node without creating parent
initial.write(TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
initial.ready();
// We commit transaction
tree.commit(tree.prepare(initial));
// We write node without creating parent
initial.write(TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
initial.ready();
// We commit transaction
tree.commit(tree.prepare(initial));
- final
InMemory
DataTreeModification writeTx = tree.takeSnapshot().newModification();
- final
InMemory
DataTreeModification deleteTx = tree.takeSnapshot().newModification();
+ final DataTreeModification writeTx = tree.takeSnapshot().newModification();
+ final DataTreeModification deleteTx = tree.takeSnapshot().newModification();
deleteTx.delete(TestModel.TEST_PATH);
deleteTx.ready();
// We commit delete modification
deleteTx.delete(TestModel.TEST_PATH);
deleteTx.ready();
// We commit delete modification