Search in sources :

Example 46 with CyServiceRegistrar

use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.

the class HideSelectedNodesTaskFactoryTest method testRun.

@Test
public void testRun() throws Exception {
    UndoSupport undoSupport = mock(UndoSupport.class);
    CyEventHelper eventHelper = mock(CyEventHelper.class);
    VisualMappingManager vmMgr = mock(VisualMappingManager.class);
    CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(UndoSupport.class)).thenReturn(undoSupport);
    when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
    when(serviceRegistrar.getService(VisualMappingManager.class)).thenReturn(vmMgr);
    HideSelectedNodesTaskFactoryImpl factory = new HideSelectedNodesTaskFactoryImpl(serviceRegistrar);
    CyNetworkView view = mock(CyNetworkView.class);
    TaskIterator ti = factory.createTaskIterator(view);
    assertNotNull(ti);
    assertTrue(ti.hasNext());
    Task t = ti.next();
    assertNotNull(t);
}
Also used : CyEventHelper(org.cytoscape.event.CyEventHelper) Task(org.cytoscape.work.Task) TaskIterator(org.cytoscape.work.TaskIterator) VisualMappingManager(org.cytoscape.view.vizmap.VisualMappingManager) UndoSupport(org.cytoscape.work.undo.UndoSupport) CyNetworkView(org.cytoscape.view.model.CyNetworkView) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) Test(org.junit.Test)

Example 47 with CyServiceRegistrar

use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.

the class UnHideAllNodesTaskFactoryTest method testRun.

@Test
public void testRun() throws Exception {
    UndoSupport undoSupport = mock(UndoSupport.class);
    CyEventHelper eventHelper = mock(CyEventHelper.class);
    VisualMappingManager vmMgr = mock(VisualMappingManager.class);
    CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(UndoSupport.class)).thenReturn(undoSupport);
    when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
    when(serviceRegistrar.getService(VisualMappingManager.class)).thenReturn(vmMgr);
    UnHideAllNodesTaskFactoryImpl factory = new UnHideAllNodesTaskFactoryImpl(serviceRegistrar);
    CyNetworkView view = mock(CyNetworkView.class);
    TaskIterator ti = factory.createTaskIterator(view);
    assertNotNull(ti);
    assertTrue(ti.hasNext());
    Task t = ti.next();
    assertNotNull(t);
}
Also used : CyEventHelper(org.cytoscape.event.CyEventHelper) Task(org.cytoscape.work.Task) TaskIterator(org.cytoscape.work.TaskIterator) VisualMappingManager(org.cytoscape.view.vizmap.VisualMappingManager) UndoSupport(org.cytoscape.work.undo.UndoSupport) CyNetworkView(org.cytoscape.view.model.CyNetworkView) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) Test(org.junit.Test)

Example 48 with CyServiceRegistrar

use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.

the class HideSelectedEdgesTaskFactoryTest method testRun.

@Test
public void testRun() throws Exception {
    UndoSupport undoSupport = mock(UndoSupport.class);
    CyEventHelper eventHelper = mock(CyEventHelper.class);
    VisualMappingManager vmMgr = mock(VisualMappingManager.class);
    CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(UndoSupport.class)).thenReturn(undoSupport);
    when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
    when(serviceRegistrar.getService(VisualMappingManager.class)).thenReturn(vmMgr);
    HideSelectedEdgesTaskFactoryImpl factory = new HideSelectedEdgesTaskFactoryImpl(serviceRegistrar);
    CyNetworkView view = mock(CyNetworkView.class);
    TaskIterator ti = factory.createTaskIterator(view);
    assertNotNull(ti);
    assertTrue(ti.hasNext());
    Task t = ti.next();
    assertNotNull(t);
}
Also used : CyEventHelper(org.cytoscape.event.CyEventHelper) Task(org.cytoscape.work.Task) TaskIterator(org.cytoscape.work.TaskIterator) VisualMappingManager(org.cytoscape.view.vizmap.VisualMappingManager) UndoSupport(org.cytoscape.work.undo.UndoSupport) CyNetworkView(org.cytoscape.view.model.CyNetworkView) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) Test(org.junit.Test)

