/** * New instance. * * @param pipelineName the name of the pipeline * @param clazz the clazz to owning this support * @param history the history to store to (if null will use the Noop history) * @param monitor the monitor instance, used for logging. * @param mergeDistinctEntities when merging should we merge entities when they have distinct * reference targets */ public UimaSupport( String pipelineName, Class<?> clazz, BaleenHistory history, UimaMonitor monitor, boolean mergeDistinctEntities) { this.pipelineName = pipelineName; this.history = history != null ? history : NoopBaleenHistory.getInstance(); referrer = UimaUtils.makePipelineSpecificName(pipelineName, clazz); this.monitor = monitor; this.mergeDistinctEntities = mergeDistinctEntities; }
/** * New instance. * * @param pipelineName the name of the pipeline * @param clazz the clazz to owning this support * @param history the history to store to (if null will use the Noop history) * @param monitor the monitor instance, used for logging. * @param mergeDistinctEntities when merging should we merge entities when they have distinct * reference targets */ public UimaSupport( String pipelineName, Class<?> clazz, BaleenHistory history, UimaMonitor monitor, boolean mergeDistinctEntities) { this.pipelineName = pipelineName; this.history = history != null ? history : NoopBaleenHistory.getInstance(); referrer = UimaUtils.makePipelineSpecificName(pipelineName, clazz); this.monitor = monitor; this.mergeDistinctEntities = mergeDistinctEntities; }
@Test public void testNoCrash() { assertNotNull(NoopBaleenHistory.getInstance()); NoopBaleenHistory nbh = new NoopBaleenHistory(); assertNotNull(nbh.getHistory("id")); nbh.closeHistory("any"); assertTrue(nbh.getHistory("id").getAllHistory().isEmpty()); assertTrue(nbh.getHistory("id").getHistory(1).isEmpty()); nbh.getHistory("id").add(null); nbh.closeHistory("any"); nbh.getHistory("id").close(); } }