*/
package org.opendaylight.yangtools.yang.stmt;
-import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
import java.net.URI;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
public class CaseStmtTest {
+ private static final Optional<Boolean> OPT_FALSE = Optional.of(Boolean.FALSE);
+ private static final Optional<Boolean> OPT_TRUE = Optional.of(Boolean.TRUE);
+
private SchemaContext schema;
private Module rootFoo;
private Module rootBar;
public void caseTest() {
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-fff"));
assertNotNull(tempChild);
- assertFalse(tempChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-ffn"));
assertNotNull(tempChild);
- assertFalse(tempChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-fnf"));
assertNotNull(tempChild);
- assertFalse(tempChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-nff"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(Optional.empty(), tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-nnf"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(Optional.empty(), tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(Optional.empty(), tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-nfn"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(Optional.empty(), tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-fnn"));
assertNotNull(tempChild);
- assertFalse(tempChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-ttt"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertTrue(tempChoice.isConfiguration());
+ assertEquals(OPT_TRUE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertTrue(tempThirdChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-ttn"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertTrue(tempChoice.isConfiguration());
+ assertEquals(OPT_TRUE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertTrue(tempThirdChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-tnt"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertTrue(tempChoice.isConfiguration());
+ assertEquals(OPT_TRUE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertTrue(tempThirdChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-ntt"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(Optional.empty(), tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertTrue(tempChoice.isConfiguration());
+ assertEquals(OPT_TRUE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertTrue(tempThirdChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-nnt"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(Optional.empty(), tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(Optional.empty(), tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertTrue(tempChoice.isConfiguration());
+ assertEquals(OPT_TRUE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertTrue(tempThirdChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-ntn"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(Optional.empty(), tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertTrue(tempChoice.isConfiguration());
+ assertEquals(OPT_TRUE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertTrue(tempThirdChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-tnn"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertTrue(tempChoice.isConfiguration());
+ assertEquals(OPT_TRUE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertTrue(tempThirdChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-tff"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-tnf"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-tfn"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootFoo.getDataChildByName(QName.create(qnameFoo, "root-ntf"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(Optional.empty(), tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
}
@Test
public void shortCaseTest() {
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-fff"));
assertNotNull(tempChild);
- assertFalse(tempChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-ffn"));
assertNotNull(tempChild);
- assertFalse(tempChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-fnf"));
assertNotNull(tempChild);
- assertFalse(tempChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-nff"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(Optional.empty(), tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-nnf"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(Optional.empty(), tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(Optional.empty(), tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-nfn"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(Optional.empty(), tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-fnn"));
assertNotNull(tempChild);
- assertFalse(tempChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-ttt"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertTrue(tempChoice.isConfiguration());
+ assertEquals(OPT_TRUE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertTrue(tempThirdChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-ttn"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertTrue(tempChoice.isConfiguration());
+ assertEquals(OPT_TRUE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertTrue(tempThirdChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-tnt"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertTrue(tempChoice.isConfiguration());
+ assertEquals(OPT_TRUE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertTrue(tempThirdChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-ntt"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(Optional.empty(), tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertTrue(tempChoice.isConfiguration());
+ assertEquals(OPT_TRUE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertTrue(tempThirdChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-nnt"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(Optional.empty(), tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(Optional.empty(), tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertTrue(tempChoice.isConfiguration());
+ assertEquals(OPT_TRUE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertTrue(tempThirdChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-ntn"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(Optional.empty(), tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertTrue(tempChoice.isConfiguration());
+ assertEquals(OPT_TRUE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertTrue(tempThirdChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-tnn"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertTrue(tempChoice.isConfiguration());
+ assertEquals(OPT_TRUE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertTrue(tempThirdChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-tff"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-tnf"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-tfn"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertFalse(tempSecondChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
tempChild = rootBar.getDataChildByName(QName.create(qnameBar, "sh-root-ntf"));
assertNotNull(tempChild);
- assertTrue(tempChild.isConfiguration());
+ assertEquals(Optional.empty(), tempChild.effectiveConfig());
tempSecondChild = ((ContainerSchemaNode) tempChild).getChildNodes().iterator().next();
assertNotNull(tempSecondChild);
- assertTrue(tempSecondChild.isConfiguration());
+ assertEquals(OPT_TRUE, tempSecondChild.effectiveConfig());
tempChoice = ((ChoiceSchemaNode) tempSecondChild).getCases().iterator().next();
assertNotNull(tempChoice);
- assertFalse(tempChoice.isConfiguration());
+ assertEquals(OPT_FALSE, tempChoice.effectiveConfig());
tempThirdChild = tempChoice.getChildNodes().iterator().next();
assertNotNull(tempThirdChild);
- assertFalse(tempThirdChild.isConfiguration());
+ assertEquals(OPT_FALSE, tempThirdChild.effectiveConfig());
}
@Test