Example 49 with CyServiceRegistrar

use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.

the class HideSelectedTaskFactoryTest method testRun.

@Test
public void testRun() throws Exception {
    UndoSupport undoSupport = mock(UndoSupport.class);
    CyEventHelper eventHelper = mock(CyEventHelper.class);
    VisualMappingManager vmMgr = mock(VisualMappingManager.class);
    CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(UndoSupport.class)).thenReturn(undoSupport);
    when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
    when(serviceRegistrar.getService(VisualMappingManager.class)).thenReturn(vmMgr);
    HideSelectedTaskFactoryImpl factory = new HideSelectedTaskFactoryImpl(serviceRegistrar);
    CyNetworkView view = mock(CyNetworkView.class);
    TaskIterator ti = factory.createTaskIterator(view);
    assertNotNull(ti);
    assertTrue(ti.hasNext());
    Task t = ti.next();
    assertNotNull(t);
}
Also used : CyEventHelper(org.cytoscape.event.CyEventHelper) Task(org.cytoscape.work.Task) TaskIterator(org.cytoscape.work.TaskIterator) VisualMappingManager(org.cytoscape.view.vizmap.VisualMappingManager) UndoSupport(org.cytoscape.work.undo.UndoSupport) CyNetworkView(org.cytoscape.view.model.CyNetworkView) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) Test(org.junit.Test)

Example 50 with CyServiceRegistrar

use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.

the class UnHideAllTaskFactoryTest method testRun.

@Test
public void testRun() throws Exception {
    UndoSupport undoSupport = mock(UndoSupport.class);
    CyEventHelper eventHelper = mock(CyEventHelper.class);
    VisualMappingManager vmMgr = mock(VisualMappingManager.class);
    CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(UndoSupport.class)).thenReturn(undoSupport);
    when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
    when(serviceRegistrar.getService(VisualMappingManager.class)).thenReturn(vmMgr);
    UnHideAllTaskFactoryImpl factory = new UnHideAllTaskFactoryImpl(serviceRegistrar);
    CyNetworkView view = mock(CyNetworkView.class);
    TaskIterator ti = factory.createTaskIterator(view);
    assertNotNull(ti);
    assertTrue(ti.hasNext());
    Task t = ti.next();
    assertNotNull(t);
}
Also used : CyEventHelper(org.cytoscape.event.CyEventHelper) Task(org.cytoscape.work.Task) TaskIterator(org.cytoscape.work.TaskIterator) VisualMappingManager(org.cytoscape.view.vizmap.VisualMappingManager) UndoSupport(org.cytoscape.work.undo.UndoSupport) CyNetworkView(org.cytoscape.view.model.CyNetworkView) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) Test(org.junit.Test)

Aggregations

CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)62 Properties (java.util.Properties)32 CyEventHelper (org.cytoscape.event.CyEventHelper)14 VisualMappingManager (org.cytoscape.view.vizmap.VisualMappingManager)13 CyApplicationManager (org.cytoscape.application.CyApplicationManager)12 UndoSupport (org.cytoscape.work.undo.UndoSupport)12 TaskIterator (org.cytoscape.work.TaskIterator)11 CyNetwork (org.cytoscape.model.CyNetwork)10 Task (org.cytoscape.work.Task)10 Before (org.junit.Before)10 Test (org.junit.Test)10 CyNetworkManager (org.cytoscape.model.CyNetworkManager)7 CyNetworkViewManager (org.cytoscape.view.model.CyNetworkViewManager)7 TaskFactory (org.cytoscape.work.TaskFactory)7 CyGroupManager (org.cytoscape.group.CyGroupManager)6 CyNetworkFactory (org.cytoscape.model.CyNetworkFactory)6 CyRootNetworkManager (org.cytoscape.model.subnetwork.CyRootNetworkManager)6 CyNetworkNaming (org.cytoscape.session.CyNetworkNaming)6 RenderingEngineManager (org.cytoscape.view.presentation.RenderingEngineManager)6 CyNetworkView (org.cytoscape.view.model.CyNetworkView)5