Package org.openengsb.core.ekb.api

Examples of org.openengsb.core.ekb.api.EKBCommit


    @Test
    public void testEKBInsertCommitAndQueryDataWithBackslashes_shouldReturnModelObject() throws Exception {
        TestModelDecorator model = getTestModelDecorator();
        model.setName("C:\\\\test");
        model.setEdbId("createevent/6");
        EKBCommit commit = getTestEKBCommit().addInsert(model.getModel());
        persist.commit(commit);

        QueryRequest request = QueryRequest.query("name", "C:\\\\test").wildcardUnaware();
        @SuppressWarnings("unchecked")
        List<Object> result = (List<Object>) query.query(getTestModel(), request);
View Full Code Here


    @SuppressWarnings("unchecked")
    public void testEKBInsertCommitAndQueryWithContextId_shouldReturnModelOnlyOnCorrectContext() throws Exception {
        TestModelDecorator model = getTestModelDecorator();
        model.setName("testmodel");
        model.setEdbId("createevent/7");
        EKBCommit commit = getTestEKBCommit().addInsert(model.getModel());
        persist.commit(commit);
        ContextHolder.get().setCurrentContextId("othercontext");
        TestModelDecorator model2 = getTestModelDecorator();
        model2.setName("testmodel");
        model2.setEdbId("createevent/8");
View Full Code Here

    @Test
    public void testEKBUpdateCommit_shouldWork() throws Exception {
        TestModelDecorator model = getTestModelDecorator();
        model.setName("test1");
        model.setEdbId("batchevent/1");
        EKBCommit commit = getTestEKBCommit().addInsert(model.getModel());
        persist.commit(commit);

        EDBObject obj = edbService.getObject(getModelOid("batchevent/1"));
        String name1 = obj.getString("name");
        Integer version1 = obj.getObject(EDBConstants.MODEL_VERSION, Integer.class);

        model.setName("test2");
        commit = getTestEKBCommit().addUpdate(model.getModel());
        TestModelDecorator model2 = getTestModelDecorator();
        model2.setName("test3");
        model2.setEdbId("batchevent/2");
        commit.addInsert(model2.getModel());
        persist.commit(commit);

        obj = edbService.getObject(getModelOid("batchevent/1"));
        String name2 = obj.getString("name");
        Integer version2 = obj.getObject(EDBConstants.MODEL_VERSION, Integer.class);
View Full Code Here

    @Test(expected = EKBException.class)
    public void testEKBDeleteCommitWithNonExistingOid_shouldThrowError() throws Exception {
        TestModelDecorator model = getTestModelDecorator();
        model.setEdbId("deleteevent/1");
        EKBCommit commit = getTestEKBCommit().addDelete(model.getModel());
        persist.commit(commit);
    }
View Full Code Here

    @Test
    public void testEKBUpdateCommit_shouldUpdateModel() throws Exception {
        TestModelDecorator model = getTestModelDecorator();
        model.setName("test1");
        model.setEdbId("updateevent/2");
        EKBCommit commit = getTestEKBCommit().addInsert(model.getModel());
        persist.commit(commit);

        EDBObject obj = edbService.getObject(getModelOid("updateevent/2"));
        String name1 = obj.getString("name");
        Integer version1 = obj.getObject(EDBConstants.MODEL_VERSION, Integer.class);
View Full Code Here

    @Test
    public void testEKBConflictCommitEvent_shouldResolveInNoConflict() throws Exception {
        TestModelDecorator model = getTestModelDecorator();
        model.setName("test");
        model.setEdbId("updateevent/3");
        EKBCommit commit = getTestEKBCommit().addInsert(model.getModel());
        persist.commit(commit);

        EDBObject obj = edbService.getObject(getModelOid("updateevent/3"));
        Integer version1 = obj.getObject(EDBConstants.MODEL_VERSION, Integer.class);
        OpenEngSBModelEntry entry = new OpenEngSBModelEntry(EDBConstants.MODEL_VERSION, 0, Integer.class);
View Full Code Here

    @Test(expected = EKBException.class)
    public void testEKBConflictCommitEvent_shouldResolveInConflict() throws Exception {
        TestModelDecorator model = getTestModelDecorator();
        model.setName("test1");
        model.setEdbId("updateevent/4");
        EKBCommit commit = getTestEKBCommit().addInsert(model.getModel());
        persist.commit(commit);

        model.setName("test2");
        OpenEngSBModelEntry entry = new OpenEngSBModelEntry(EDBConstants.MODEL_VERSION, 0, Integer.class);
        ModelWrapper.wrap(model.getModel()).addOpenEngSBModelEntry(entry);
View Full Code Here

        SubModelDecorator sub = getSubModelDecorator();
        sub.setName("sub");
        sub.setEdbId("testSub/2");
        model.setSubModel(sub.getModel());

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

        EDBObject mainObject = edbService.getObject(getModelOid("testSub/1"));
        EDBObject subObject = edbService.getObject(getModelOid("testSub/2"));
View Full Code Here

        List<Object> subs = new ArrayList<Object>();
        subs.add(sub1.getModel());
        subs.add(sub2.getModel());
        model.setSubs(subs);

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

        EDBObject mainObject = edbService.getObject(getModelOid("testSub/3"));
        EDBObject subObject1 = edbService.getObject(getModelOid("testSub/4"));
        EDBObject subObject2 = edbService.getObject(getModelOid("testSub/5"));
View Full Code Here

        child11.setSubModel(leaf.getModel());
        child1.setChildren(child1Children);
        root.setChildren(rootChildren);

        // test
        EKBCommit commit = getTestEKBCommit().addInsert(root.getModel());
        persist.commit(commit);

        rRoot = new TestModelDecorator(query.getModel(getTestModel(), getModelOid("root")));

        // assert
View Full Code Here

TOP

Related Classes of org.openengsb.core.ekb.api.EKBCommit

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.