Search in sources :

Example 1 with StringTypeDefinition

use of org.opendaylight.yangtools.yang.model.api.type.StringTypeDefinition in project controller by opendaylight.

the class RuntimeRegistratorTest method testHierarchy.

@Test
public void testHierarchy() {
    final LeafSchemaNode leaf = mock(LeafSchemaNode.class);
    doReturn(QName.create(URI.create("urn:x"), "leaf-local-name")).when(leaf).getQName();
    doReturn(Collections.emptyList()).when(leaf).getUnknownSchemaNodes();
    doReturn(java.util.Optional.empty()).when(leaf).getDescription();
    final StringTypeDefinition leafType = mock(StringTypeDefinition.class);
    doReturn(java.util.Optional.empty()).when(leafType).getDefaultValue();
    doReturn(leafType).when(leaf).getType();
    final TypeProviderWrapper typeProviderWrapper = mock(TypeProviderWrapper.class);
    final Type mockedType = mock(Type.class);
    doReturn(mockedType).when(typeProviderWrapper).getType(leaf);
    doReturn("java.lang.String").when(mockedType).getFullyQualifiedName();
}
Also used : Type(org.opendaylight.mdsal.binding.model.api.Type) StringTypeDefinition(org.opendaylight.yangtools.yang.model.api.type.StringTypeDefinition) LeafSchemaNode(org.opendaylight.yangtools.yang.model.api.LeafSchemaNode) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Type (org.opendaylight.mdsal.binding.model.api.Type)1 LeafSchemaNode (org.opendaylight.yangtools.yang.model.api.LeafSchemaNode)1 StringTypeDefinition (org.opendaylight.yangtools.yang.model.api.type.StringTypeDefinition)1