Package org.openengsb.itests.exam.models

Examples of org.openengsb.itests.exam.models.SubModelDecorator


    @Test
    public void testIfSubModelIsLoadedCorrectly_shouldLoadCorrectVersionOfSubModel() throws Exception {
        TestModelDecorator model = getTestModelDecorator();
        model.setEdbId("submodeltest/7");

        SubModelDecorator sub = getSubModelDecorator();
        sub.setName("test");
        sub.setEdbId("submodeltest/7/1");
        model.setSubModel(sub.getModel());

        EKBCommit commit = getTestEKBCommit().addInsert(model.getModel());
        persist.commit(commit);
        Thread.sleep(5);

        sub.setName("test2");
        commit = getTestEKBCommit().addUpdate(sub.getModel());
        persist.commit(commit);

        sub = loadSubModel("submodeltest/7/1");
        assertThat(sub.getModel(), notNullValue());
        assertThat(sub.getName(), is("test2"));

        model = loadTestModel("submodeltest/7");
        assertThat(model.getModel(), notNullValue());
        sub = new SubModelDecorator(model.getSubModel());
        assertThat(sub.getModel(), notNullValue());
        assertThat(sub.getName(), is("test"));
    }
View Full Code Here


    private TestModelDecorator loadTestModel(String oid) throws Exception {
        return new TestModelDecorator(query.getModel(getTestModel(), getModelOid(oid)));
    }

    private SubModelDecorator loadSubModel(String oid) throws Exception {
        return new SubModelDecorator(query.getModel(getSubModel(), getModelOid(oid)));
    }
View Full Code Here

    private TestModelDecorator getTestModelDecorator() throws Exception {
        return new TestModelDecorator(getTestModel().newInstance());
    }

    private SubModelDecorator getSubModelDecorator() throws Exception {
        return new SubModelDecorator(getSubModel().newInstance());
    }
View Full Code Here

TOP

Related Classes of org.openengsb.itests.exam.models.SubModelDecorator

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.