import java.net.URI;
import java.util.NoSuchElementException;
import org.junit.Test;
+import org.opendaylight.mdsal.binding.model.api.Type;
import org.opendaylight.yangtools.binding.generator.util.generated.type.builder.GeneratedTypeBuilderImpl;
-import org.opendaylight.yangtools.sal.binding.model.api.Type;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
doReturn(SchemaPath.ROOT).when(leafSchemaNode).getPath();
doReturn(QName.create("Cont1")).when(leafSchemaNode).getQName();
- assertEquals("new java.lang.Boolean(\"false\")", typeProvider.getTypeDefaultConstruction(leafSchemaNode, "false"));
+ assertEquals("java.lang.Boolean.FALSE", typeProvider.getTypeDefaultConstruction(leafSchemaNode, "false"));
// decimal type
final DecimalTypeDefinition decimalType = BaseTypes.decimalTypeBuilder(refTypePath).setFractionDigits(4).build();
doReturn(SchemaPath.ROOT).when(leafSchemaNode).getPath();
doReturn(QName.create("Cont1")).when(leafSchemaNode).getQName();
- assertEquals("new java.lang.Boolean(\"default value\")", typeProvider.getTypeDefaultConstruction(leafSchemaNode, "default value"));
+ assertEquals("java.lang.Boolean.valueOf(\"default value\")", typeProvider.getTypeDefaultConstruction(leafSchemaNode, "default value"));
// enum type
final EnumTypeDefinition enumType = BaseTypes.enumerationTypeBuilder(refTypePath).build();
assertEquals("\"default value\"", typeProvider.getTypeDefaultConstruction(leafSchemaNode, "default value"));
fail("Expected NoSuchElementException");
} catch (Exception e) {
- assertTrue( e instanceof NoSuchElementException);
+ assertTrue(e instanceof NoSuchElementException);
}
// identityref type
final IdentitySchemaNode identitySchemaNode = mock(IdentitySchemaNode.class);
final IdentityrefTypeBuilder identityRefBuilder = BaseTypes.identityrefTypeBuilder(refTypePath);
- identityRefBuilder.setIdentity(identitySchemaNode);
+ identityRefBuilder.addIdentity(identitySchemaNode);
final IdentityrefTypeDefinition identityRef = identityRefBuilder.build();
reset(leafSchemaNode);