Search in sources :

Example 1 with CompositeHistoryEventHandler

use of org.camunda.bpm.engine.impl.history.handler.CompositeHistoryEventHandler in project camunda-bpm-platform by camunda.

the class CompositeHistoryEventHandlerTest method testCompositeHistoryEventHandlerNonArgumentConstructorAddNullEvent.

public void testCompositeHistoryEventHandlerNonArgumentConstructorAddNullEvent() {
    CompositeHistoryEventHandler compositeHistoryEventHandler = new CompositeHistoryEventHandler();
    try {
        compositeHistoryEventHandler.add(null);
        fail("NullValueException expected");
    } catch (NullValueException e) {
        assertTextPresent("History event handler is null", e.getMessage());
    }
}
Also used : CompositeHistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.CompositeHistoryEventHandler) NullValueException(org.camunda.bpm.engine.exception.NullValueException)

Example 2 with CompositeHistoryEventHandler

use of org.camunda.bpm.engine.impl.history.handler.CompositeHistoryEventHandler in project camunda-bpm-platform by camunda.

the class CompositeHistoryEventHandlerTest method testCompositeHistoryEventHandlerNonArgumentConstructorAddNotNullTwoEvents.

@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoryLevelTest.bpmn20.xml" })
public void testCompositeHistoryEventHandlerNonArgumentConstructorAddNotNullTwoEvents() {
    CompositeHistoryEventHandler compositeHistoryEventHandler = new CompositeHistoryEventHandler();
    compositeHistoryEventHandler.add(new CustomDbHistoryEventHandler());
    compositeHistoryEventHandler.add(new DbHistoryEventHandler());
    processEngineConfiguration.setHistoryEventHandler(compositeHistoryEventHandler);
    startProcessAndCompleteUserTask();
    assertEquals(2, countCustomHistoryEventHandler);
    assertEquals(2, historyService.createHistoricDetailQuery().count());
}
Also used : DbHistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.DbHistoryEventHandler) CompositeHistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.CompositeHistoryEventHandler) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 3 with CompositeHistoryEventHandler

use of org.camunda.bpm.engine.impl.history.handler.CompositeHistoryEventHandler in project camunda-bpm-platform by camunda.

the class CompositeHistoryEventHandlerTest method testCompositeHistoryEventHandlerArgumentConstructorWithNullVarargs.

public void testCompositeHistoryEventHandlerArgumentConstructorWithNullVarargs() {
    HistoryEventHandler historyEventHandler = null;
    try {
        new CompositeHistoryEventHandler(historyEventHandler);
        fail("NullValueException expected");
    } catch (NullValueException e) {
        assertTextPresent("History event handler is null", e.getMessage());
    }
}
Also used : CompositeHistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.CompositeHistoryEventHandler) DbHistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.DbHistoryEventHandler) HistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.HistoryEventHandler) CompositeHistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.CompositeHistoryEventHandler) NullValueException(org.camunda.bpm.engine.exception.NullValueException)

Example 4 with CompositeHistoryEventHandler

use of org.camunda.bpm.engine.impl.history.handler.CompositeHistoryEventHandler in project camunda-bpm-platform by camunda.

the class CompositeHistoryEventHandlerTest method testCompositeHistoryEventHandlerNonArgumentConstructorAddNotNullEvent.

@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoryLevelTest.bpmn20.xml" })
public void testCompositeHistoryEventHandlerNonArgumentConstructorAddNotNullEvent() {
    CompositeHistoryEventHandler compositeHistoryEventHandler = new CompositeHistoryEventHandler();
    compositeHistoryEventHandler.add(new CustomDbHistoryEventHandler());
    processEngineConfiguration.setHistoryEventHandler(compositeHistoryEventHandler);
    startProcessAndCompleteUserTask();
    assertEquals(2, countCustomHistoryEventHandler);
    assertEquals(0, historyService.createHistoricDetailQuery().count());
}
Also used : CompositeHistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.CompositeHistoryEventHandler) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 5 with CompositeHistoryEventHandler

use of org.camunda.bpm.engine.impl.history.handler.CompositeHistoryEventHandler in project camunda-bpm-platform by camunda.

the class CompositeHistoryEventHandlerTest method testCompositeHistoryEventHandlerArgumentConstructorWithNotNullVarargsOneEvent.

@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoryLevelTest.bpmn20.xml" })
public void testCompositeHistoryEventHandlerArgumentConstructorWithNotNullVarargsOneEvent() {
    CompositeHistoryEventHandler compositeHistoryEventHandler = new CompositeHistoryEventHandler(new CustomDbHistoryEventHandler());
    processEngineConfiguration.setHistoryEventHandler(compositeHistoryEventHandler);
    startProcessAndCompleteUserTask();
    assertEquals(2, countCustomHistoryEventHandler);
    assertEquals(0, historyService.createHistoricDetailQuery().count());
}
Also used : CompositeHistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.CompositeHistoryEventHandler) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

CompositeHistoryEventHandler (org.camunda.bpm.engine.impl.history.handler.CompositeHistoryEventHandler)9 Deployment (org.camunda.bpm.engine.test.Deployment)7 DbHistoryEventHandler (org.camunda.bpm.engine.impl.history.handler.DbHistoryEventHandler)5 HistoryEventHandler (org.camunda.bpm.engine.impl.history.handler.HistoryEventHandler)3 NullValueException (org.camunda.bpm.engine.exception.NullValueException)2 ArrayList (java.util.ArrayList)1