use of com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap in project Engine by VoltzEngine-Project.
the class TestProcessorInjection method testJsonLong.
@Test
public void testJsonLong() {
JsonProcessorInjectionMap map = new JsonProcessorInjectionMap(InjectionTestClass.class);
InjectionTestClass object = new InjectionTestClass();
assertTrue(map.handle(object, "l", new JsonPrimitive(1l)));
assertEquals(1l, object.l);
assertTrue(map.handle(object, "l2", new JsonPrimitive(2l)));
assertEquals(2l, object.l);
}
use of com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap in project Engine by VoltzEngine-Project.
the class TestProcessorInjection method testInit.
@Test
public void testInit() {
JsonProcessorInjectionMap map = new JsonProcessorInjectionMap(InjectionTestClass.class);
assertTrue(map.injectionFields.containsKey("key"));
assertNotNull(map.injectionFields.get("key"));
assertTrue(map.injectionMethods.containsKey("key2"));
assertNotNull(map.injectionMethods.get("key2"));
}
use of com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap in project Engine by VoltzEngine-Project.
the class TestProcessorInjection method testJsonElement.
@Test
public void testJsonElement() {
JsonProcessorInjectionMap map = new JsonProcessorInjectionMap(InjectionTestClass.class);
InjectionTestClass object = new InjectionTestClass();
JsonElement element = createTestElement();
assertTrue(map.handle(object, "element", element));
assertSame(element, object.element);
object.element = null;
assertTrue(map.handle(object, "element2", element));
assertSame(element, object.element);
}
use of com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap in project Engine by VoltzEngine-Project.
the class TestProcessorInjection method testJsonBoolean.
@Test
public void testJsonBoolean() {
JsonProcessorInjectionMap map = new JsonProcessorInjectionMap(InjectionTestClass.class);
InjectionTestClass object = new InjectionTestClass();
JsonPrimitive primitive = new JsonPrimitive(true);
assertTrue(map.handle(object, "bool", primitive));
assertTrue(object.bool);
assertTrue(map.handle(object, "bool2", primitive));
assertTrue(object.bool);
}
use of com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap in project Engine by VoltzEngine-Project.
the class TestProcessorInjection method testBoolean.
@Test
public void testBoolean() {
JsonProcessorInjectionMap map = new JsonProcessorInjectionMap(InjectionTestClass.class);
InjectionTestClass object = new InjectionTestClass();
assertTrue(map.handle(object, "bool", true));
assertTrue(object.bool);
assertTrue(map.handle(object, "bool2", true));
assertTrue(object.bool);
}
Aggregations