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

Examples of org.openengsb.core.ekb.persistence.query.edb.models.SubModel


    @Test
    public void testGetOpenEngSBModelEntriesForComplexElementWithProxiedInterface_shouldWork() throws Exception {
        TestModel model = service.getModel(TestModel.class, "testoid");
        List<OpenEngSBModelEntry> entries = ModelWrapper.wrap(model).toOpenEngSBModelEntries();
        SubModel sub = model.getSub();
        boolean subValue = false;

        for (OpenEngSBModelEntry entry : entries) {
            if (entry.getKey().equals("sub")) {
                SubModel s = (SubModel) entry.getValue();
                if (s.getId().equals(sub.getId()) && s.getValue().equals(sub.getValue())) {
                    subValue = true;
                }
            }
        }
View Full Code Here


    @Test
    public void testGetOpenEngSBModelEntriesForListOfComplexElementsWithProxiedInterface_shouldWork() throws Exception {
        TestModel model = service.getModel(TestModel.class, "testoid");
        List<OpenEngSBModelEntry> entries = ModelWrapper.wrap(model).toOpenEngSBModelEntries();

        SubModel subModel1 = null;
        SubModel subModel2 = null;

        for (OpenEngSBModelEntry entry : entries) {
            if (entry.getKey().equals("subs")) {
                @SuppressWarnings("unchecked")
                List<SubModel> subModels = (List<SubModel>) entry.getValue();
                subModel1 = subModels.get(0);
                subModel2 = subModels.get(1);
            }
        }

        assertThat(subModel1, notNullValue());
        assertThat(subModel2, notNullValue());
        assertThat(subModel1.getId(), is("AAAAA"));
        assertThat(subModel1.getValue(), is("BBBBB"));
        assertThat(subModel2.getId(), is("CCCCC"));
        assertThat(subModel2.getValue(), is("DDDDD"));
    }
View Full Code Here

    }

    @Test
    public void testComplexAsParameterWithImplementedClass_shouldWork() throws Exception {
        TestModel2 model = service.getModel(TestModel2.class, "testoidimpl");
        SubModel sub = model.getSub();
        assertThat(sub.getId(), is("testid"));
        assertThat(sub.getValue(), is("testvalue"));

        sub.setId("blabla");
        sub.setValue("blublub");
        assertThat(sub.getId(), is("blabla"));
        assertThat(sub.getValue(), is("blublub"));
    }
View Full Code Here

    @Test
    public void testComplexAsParameterWithProxiedInterface_shouldWork() throws Exception {
        TestModel model = service.getModel(TestModel.class, "testoid");

        SubModel sub = model.getSub();
        assertThat(sub.getId(), is("testid"));
        assertThat(sub.getValue(), is("testvalue"));

        sub.setId("blabla");
        sub.setValue("blublub");
        assertThat(sub.getId(), is("blabla"));
        assertThat(sub.getValue(), is("blublub"));
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.ekb.persistence.query.edb.models.SubModel

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.