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

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

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

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);
}
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.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.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

@Override
public void deregister(final String taskId) {
  checkNotNull("taskId",
         taskId);
  final Path path = buildTracePath(taskId);
  registryHelper.deleteBatch(path);
  super.deregister(taskId);
}
origin: org.kie.workbench/kie-wb-common-ala-registry-vfs

@Test
public void testInit() throws Exception {
  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);
  }
  when(registryHelper.readEntries(registryRoot,
                  VFSRegistryHelper.BySuffixFilter.newFilter(TRACE_SUFFIX))).thenReturn(traces);
  ((VFSPipelineExecutorRegistry) pipelineExecutorRegistry).init();
  verify(registryHelper,
      times(2)).ensureDirectory(PIPELINE_EXECUTOR_REGISTRY_PATH);
  verify(registryHelper,
      times(2)).readEntries(registryRoot,
                 VFSRegistryHelper.BySuffixFilter.newFilter(TRACE_SUFFIX));
  for (Object trace : traces) {
    PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(((PipelineExecutorTrace) trace).getTaskId());
    assertNotNull(result);
    assertEquals(trace,
           result);
  }
}
origin: org.guvnor/guvnor-ala-spi

@Before
public void setUp() {
  trace = mock(PipelineExecutorTrace.class);
  when(trace.getTaskId()).thenReturn(PIPELINE_EXECUTION_ID);
  pipelineExecutorRegistry = new InMemoryPipelineExecutorRegistry();
}
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-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.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.guvnor/guvnor-ala-registry-vfs

@Test
public void testInit() throws Exception {
  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);
  }
  when(registryHelper.readEntries(registryRoot,
                  VFSRegistryHelper.BySuffixFilter.newFilter(TRACE_SUFFIX))).thenReturn(traces);
  ((VFSPipelineExecutorRegistry) pipelineExecutorRegistry).init();
  verify(registryHelper,
      times(2)).ensureDirectory(PIPELINE_EXECUTOR_REGISTRY_PATH);
  verify(registryHelper,
      times(2)).readEntries(registryRoot,
                 VFSRegistryHelper.BySuffixFilter.newFilter(TRACE_SUFFIX));
  for (Object trace : traces) {
    PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(((PipelineExecutorTrace) trace).getTaskId());
    assertNotNull(result);
    assertEquals(trace,
           result);
  }
}
origin: org.kie.workbench/kie-wb-common-ala-spi

@Before
public void setUp() {
  trace = mock(PipelineExecutorTrace.class);
  when(trace.getTaskId()).thenReturn(PIPELINE_EXECUTION_ID);
  pipelineExecutorRegistry = new InMemoryPipelineExecutorRegistry();
}
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.guvnor/guvnor-ala-spi

@Test
public void testGetExecutorTrace() {
  pipelineExecutorRegistry.register(trace);
  PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertEquals(trace,
         result);
}
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.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-spi

@Test
public void testRegister() {
  pipelineExecutorRegistry.register(trace);
  PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
  assertEquals(trace,
         result);
}
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
@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-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);
}
org.guvnor.ala.registry.inmemoryInMemoryPipelineExecutorRegistry

Most used methods

  • deregister
  • register
  • getExecutorTrace
  • <init>
  • getExecutorTraces

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • requestLocationUpdates (LocationManager)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • JCheckBox (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top 12 Jupyter Notebook extensions
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