use of com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap in project Engine by VoltzEngine-Project.
the class TestProcessorInjection method testJsonByte.
@Test
public void testJsonByte() {
JsonProcessorInjectionMap map = new JsonProcessorInjectionMap(InjectionTestClass.class);
InjectionTestClass object = new InjectionTestClass();
assertTrue(map.handle(object, "b", new JsonPrimitive((byte) 1)));
assertEquals(1, object.b);
assertTrue(map.handle(object, "b2", new JsonPrimitive((byte) 2)));
assertEquals(2, object.b);
}
use of com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap in project Engine by VoltzEngine-Project.
the class TestProcessorInjection method testJsonShort.
@Test
public void testJsonShort() {
JsonProcessorInjectionMap map = new JsonProcessorInjectionMap(InjectionTestClass.class);
InjectionTestClass object = new InjectionTestClass();
assertTrue(map.handle(object, "s", new JsonPrimitive((short) 1)));
assertEquals(1, object.s);
assertTrue(map.handle(object, "s2", new JsonPrimitive((short) 2)));
assertEquals(2, object.s);
}
use of com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap in project Engine by VoltzEngine-Project.
the class TestProcessorInjection method testMethod.
@Test
public void testMethod() {
JsonProcessorInjectionMap map = new JsonProcessorInjectionMap(InjectionTestClass.class);
InjectionTestClass object = new InjectionTestClass();
assertTrue(map.handle(object, "key2", "String"));
assertEquals("String", object.key);
}
use of com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap in project Engine by VoltzEngine-Project.
the class TestProcessorInjection method testJsonInteger.
@Test
public void testJsonInteger() {
JsonProcessorInjectionMap map = new JsonProcessorInjectionMap(InjectionTestClass.class);
InjectionTestClass object = new InjectionTestClass();
assertTrue(map.handle(object, "i", new JsonPrimitive(1)));
assertEquals(1, object.i);
assertTrue(map.handle(object, "i3", new JsonPrimitive(2)));
assertEquals(2, object.i);
assertTrue(map.handle(object, "i2", new JsonPrimitive(3)));
assertEquals(3, object.i2);
assertTrue(map.handle(object, "i4", new JsonPrimitive(4)));
assertEquals(4, object.i2);
}
Aggregations