Search in sources :

Example 1 with CompositeDbHistoryEventHandler

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

the class CompositeDbHistoryEventHandlerTest method testCompositeDbHistoryEventHandlerArgumentConstructorWithEmptyList.

@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoryLevelTest.bpmn20.xml" })
public void testCompositeDbHistoryEventHandlerArgumentConstructorWithEmptyList() {
    CompositeDbHistoryEventHandler compositeDbHistoryEventHandler = new CompositeDbHistoryEventHandler(new ArrayList<HistoryEventHandler>());
    processEngineConfiguration.setHistoryEventHandler(compositeDbHistoryEventHandler);
    startProcessAndCompleteUserTask();
    assertEquals(0, countCustomHistoryEventHandler);
    assertEquals(2, historyService.createHistoricDetailQuery().count());
}
Also used : HistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.HistoryEventHandler) CompositeDbHistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.CompositeDbHistoryEventHandler) CompositeDbHistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.CompositeDbHistoryEventHandler) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 2 with CompositeDbHistoryEventHandler

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

the class CompositeDbHistoryEventHandlerTest method testCompositeDbHistoryEventHandlerArgumentConstructorWithNotEmptyListNotNullTwoEvents.

@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoryLevelTest.bpmn20.xml" })
public void testCompositeDbHistoryEventHandlerArgumentConstructorWithNotEmptyListNotNullTwoEvents() {
    // prepare the list with two events
    List<HistoryEventHandler> historyEventHandlers = new ArrayList<HistoryEventHandler>();
    historyEventHandlers.add(new CustomDbHistoryEventHandler());
    historyEventHandlers.add(new CustomDbHistoryEventHandler());
    CompositeDbHistoryEventHandler compositeDbHistoryEventHandler = new CompositeDbHistoryEventHandler(historyEventHandlers);
    processEngineConfiguration.setHistoryEventHandler(compositeDbHistoryEventHandler);
    startProcessAndCompleteUserTask();
    assertEquals(4, countCustomHistoryEventHandler);
    assertEquals(2, historyService.createHistoricDetailQuery().count());
}
Also used : HistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.HistoryEventHandler) CompositeDbHistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.CompositeDbHistoryEventHandler) ArrayList(java.util.ArrayList) CompositeDbHistoryEventHandler(org.camunda.bpm.engine.impl.history.handler.CompositeDbHistoryEventHandler) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 3 with CompositeDbHistoryEventHandler

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

the class CompositeDbHistoryEventHandlerTest method testCompositeDbHistoryEventHandlerNonArgumentConstructorAddNullEvent.

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

Example 4 with CompositeDbHistoryEventHandler

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

the class CompositeDbHistoryEventHandlerTest method testCompositeDbHistoryEventHandlerArgumentConstructorWithNullVarargs.

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

Example 5 with CompositeDbHistoryEventHandler

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

the class CompositeDbHistoryEventHandlerTest method testCompositeDbHistoryEventHandlerNonArgumentConstructorAddTwoNotNullEvents.

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

Aggregations

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