Examples of EKBCommit


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

        return queryService.queryByString(Assignment.class, query);
    }

    private EKBCommit getEKBCommit() {
        EKBCommit result = new EKBCommit();
       
        result.setDomainId("userprojects");
        result.setConnectorId("upload");
        result.setInstanceId("upload");

        return result;
    }
View Full Code Here

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

        model.setPrimitiveShort(Short.MAX_VALUE);

        assertThat(model.isBooleanByIs(), is(true));
        assertThat(model.getBooleanByGet(), is(true));

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

        // check edb object
        EDBObject edbObject = edbService.getObject(getModelOid("ppm/0"));
        // check entry types
View Full Code Here

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

    @Test
    public void testDeleteCommitWithLastRevision_shouldDeleteCommit() throws Exception {
        UUID preCommit1Revision = query.getLastRevisionNumberOfContext(CONTEXT);
        TestModelDecorator model1 = getTestModelDecorator();
        model1.setEdbId("deleteCommitTest/1");
        EKBCommit commit = getTestEKBCommit().addInsert(model1.getModel());
        persist.commit(commit);

        UUID preCommit2Revision = query.getLastRevisionNumberOfContext(CONTEXT);
        TestModelDecorator model2 = getTestModelDecorator();
        model2.setEdbId("deleteCommitTest/2");
        commit = getTestEKBCommit().addInsert(model2.getModel());
        commit.addDelete(model1.getModel());
        persist.commit(commit);

        UUID postCommit2Revision = query.getLastRevisionNumberOfContext(CONTEXT);
        persist.deleteCommit(postCommit2Revision, CONTEXT);
View Full Code Here

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

    @Test(expected = EKBConcurrentException.class)
    public void testDeleteCommitWithOldRevision_shouldThrowException() throws Exception {
        TestModelDecorator model = getTestModelDecorator();
        model.setEdbId("deleteCommitTest/3");
        EKBCommit commit1 = getTestEKBCommit().addInsert(model.getModel());
        persist.commit(commit1);

        UUID postFirstCommitRevision = query.getLastRevisionNumberOfContext(CONTEXT);

        TestModelDecorator model2 = getTestModelDecorator();
        model.setEdbId("deleteCommitTest/4");
        EKBCommit commit2 = getTestEKBCommit().addInsert(model2.getModel());
        persist.commit(commit2);

        persist.deleteCommit(postFirstCommitRevision, CONTEXT);
    }
View Full Code Here

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

    }

    @Test
    public void convert_convertsCorrectly() throws Exception {
        // build test commit
        EKBCommit commit = new EKBCommit();
        commit.setConnectorId("testConnector");
        commit.setDomainId("testDomain");
        commit.setInstanceId("testInstance");
        commit.setRevisionNumber(UUID.fromString("550e8400-e29b-41d4-a716-446655440000"));

        OpenEngSBModel insert1 = new TestModelA();
        OpenEngSBModel insert2 = new TestModelA();
        OpenEngSBModel insert3 = new TestModelB();

        OpenEngSBModel update1 = new TestModelA();
        OpenEngSBModel update2 = new TestModelA();

        OpenEngSBModel delete1 = new TestModelA();
        OpenEngSBModel delete2 = new TestModelB();

        commit.addInsert(insert1).addInsert(insert2).addInsert(insert3);
        commit.addUpdate(update1).addUpdate(update2);
        commit.addDelete(delete1).addDelete(delete2);

        // test
        IndexCommit convertedCommit = converter.convert(commit);

        // assert
View Full Code Here

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

        model3.setName("model3");
        model3.setField("test");
        TestModelDecorator model4 = getTestModelDecorator();
        model4.setEdbId("orQueryTest/4");
        model4.setName("model4");
        EKBCommit commit =
            getTestEKBCommit().addInserts(
                Arrays.asList(model1.getModel(), model2.getModel(), model3.getModel(), model4.getModel()));
        persist.commit(commit);

        QueryRequest request =
View Full Code Here

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

        OpenEngSBFileModel model = new OpenEngSBFileModel();
        model.setFile(f);
        model.setId("testId");

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

        OpenEngSBFileModel result = query.getModel(OpenEngSBFileModel.class, getModelOid("testId"));

        File newFile = result.getFile();
View Full Code Here

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

    @Test(expected = EKBException.class)
    public void testDoubleModelCommit_shouldThrowException() throws Exception {
        TestModelDecorator model = getTestModelDecorator();
        model.setEdbId("createevent/1");
        EKBCommit commit = getTestEKBCommit().addInsert(model.getModel());

        persist.commit(commit);
        persist.commit(commit);
    }
View Full Code Here

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

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

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

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

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

        @SuppressWarnings("unchecked")
        List<Object> result = (List<Object>) query.queryByString(getTestModel(), "name:\"C:\\test\"");
        assertThat(result.isEmpty(), is(false));
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.