Examples of Submodel


Examples of org.openengsb.core.ekb.common.models.SubModel

    @Test
    public void testComplexModelToEDBObjectConversion_shouldWork() throws Exception {
        TestModel model = new TestModel();
        model.setId("test");
        SubModel sub = new SubModel();
        sub.setId("sub");
        sub.setValue("teststring");
        model.setSub(sub);
        ConnectorInformation id = getTestConnectorInformation();

        List<EDBObject> objects = converter.convertModelToEDBObject(model, id);
        EDBObject object = objects.get(1);
View Full Code Here

Examples of org.openengsb.core.ekb.common.models.SubModel

    @Test
    public void testComplexListModelToEDBObjectConversion_shouldWork() throws Exception {
        TestModel model = new TestModel();
        model.setId("test");
        SubModel sub1 = new SubModel();
        sub1.setId("sub1");
        sub1.setValue("teststring1");
        SubModel sub2 = new SubModel();
        sub2.setId("sub2");
        sub2.setValue("teststring2");
        List<SubModel> subs = new ArrayList<SubModel>();
        subs.add(sub1);
        subs.add(sub2);
        model.setSubs(subs);
        ConnectorInformation id = getTestConnectorInformation();
View Full Code Here

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

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

    @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

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

    }

    @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

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

    @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

Examples of org.openengsb.core.services.internal.model.SubModel

    private NullModel createTestModel() {
        NullModel model = new NullModel();
        model.setId(20);
        model.setValue("test");
        SubModel sub1 = new SubModel();
        sub1.setId("sub1");
        sub1.setName("test1");
        SubModel sub2 = new SubModel();
        sub2.setId("sub2");
        sub2.setName("test2");
        model.setSubs(Arrays.asList(sub1, sub2));
        ModelWrapper wrapper = ModelWrapper.wrap(model);
        wrapper.addOpenEngSBModelEntry(new OpenEngSBModelEntry("test", "test", String.class));
        wrapper.addOpenEngSBModelEntry(new OpenEngSBModelEntry("test2", "test2", String.class));
        return model;
View Full Code Here

Examples of org.sbml.jsbml.ext.comp.Submodel

        return compModel.getListOfPorts();
      }
    } // end Model
    else if (contextObject instanceof Submodel)
    {
      Submodel submodel = (Submodel) contextObject;

      if (elementName.equals(CompConstants.listOfDeletions)) {
        return submodel.getListOfDeletions();
      }
    } // end Submodel
    else if (contextObject instanceof SBaseRef)
    {
      SBaseRef sBaseRef = (SBaseRef) contextObject;
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.