use of org.cytoscape.task.internal.export.network.LoadNetworkFileTask in project cytoscape-impl by cytoscape.
the class LoadNetworkFileTaskTest method testRun.
@Test
public void testRun() throws Exception {
TaskFactory factory = new LoadNetworkFileTaskFactoryImpl(serviceRegistrar);
TaskIterator ti = factory.createTaskIterator();
TaskMonitor tm = mock(TaskMonitor.class);
boolean first = true;
while (ti.hasNext()) {
Task t = ti.next();
if (first) {
((LoadNetworkFileTask) t).file = file;
first = false;
}
t.run(tm);
}
verify(netManager).addNetwork(net, false);
// verify(networkViewManager).addNetworkView(view);
verify(tm, atLeast(1)).setProgress(1.0);
}
use of org.cytoscape.task.internal.export.network.LoadNetworkFileTask in project cytoscape-impl by cytoscape.
the class LoadNetworkFileTaskTest method testNullFile.
@Test(expected = NullPointerException.class)
public void testNullFile() throws Exception {
TaskFactory factory = new LoadNetworkFileTaskFactoryImpl(serviceRegistrar);
TaskIterator ti = factory.createTaskIterator();
TaskMonitor tm = mock(TaskMonitor.class);
boolean first = true;
while (ti.hasNext()) {
Task t = ti.next();
if (first) {
((LoadNetworkFileTask) t).file = null;
first = false;
}
t.run(tm);
}
}
Aggregations