use of org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry in project kie-wb-common by kiegroup.
the class WorkItemDefinitionBackendRegistryTest method init.
@Before
public void init() {
WorkItemDefinitionCacheRegistry registry = new WorkItemDefinitionCacheRegistry();
WorkItemDefinitionMetadataRegistry metadataRegistry = new WorkItemDefinitionMetadataRegistry();
when(metadata.getRoot()).thenReturn(root);
when(service.search(eq(root))).thenReturn(Arrays.asList(DEF1, DEF2));
this.tested = new WorkItemDefinitionBackendRegistry(registry, service, metadataRegistry);
tested.init();
}
use of org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry in project kie-wb-common by kiegroup.
the class WorkItemDefinitionClientRegistry method obtainRegistry.
private WorkItemDefinitionCacheRegistry obtainRegistry(final String sessionUUID) {
WorkItemDefinitionCacheRegistry registry = sessionRegistries.get(sessionUUID);
if (null == registry) {
registry = registryInstanceSupplier.get();
sessionRegistries.put(sessionUUID, registry);
}
return registry;
}
use of org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry in project kie-wb-common by kiegroup.
the class WorkItemDefinitionProjectClientRegistryTest method testGetCurrentSessionRegistry.
@Test
@SuppressWarnings("unchecked")
public void testGetCurrentSessionRegistry() {
ClientSession session = mock(ClientSession.class);
CanvasHandler canvasHandler = mock(CanvasHandler.class);
Diagram diagram = mock(Diagram.class);
when(session.getCanvasHandler()).thenReturn(canvasHandler);
when(canvasHandler.getDiagram()).thenReturn(diagram);
when(diagram.getMetadata()).thenReturn(metadata);
when(sessionManager.getCurrentSession()).thenReturn(session);
tested.call(metadata);
verify(index, times(1)).put(eq(metadata), eq(registry));
verify(registry, times(1)).register(eq(WID));
WorkItemDefinitionCacheRegistry currentSessionRegistry = tested.getCurrentSessionRegistry();
assertEquals(registry, currentSessionRegistry);
}
use of org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry in project kie-wb-common by kiegroup.
the class WorkItemDefinitionProjectServiceTest method init.
@Before
public void init() {
when(vfsService.search(eq(metadata))).thenReturn(Arrays.asList(wid1, wid2));
registry = new WorkItemDefinitionCacheRegistry();
tested = new WorkItemDefinitionProjectService(registry, vfsService, deployServices, deployPredicate);
}
use of org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry in project kie-wb-common by kiegroup.
the class WorkItemDefinitionClientRegistry method removeRegistry.
private void removeRegistry(final String sessionUUID) {
final WorkItemDefinitionCacheRegistry registry = sessionRegistries.remove(sessionUUID);
if (null != registry) {
registry.clear();
registryInstanceDestroyer.accept(registry);
}
}
Aggregations