Tabnine Logo
InMemoryPipelineExecutorRegistry.register
Code IndexAdd Tabnine to your IDE (free)

How to use
register
method
in
org.guvnor.ala.registry.inmemory.InMemoryPipelineExecutorRegistry

Best Java code snippets using org.guvnor.ala.registry.inmemory.InMemoryPipelineExecutorRegistry.register (Showing top 18 results out of 315)

origin: org.guvnor/guvnor-ala-registry-vfs

private void initializeRegistry() {
  try {
    final List<Object> traces = registryHelper.readEntries(registryRoot,
                                newFilter(TRACE_SUFFIX));
    traces.forEach(trace -> super.register((PipelineExecutorTrace) trace));
  } catch (Exception e) {
    logger.error("An error was produced during " + VFSPipelineExecutorRegistry.class.getName() + " initialization.",
           e);
  }
}
origin: org.guvnor/guvnor-ala-registry-vfs

@Override
public void register(final PipelineExecutorTrace trace) {
  checkNotNull("trace",
         trace);
  final Path path = buildTracePath(trace.getTaskId());
  try {
    registryHelper.storeEntry(path,
                 trace);
  } catch (Exception e) {
    //uncommon error
    logger.error("Unexpected error was produced during trace marshalling/storing, trace: " + trace,
           e);
    throw new RuntimeException("Unexpected error was produced during trace marshalling/storing, trace: " + trace,
                  e);
  }
  super.register(trace);
}
origin: org.kie.workbench/kie-wb-common-ala-spi

@Test
public void getExecutorTraceByRuntimeId() {
  RuntimeIdMock runtimeId = mock(RuntimeIdMock.class);
  when(runtimeId.getId()).thenReturn(RUNTIME_ID);
  PipelineExecutorTask task = mock(PipelineExecutorTask.class);
  when(task.getOutput()).thenReturn(runtimeId);
  when(trace.getTask()).thenReturn(task);
  pipelineExecutorRegistry.register(trace);
  PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(runtimeId);
  assertEquals(trace,
         result);
}
origin: org.guvnor/guvnor-ala-spi

@Test
public void getExecutorTraceByRuntimeId() {
  RuntimeIdMock runtimeId = mock(RuntimeIdMock.class);
  when(runtimeId.getId()).thenReturn(RUNTIME_ID);
  PipelineExecutorTask task = mock(PipelineExecutorTask.class);
  when(task.getOutput()).thenReturn(runtimeId);
  when(trace.getTask()).thenReturn(task);
  pipelineExecutorRegistry.register(trace);
  PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(runtimeId);
  assertEquals(trace,
         result);
}
origin: org.guvnor/guvnor-ala-spi

@Test
public void testGetExecutorTraces() {
  List<PipelineExecutorTrace> traces = new ArrayList<>();
  for (int i = 0; i < TRACES_COUNT; i++) {
    PipelineExecutorTrace trace = mock(PipelineExecutorTrace.class);
    when(trace.getTaskId()).thenReturn(PIPELINE_EXECUTION_ID + Integer.toString(i));
    traces.add(trace);
  }
  traces.forEach(trace -> pipelineExecutorRegistry.register(trace));
  Collection<PipelineExecutorTrace> result = pipelineExecutorRegistry.getExecutorTraces();
  assertEquals(traces.size(),
         result.size());
  for (PipelineExecutorTrace trace : traces) {
    assertTrue(result.contains(trace));
  }
}
origin: org.kie.workbench/kie-wb-common-ala-spi

@Test
public void testGetExecutorTraces() {
  List<PipelineExecutorTrace> traces = new ArrayList<>();
  for (int i = 0; i < TRACES_COUNT; i++) {
    PipelineExecutorTrace trace = mock(PipelineExecutorTrace.class);
    when(trace.getTaskId()).thenReturn(PIPELINE_EXECUTION_ID + Integer.toString(i));
    traces.add(trace);
  }
  traces.forEach(trace -> pipelineExecutorRegistry.register(trace));
  Collection<PipelineExecutorTrace> result = pipelineExecutorRegistry.getExecutorTraces();
  assertEquals(traces.size(),
         result.size());
  for (PipelineExecutorTrace trace : traces) {
    assertTrue(result.contains(trace));
  }
}
origin: org.guvnor/guvnor-ala-registry-vfs

