// Path: src/test/java/myessentials/test/MECTest.java
// public class MECTest extends BaseTest {
// 
//     @Before
//     public void initConfig() {
//         TestConfig.instance.init(configFile, Constants.MOD_ID);
//     }
// 
// }


import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import junit.framework.Assert;
import myessentials.test.MECTest;
import org.junit.Test;
        GsonBuilder builder = new GsonBuilder();
        new FakeSerializableParentObject.Serializer().register(builder);
        Gson gson = builder.create();

        FakeSerializableParentObject objParent = new FakeSerializableParentObject();
        FakeSerializableObject obj = new FakeSerializableObject();
        obj.x = 50;
        obj.y = 1100;
        objParent.z = -1;
        objParent.obj = obj;

        JsonObject json = (JsonObject)gson.toJsonTree(objParent);
        Assert.assertEquals("Z component of parent object was not serialized properly", -1, json.get("z").getAsInt());
        Assert.assertTrue("Child component of parent object was not serailized properly", json.has("child"));
        Assert.assertEquals("X component of child object was not serializer properly", 50, json.get("child").getAsJsonObject().get("x").getAsInt());
        Assert.assertEquals("Y component of child object was not serializer properly", 1100, json.get("child").getAsJsonObject().get("y").getAsInt());
    }

    @Test
    public void shouldDeserializeObjectWithChildSerializer() {

        GsonBuilder builder = new GsonBuilder();
        new FakeSerializableParentObject.Serializer().register(builder);
        Gson gson = builder.create();

        JsonObject json = new JsonObject();
        JsonObject jsonChild = new JsonObject();
        jsonChild.addProperty("x", 30);
        jsonChild.addProperty("y", -2);
        json.add("child", jsonChild);
// Path: src/test/java/myessentials/test/MECTest.java
// public class MECTest extends BaseTest {
// 
//     @Before
//     public void initConfig() {
//         TestConfig.instance.init(configFile, Constants.MOD_ID);
//     }
// 
// }


// Path: src/test/java/myessentials/test/json/SerializerTest.java
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import junit.framework.Assert;
import myessentials.test.MECTest;
import org.junit.Test;

        GsonBuilder builder = new GsonBuilder();
        new FakeSerializableParentObject.Serializer().register(builder);
        Gson gson = builder.create();

        FakeSerializableParentObject objParent = new FakeSerializableParentObject();
        FakeSerializableObject obj = new FakeSerializableObject();
        obj.x = 50;
        obj.y = 1100;
        objParent.z = -1;
        objParent.obj = obj;

        JsonObject json = (JsonObject)gson.toJsonTree(objParent);
        Assert.assertEquals("Z component of parent object was not serialized properly", -1, json.get("z").getAsInt());
        Assert.assertTrue("Child component of parent object was not serailized properly", json.has("child"));
        Assert.assertEquals("X component of child object was not serializer properly", 50, json.get("child").getAsJsonObject().get("x").getAsInt());
        Assert.assertEquals("Y component of child object was not serializer properly", 1100, json.get("child").getAsJsonObject().get("y").getAsInt());
    }

    @Test
    public void shouldDeserializeObjectWithChildSerializer() {

        GsonBuilder builder = new GsonBuilder();
        new FakeSerializableParentObject.Serializer().register(builder);
        Gson gson = builder.create();

        JsonObject json = new JsonObject();
        JsonObject jsonChild = new JsonObject();
        jsonChild.addProperty("x", 30);
        jsonChild.addProperty("y", -2);
        json.add("child", jsonChild);
        json.addProperty("z", 100);