Search in sources :

Example 16 with LeafEffectiveStatement

use of org.opendaylight.yangtools.yang.model.api.stmt.LeafEffectiveStatement in project yangtools by opendaylight.

the class EffectiveStatementTypeTest method testEmpty.

@Test
public void testEmpty() {
    currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-empty"));
    assertNotNull(currentLeaf.getType());
    final EmptyTypeDefinition emptyEff = (EmptyTypeDefinition) ((TypeEffectiveStatement<?>) ((LeafEffectiveStatement) currentLeaf).effectiveSubstatements().iterator().next()).getTypeDefinition();
    assertEquals(Optional.empty(), emptyEff.getUnits());
    assertEquals(Optional.empty(), emptyEff.getDefaultValue());
    assertNull(emptyEff.getBaseType());
    assertEquals("empty", emptyEff.getQName().getLocalName());
    assertNotNull(emptyEff.getUnknownSchemaNodes());
    assertEquals(Optional.empty(), emptyEff.getDescription());
    assertEquals(Optional.empty(), emptyEff.getReference());
    assertEquals("CURRENT", emptyEff.getStatus().toString());
    assertNotNull(emptyEff.toString());
}
Also used : EmptyTypeDefinition(org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition) LeafEffectiveStatement(org.opendaylight.yangtools.yang.model.api.stmt.LeafEffectiveStatement) Test(org.junit.Test)

Aggregations

LeafEffectiveStatement (org.opendaylight.yangtools.yang.model.api.stmt.LeafEffectiveStatement)16 Test (org.junit.Test)15 GroupingEffectiveStatement (org.opendaylight.yangtools.yang.model.api.stmt.GroupingEffectiveStatement)3 ModuleEffectiveStatement (org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement)3 LeafrefTypeDefinition (org.opendaylight.yangtools.yang.model.api.type.LeafrefTypeDefinition)2 ContainerSchemaNode (org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode)1 LeafSchemaNode (org.opendaylight.yangtools.yang.model.api.LeafSchemaNode)1 ContainerEffectiveStatement (org.opendaylight.yangtools.yang.model.api.stmt.ContainerEffectiveStatement)1 NotificationEffectiveStatement (org.opendaylight.yangtools.yang.model.api.stmt.NotificationEffectiveStatement)1 UnitsEffectiveStatement (org.opendaylight.yangtools.yang.model.api.stmt.UnitsEffectiveStatement)1 BinaryTypeDefinition (org.opendaylight.yangtools.yang.model.api.type.BinaryTypeDefinition)1 BitsTypeDefinition (org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition)1 Bit (org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition.Bit)1 BooleanTypeDefinition (org.opendaylight.yangtools.yang.model.api.type.BooleanTypeDefinition)1 DecimalTypeDefinition (org.opendaylight.yangtools.yang.model.api.type.DecimalTypeDefinition)1 EmptyTypeDefinition (org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition)1 EnumTypeDefinition (org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition)1 EnumPair (org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition.EnumPair)1 IdentityrefTypeDefinition (org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition)1 InstanceIdentifierTypeDefinition (org.opendaylight.yangtools.yang.model.api.type.InstanceIdentifierTypeDefinition)1