Search in sources :

Example 6 with JsonProcessorInjectionMap

use of com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap in project Engine by VoltzEngine-Project.

the class TestProcessorInjection method testField.

@Test
public void testField() {
    JsonProcessorInjectionMap map = new JsonProcessorInjectionMap(InjectionTestClass.class);
    InjectionTestClass object = new InjectionTestClass();
    assertTrue(map.handle(object, "key", "String"));
    assertEquals("String", object.key);
}
Also used : JsonProcessorInjectionMap(com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap) Test(org.junit.Test)

Example 7 with JsonProcessorInjectionMap

use of com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap in project Engine by VoltzEngine-Project.

the class TestProcessorInjection method testDouble.

@Test
public void testDouble() {
    JsonProcessorInjectionMap map = new JsonProcessorInjectionMap(InjectionTestClass.class);
    InjectionTestClass object = new InjectionTestClass();
    assertTrue(map.handle(object, "d", 1.1));
    assertEquals(1.1, object.d);
    assertTrue(map.handle(object, "d2", 2.2));
    assertEquals(2.2, object.d);
}
Also used : JsonProcessorInjectionMap(com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap) Test(org.junit.Test)

Example 8 with JsonProcessorInjectionMap

use of com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap in project Engine by VoltzEngine-Project.

the class TestProcessorInjection method testShort.

@Test
public void testShort() {
    JsonProcessorInjectionMap map = new JsonProcessorInjectionMap(InjectionTestClass.class);
    InjectionTestClass object = new InjectionTestClass();
    assertTrue(map.handle(object, "s", (short) 1));
    assertEquals(1, object.s);
    assertTrue(map.handle(object, "s2", (short) 2));
    assertEquals(2, object.s);
}
Also used : JsonProcessorInjectionMap(com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap) Test(org.junit.Test)

Example 9 with JsonProcessorInjectionMap

use of com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap in project Engine by VoltzEngine-Project.

the class TestProcessorInjection method testInteger.

@Test
public void testInteger() {
    JsonProcessorInjectionMap map = new JsonProcessorInjectionMap(InjectionTestClass.class);
    InjectionTestClass object = new InjectionTestClass();
    assertTrue(map.handle(object, "i", 1));
    assertEquals(1, object.i);
    assertTrue(map.handle(object, "i3", 2));
    assertEquals(2, object.i);
    assertTrue(map.handle(object, "i2", 3));
    assertEquals(3, object.i2);
    assertTrue(map.handle(object, "i4", 4));
    assertEquals(4, object.i2);
}
Also used : JsonProcessorInjectionMap(com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap) Test(org.junit.Test)

Example 10 with JsonProcessorInjectionMap

use of com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap in project Engine by VoltzEngine-Project.

the class TestProcessorInjection method testByte.

@Test
public void testByte() {
    JsonProcessorInjectionMap map = new JsonProcessorInjectionMap(InjectionTestClass.class);
    InjectionTestClass object = new InjectionTestClass();
    assertTrue(map.handle(object, "b", (byte) 1));
    assertEquals(1, object.b);
    assertTrue(map.handle(object, "b2", (byte) 2));
    assertEquals(2, object.b);
}
Also used : JsonProcessorInjectionMap(com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap) Test(org.junit.Test)

Aggregations

JsonProcessorInjectionMap (com.builtbroken.mc.lib.json.loading.JsonProcessorInjectionMap)19 Test (org.junit.Test)18 JsonPrimitive (com.google.gson.JsonPrimitive)7 JsonElement (com.google.gson.JsonElement)2 ITileEventListener (com.builtbroken.mc.api.tile.listeners.ITileEventListener)1 JsonArray (com.google.gson.JsonArray)1 JsonObject (com.google.gson.JsonObject)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1