use of org.cytoscape.event.DummyCyEventHelper in project cytoscape-impl by cytoscape.
the class InDegreeTest method init.
@Before
public void init() {
final CyNode node = mock(CyNode.class);
when(node.getSUID()).thenReturn(101L);
final List<CyEdge> edgeList = mock(List.class);
when(edgeList.size()).thenReturn(3);
final CyNetwork network = mock(CyNetwork.class);
when(network.getAdjacentEdgeList(node, CyEdge.Type.INCOMING)).thenReturn(edgeList);
when(network.getNode(101L)).thenReturn(node);
Collection<CyNode> nodes = new ArrayList<CyNode>(1);
nodes.add(node);
applicationManager = mock(CyApplicationManager.class);
when(applicationManager.getCurrentNetwork()).thenReturn(network);
eventHelper = new DummyCyEventHelper();
serviceRegistrar = mock(CyServiceRegistrar.class);
when(serviceRegistrar.getService(CyApplicationManager.class)).thenReturn(applicationManager);
when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
}
use of org.cytoscape.event.DummyCyEventHelper in project cytoscape-impl by cytoscape.
the class SourceIDTest method init.
@Before
public void init() {
final CyNode node = mock(CyNode.class);
when(node.getSUID()).thenReturn(101L);
final List<CyEdge> edgeList = mock(List.class);
when(edgeList.size()).thenReturn(3);
final CyNetwork network = mock(CyNetwork.class);
final CyEdge edge = mock(CyEdge.class);
when(edge.getSUID()).thenReturn(11L);
when(edge.getSource()).thenReturn(node);
Collection<CyEdge> edges = new ArrayList<CyEdge>(1);
edges.add(edge);
when(network.getEdge(11L)).thenReturn(edge);
applicationManager = mock(CyApplicationManager.class);
when(applicationManager.getCurrentNetwork()).thenReturn(network);
eventHelper = new DummyCyEventHelper();
serviceRegistrar = mock(CyServiceRegistrar.class);
when(serviceRegistrar.getService(CyApplicationManager.class)).thenReturn(applicationManager);
when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
}
use of org.cytoscape.event.DummyCyEventHelper in project cytoscape-impl by cytoscape.
the class InterpreterTest method init.
@Before
public void init() {
eventHelper = new DummyCyEventHelper();
serviceRegistrar = mock(CyServiceRegistrar.class);
when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
parser = new EquationParserImpl(serviceRegistrar);
compiler = new EquationCompilerImpl(parser);
interpreter = new InterpreterImpl();
}
use of org.cytoscape.event.DummyCyEventHelper in project cytoscape-impl by cytoscape.
the class AttribParserTest method init.
@Before
public void init() {
eventHelper = new DummyCyEventHelper();
serviceRegistrar = mock(CyServiceRegistrar.class);
when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
parser = new EquationParserImpl(serviceRegistrar);
}
use of org.cytoscape.event.DummyCyEventHelper in project cytoscape-impl by cytoscape.
the class CySubNetworkCyTableManagerTest method setUp.
@Before
public void setUp() {
final CyEventHelper eh = new DummyCyEventHelper();
final CyNetworkNaming namingUtil = mock(CyNetworkNaming.class);
final CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
final EquationCompiler compiler = new EquationCompilerImpl(new EquationParserImpl(serviceRegistrar));
final Interpreter interpreter = new InterpreterImpl();
when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eh);
when(serviceRegistrar.getService(CyNetworkNaming.class)).thenReturn(namingUtil);
when(serviceRegistrar.getService(EquationCompiler.class)).thenReturn(compiler);
when(serviceRegistrar.getService(Interpreter.class)).thenReturn(interpreter);
networkTableMgr = new CyNetworkTableManagerImpl();
networkManager = new CyNetworkManagerImpl(serviceRegistrar);
mgr = new CyTableManagerImpl(networkTableMgr, networkManager, serviceRegistrar);
CyTableFactoryImpl tableFactory = new CyTableFactoryImpl(eh, serviceRegistrar);
CyRootNetworkImpl baseNet = new CyRootNetworkImpl(eh, (CyTableManagerImpl) mgr, networkTableMgr, tableFactory, serviceRegistrar, true, SavePolicy.DO_NOT_SAVE);
// This is a different subnetwork and not "baseNetwork" in ArrayGraph.
goodNetwork = baseNet.addSubNetwork();
globalTable = tableFactory.createTable("test table", CyIdentifiable.SUID, Long.class, true, true);
networkManager.addNetwork(goodNetwork);
assertNotNull(globalTable);
assertNotNull(goodNetwork);
assertEquals(1, networkManager.getNetworkSet().size());
}
Aggregations