use of org.terasology.reflection.metadata.DefaultClassMetadata in project Terasology by MovingBlocks.
the class MetadataBuilderTest method testInheritsFields.
@Test
public void testInheritsFields() throws Exception {
DefaultClassMetadata<Inheriting> metadata = new DefaultClassMetadata<>(new SimpleUri(), Inheriting.class, factory, copyStrategyLibrary);
assertNotNull(metadata);
assertEquals(2, metadata.getFieldCount());
assertNotNull(metadata.getField("name"));
assertNotNull(metadata.getField("value"));
assertNotNull(metadata.newInstance());
}
use of org.terasology.reflection.metadata.DefaultClassMetadata in project Terasology by MovingBlocks.
the class MetadataBuilderTest method testPrivateField.
@Test
public void testPrivateField() throws Exception {
DefaultClassMetadata<PrivateField> metadata = new DefaultClassMetadata<>(new SimpleUri(), PrivateField.class, factory, copyStrategyLibrary);
assertNotNull(metadata);
assertEquals(1, metadata.getFieldCount());
FieldMetadata fieldMetadata = metadata.getField("name");
assertNotNull(fieldMetadata);
assertEquals(String.class, fieldMetadata.getType());
assertEquals("name", fieldMetadata.getName());
assertNotNull(metadata.newInstance());
}
Aggregations