Package org.openengsb.core.ekb.persistence.persist.edb.internal

Examples of org.openengsb.core.ekb.persistence.persist.edb.internal.ModelDiff


        updated.setInternalModelName("testModel");
        updated.setNameA("nameA-new");
        updated.setNameB("nameB-new");
        updated.setModelAId("testreference1_1");
        updated.setModelBId("testreference2_1");
        ModelDiff diff = ModelDiff.createModelDiff((OpenEngSBModel) old, (OpenEngSBModel) updated);
        // The difference is 5 since also the null value of the test property is calculated as change since it was
        // before not null
        assertThat(diff.getDifferences().size(), is(5));
    }
View Full Code Here


        updated.setNameA("nameA-old");
        updated.setNameB("nameB-old");
        updated.setModelAId("testreference1");
        updated.setModelBId("testreference2");
        updated.setTest("this is a new teststring");
        ModelDiff diff = ModelDiff.createModelDiff((OpenEngSBModel) old, (OpenEngSBModel) updated);
        assertThat(diff.getDifferences().size(), is(1));
        ModelDiffEntry entry = diff.getDifferences().values().iterator().next();
        assertThat((String) entry.getBefore(), is("this is a teststring"));
        assertThat((String) entry.getAfter(), is("this is a new teststring"));
    }
View Full Code Here

        old.setModelBId("testreference2");
        EngineeringObjectModel updated = new EngineeringObjectModel();
        updated.setInternalModelName("testModel");
        updated.setModelAId("testreference1_1");
        updated.setModelBId("testreference2");
        ModelDiff diff = ModelDiff.createModelDiff((OpenEngSBModel) old, (OpenEngSBModel) updated);
        assertThat(diff.getDifferences().size(), is(1));
        assertThat(diff.isForeignKeyChanged(), is(true));
        assertThat(diff.isValueChanged(), is(false));
    }
View Full Code Here

        EngineeringObjectModel updated = new EngineeringObjectModel();
        updated.setInternalModelName("testModel");
        updated.setNameA("world");
        updated.setModelAId("testreference1");
        updated.setModelBId("testreference2");
        ModelDiff diff = ModelDiff.createModelDiff((OpenEngSBModel) old, (OpenEngSBModel) updated);
        assertThat(diff.getDifferences().size(), is(1));
        assertThat(diff.isForeignKeyChanged(), is(false));
        assertThat(diff.isValueChanged(), is(true));
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.ekb.persistence.persist.edb.internal.ModelDiff

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.