Examples of EngineeringObjectModel


Examples of org.openengsb.core.ekb.persistence.persist.edb.models.EngineeringObjectModel

        enhancer.onPreCommit(commit);
    }

    @Test
    public void testIfTheEngineeringObjectReferenceUpdateWorks_shouldLoadOtherModelAndMergeIt() throws Exception {
        EngineeringObjectModel model = new EngineeringObjectModel();
        model.setInternalModelName("common/reference/1");
        model.setModelAId("objectA/reference/2");
        model.setModelBId("objectB/reference/1");
        model.setNameA("firstObject");
        model.setNameB("secondObject");
        EKBCommit commit = getTestCommit().addUpdate(model);
        int before = commit.getUpdates().size();
        enhancer.onPreCommit(commit);
        int after = commit.getUpdates().size();
        Object inserted = commit.getUpdates().get(commit.getUpdates().size() - 1);
        EngineeringObjectModel result = (EngineeringObjectModel) inserted;
        assertThat(before == after, is(true));
        assertThat(result.getNameA(), is("updatedFirstObject"));
        assertThat(result.getNameB(), is("secondObject"));
    }
View Full Code Here

Examples of org.openengsb.core.ekb.persistence.persist.edb.models.EngineeringObjectModel

    }

    @Test
    public void testIfTheEngineeringObjectReferencesUpdateWorks_shouldLoadOtherModelAndMergeIt()
        throws Exception {
        EngineeringObjectModel model = new EngineeringObjectModel();
        model.setInternalModelName("common/reference/1");
        model.setModelAId("objectA/reference/2");
        model.setModelBId("objectB/reference/2");
        model.setNameA("firstObject");
        model.setNameB("secondObject");
        EKBCommit commit = getTestCommit().addUpdate(model);
        int before = commit.getUpdates().size();
        enhancer.onPreCommit(commit);
        int after = commit.getUpdates().size();
        Object inserted = commit.getUpdates().get(commit.getUpdates().size() - 1);
        EngineeringObjectModel result = (EngineeringObjectModel) inserted;
        assertThat(before == after, is(true));
        assertThat(result.getNameA(), is("updatedFirstObject"));
        assertThat(result.getNameB(), is("updatedSecondObject"));
    }
View Full Code Here

Examples of org.openengsb.core.ekb.persistence.persist.edb.models.EngineeringObjectModel

    }

    @Test
    public void testIfEngineeringObjectUpdateAlsoUpdatesReferencedModels_shouldUpdateAllNeededModels()
        throws Exception {
        EngineeringObjectModel model = new EngineeringObjectModel();
        model.setInternalModelName("common/reference/1");
        model.setModelAId("objectA/reference/1");
        model.setModelBId("objectB/reference/1");
        model.setNameA("updatedFirstObject");
        model.setNameB("updatedSecondObject");
        EKBCommit commit = getTestCommit().addUpdate(model);
        int before = commit.getUpdates().size();
        enhancer.onPreCommit(commit);
        int after = commit.getUpdates().size();
        assertThat(after - before == 2, is(true));
View Full Code Here

Examples of org.openengsb.core.ekb.persistence.persist.edb.models.EngineeringObjectModel

        assertThat(modelB.getNameB(), is("updatedSecondObject"));
    }

    @Test
    public void testIfEOObjectWithNoReferenceCanBeCommitted_shouldWork() throws Exception {
        EngineeringObjectModel model = new EngineeringObjectModel();
        model.setInternalModelName("common/reference/1");
        EKBCommit commit = getTestCommit().addInsert(model);
        int before = commit.getUpdates().size();
        enhancer.onPreCommit(commit);
        int after = commit.getUpdates().size();
        assertThat(after, is(before));
View Full Code Here

Examples of org.openengsb.core.ekb.persistence.persist.edb.models.EngineeringObjectModel

    }

    @Test
    public void testIfEngineeringObjectUpdateAlsoUpdatesReferencedModel_shouldUpdateNeededModel()
        throws Exception {
        EngineeringObjectModel model = new EngineeringObjectModel();
        model.setInternalModelName("common/reference/2");
        model.setModelAId("objectA/reference/1");
        model.setNameA("updatedFirstObject");
        EKBCommit commit = getTestCommit().addUpdate(model);
        int before = commit.getUpdates().size();
        enhancer.onPreCommit(commit);
        int after = commit.getUpdates().size();
        assertThat(after - before == 1, is(true));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.