Author: pwang
Date: 2010-10-15 12:05:14 -0700 (Fri, 15 Oct 2010)
New Revision: 22252

Added:
   
core3/core-task-impl/trunk/src/test/java/org/cytoscape/task/internal/setcurren/
   
core3/core-task-impl/trunk/src/test/java/org/cytoscape/task/internal/setcurren/SetCurrentNetworkTaskTest.java
Log:
Original creation

Added: 
core3/core-task-impl/trunk/src/test/java/org/cytoscape/task/internal/setcurren/SetCurrentNetworkTaskTest.java
===================================================================
--- 
core3/core-task-impl/trunk/src/test/java/org/cytoscape/task/internal/setcurren/SetCurrentNetworkTaskTest.java
                               (rev 0)
+++ 
core3/core-task-impl/trunk/src/test/java/org/cytoscape/task/internal/setcurren/SetCurrentNetworkTaskTest.java
       2010-10-15 19:05:14 UTC (rev 22252)
@@ -0,0 +1,30 @@
+package org.cytoscape.task.internal.setcurren;
+
+import static org.mockito.Mockito.*;
+import org.cytoscape.model.CyNetwork;
+import org.cytoscape.session.CyNetworkManager;
+import org.cytoscape.work.TaskMonitor;
+import org.cytoscape.task.internal.setcurrent.SetCurrentNetworkTask;
+import org.junit.Test;
+import java.util.HashSet;
+
+public class SetCurrentNetworkTaskTest {
+
+       @Test
+       public void testRun() throws Exception {
+
+               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(netmgr);
+               t.run(tm);
+
+               verify(netmgr, times(1)).setCurrentNetwork(net.getSUID());
+       }
+}

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to