Package org.terasology.entitySystem.stubs

Examples of org.terasology.entitySystem.stubs.GetterSetterComponent


    }

    @Test
    public void testGetterSetterUtilization() throws Exception {
        GetterSetterComponent comp = new GetterSetterComponent();
        GetterSetterComponent newComp = (GetterSetterComponent) componentSerializer.deserialize(componentSerializer.serialize(comp));
        assertTrue(comp.getterUsed);
        assertTrue(newComp.setterUsed);
    }
View Full Code Here


    @Test
    public void createFieldAccessorWithGetterSetter() throws Exception {
        ReflectFactory reflectFactory = new ByteCodeReflectFactory();
        FieldAccessor<GetterSetterComponent, Vector3f> fieldAccessor
                = reflectFactory.createFieldAccessor(GetterSetterComponent.class, GetterSetterComponent.class.getDeclaredField("value"), Vector3f.class);
        GetterSetterComponent comp = new GetterSetterComponent();
        Vector3f newVal = new Vector3f(1, 2, 3);
        fieldAccessor.setValue(comp, newVal);
        assertTrue(comp.setterUsed);

        assertEquals(newVal, fieldAccessor.getValue(comp));
View Full Code Here

TOP

Related Classes of org.terasology.entitySystem.stubs.GetterSetterComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.