Search in sources :

Example 1 with SetCurrentNetworkTask

use of org.cytoscape.task.internal.setcurrent.SetCurrentNetworkTask in project cytoscape-impl by cytoscape.

the class SetCurrentNetworkTaskTest method testRun.

@Test
public void testRun() throws Exception {
    CyApplicationManager applicationManager = mock(CyApplicationManager.class);
    CyNetworkManager netmgr = mock(CyNetworkManager.class);
    ;
    TaskMonitor tm = mock(TaskMonitor.class);
    CyNetwork net = mock(CyNetwork.class);
    HashSet<CyNetwork> netSet = new HashSet<CyNetwork>();
    netSet.add(net);
    when(netmgr.getNetworkSet()).thenReturn(netSet);
    SetCurrentNetworkTask t = new SetCurrentNetworkTask(applicationManager, netmgr);
    t.run(tm);
    verify(applicationManager, times(1)).setCurrentNetwork(net);
}
Also used : CyApplicationManager(org.cytoscape.application.CyApplicationManager) CyNetworkManager(org.cytoscape.model.CyNetworkManager) TaskMonitor(org.cytoscape.work.TaskMonitor) SetCurrentNetworkTask(org.cytoscape.task.internal.setcurrent.SetCurrentNetworkTask) CyNetwork(org.cytoscape.model.CyNetwork) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

HashSet (java.util.HashSet)1 CyApplicationManager (org.cytoscape.application.CyApplicationManager)1 CyNetwork (org.cytoscape.model.CyNetwork)1 CyNetworkManager (org.cytoscape.model.CyNetworkManager)1 SetCurrentNetworkTask (org.cytoscape.task.internal.setcurrent.SetCurrentNetworkTask)1 TaskMonitor (org.cytoscape.work.TaskMonitor)1 Test (org.junit.Test)1