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

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


        super(EOMode.DEACTIVATED);
    }
   
    @Test
    public void testIfNormalObjectUpdateTriggersEOUpdate_shouldTriggerNothing() throws Exception {
        SourceModelA model = new SourceModelA();
        model.setNameA("updatedFirstObject");
        model.setId("objectA/reference/1");
        EKBCommit commit = getTestCommit().addUpdate(model);
        int before = commit.getUpdates().size();
        enhancer.onPreCommit(commit);
        int after = commit.getUpdates().size();
        assertThat(before, is(after));
View Full Code Here


        model.setNameA("updatedFirstObject");
        EKBCommit commit = getTestCommit().addUpdate(model);
        int before = commit.getUpdates().size();
        enhancer.onPreCommit(commit);
        int after = commit.getUpdates().size();
        SourceModelA modelA = null;
        for (OpenEngSBModel update : commit.getUpdates()) {
            if (update.retrieveModelName().equals(SourceModelA.class.getName())) {
                modelA = (SourceModelA) update;
            }
        }
View Full Code Here

        assertThat(model.getNameB(), is("secondObject"));
    }

    @Test
    public void testIfNormalObjectUpdateTriggersEOUpdate_shouldUpdateAlsoEO() throws Exception {
        SourceModelA model = new SourceModelA();
        model.setNameA("updatedFirstObject");
        model.setId("objectA/reference/1");
        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);
View Full Code Here

        assertThat(result.getNameA(), is("updatedFirstObject"));
    }

    @Test
    public void testIfDoubleNormalObjectUpdateTriggersEOUpdate_shouldUpdateAlsoEO() throws Exception {
        SourceModelA modelA = new SourceModelA();
        modelA.setNameA("updatedFirstObject");
        modelA.setId("objectA/reference/1");
        SourceModelB modelb = new SourceModelB();
        modelb.setNameB("updatedSecondObject");
        modelb.setId("objectB/reference/1");
        EKBCommit commit = getTestCommit().addUpdate(modelA).addUpdate(modelb);
        int before = commit.getUpdates().size();
View Full Code Here

        EKBCommit commit = getTestCommit().addUpdate(model);
        int before = commit.getUpdates().size();
        enhancer.onPreCommit(commit);
        int after = commit.getUpdates().size();
        assertThat(after - before == 2, is(true));
        SourceModelA modelA = null;
        SourceModelB modelB = null;
        for (OpenEngSBModel update : commit.getUpdates()) {
            if (update.retrieveModelName().equals(SourceModelA.class.getName())) {
                modelA = (SourceModelA) update;
            }
            if (update.retrieveModelName().equals(SourceModelB.class.getName())) {
                modelB = (SourceModelB) update;
            }
        }
        assertThat(modelA.getNameA(), is("updatedFirstObject"));
        assertThat(modelB.getNameB(), is("updatedSecondObject"));
    }
View Full Code Here

        EKBCommit commit = getTestCommit().addUpdate(model);
        int before = commit.getUpdates().size();
        enhancer.onPreCommit(commit);
        int after = commit.getUpdates().size();
        assertThat(after - before == 1, is(true));
        SourceModelA modelA = null;
        for (OpenEngSBModel update : commit.getUpdates()) {
            if (update.retrieveModelName().equals(SourceModelA.class.getName())) {
                modelA = (SourceModelA) update;
            }
        }
        assertThat(modelA.getNameA(), is("updatedFirstObject"));
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.ekb.persistence.persist.edb.models.SourceModelA

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.