@Test
public void testRegisterWhenMarshallingErrors() throws Exception {
  prepareTargetPath();
  expectedException.expectMessage("Unexpected error was produced during trace marshalling/storing, trace: " + trace);
  doThrow(new Exception("no matter the message here"))
      .when(registryHelper)
      .storeEntry(traceTargetPath,
            trace);
  pipelineExecutorRegistry.register(trace);
}
origin: org.kie.workbench/kie-wb-common-ala-registry-vfs

@Test
public void testRegisterWhenMarshallingErrors() throws Exception {
  prepareTargetPath();
  expectedException.expectMessage("Unexpected error was produced during trace marshalling/storing, trace: " + trace);
  doThrow(new Exception("no matter the message here"))
      .when(registryHelper)
      .storeEntry(traceTargetPath,
            trace);
  pipelineExecutorRegistry.register(trace);
}
origin: org.kie.workbench/kie-wb-common-ala-spi

@Test
public void testRegister() {
  pipelineExecutorRegistry.register(trace);
  PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertEquals(trace,
         result);
}
origin: org.guvnor/guvnor-ala-spi

@Test
public void testRegister() {
  pipelineExecutorRegistry.register(trace);
  PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertEquals(trace,
         result);
}
origin: org.kie.workbench/kie-wb-common-ala-spi

@Test
public void testGetExecutorTrace() {
  pipelineExecutorRegistry.register(trace);
  PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertEquals(trace,
         result);
}
origin: org.guvnor/guvnor-ala-spi

@Test
public void testGetExecutorTrace() {
  pipelineExecutorRegistry.register(trace);
  PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertEquals(trace,
         result);
}
origin: org.guvnor/guvnor-ala-registry-vfs

@Test
@Override
public void testRegister() {
  prepareTargetPath();
  pipelineExecutorRegistry.register(trace);
  try {
    verify(registryHelper,
        times(1)).storeEntry(traceTargetPath,
                  trace);
  } catch (Exception e) {
    //need to catch this exception because parent class method don't throws exceptions,
    //but this will never happen in this scenario.
    fail(e.getMessage());
  }
  PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertEquals(trace,
         result);
}
origin: org.kie.workbench/kie-wb-common-ala-registry-vfs

@Test
@Override
public void testRegister() {
  prepareTargetPath();
  pipelineExecutorRegistry.register(trace);
  try {
    verify(registryHelper,
        times(1)).storeEntry(traceTargetPath,
                  trace);
  } catch (Exception e) {
    //need to catch this exception because parent class method don't throws exceptions,
    //but this will never happen in this scenario.
    fail(e.getMessage());
  }
  PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertEquals(trace,
         result);
}
origin: org.guvnor/guvnor-ala-registry-vfs

@Test
@Override
public void testDeregister() {
  prepareTargetPath();
  pipelineExecutorRegistry.register(trace);
  PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertEquals(trace,
         result);
  pipelineExecutorRegistry.deregister(PIPELINE_EXECUTION_ID);
  verify(registryHelper,
      times(1)).deleteBatch(traceTargetPath);
  result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertNull(result);
}
origin: org.kie.workbench/kie-wb-common-ala-registry-vfs

@Test
@Override
public void testDeregister() {
  prepareTargetPath();
  pipelineExecutorRegistry.register(trace);
  PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertEquals(trace,
         result);
  pipelineExecutorRegistry.deregister(PIPELINE_EXECUTION_ID);
  verify(registryHelper,
      times(1)).deleteBatch(traceTargetPath);
  result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertNull(result);
}
origin: org.guvnor/guvnor-ala-spi

@Test
public void testDeregister() {
  pipelineExecutorRegistry.register(trace);
  PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertEquals(trace,
         result);
  pipelineExecutorRegistry.deregister(trace.getTaskId());
  result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertNull(result);
}
origin: org.kie.workbench/kie-wb-common-ala-spi

@Test
public void testDeregister() {
  pipelineExecutorRegistry.register(trace);
  PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertEquals(trace,
         result);
  pipelineExecutorRegistry.deregister(trace.getTaskId());
  result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertNull(result);
}
org.guvnor.ala.registry.inmemoryInMemoryPipelineExecutorRegistryregister

Popular methods of InMemoryPipelineExecutorRegistry

  • deregister
  • getExecutorTrace
  • <init>
  • getExecutorTraces

Popular in Java

  • Finding current android device location
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
  • compareTo (BigDecimal)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JList (javax.swing)
  • JOptionPane (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now