use of org.cytoscape.event.DummyCyEventHelper in project cytoscape-impl by cytoscape.
the class CyTableTest method setUp.
@Before
public void setUp() {
eventHelper = new DummyCyEventHelper();
compiler = new EquationCompilerImpl(new EquationParserImpl(serviceRegistrar));
final Interpreter interpreter = new InterpreterImpl();
when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
when(serviceRegistrar.getService(CyNetworkNaming.class)).thenReturn(namingUtil);
when(serviceRegistrar.getService(EquationCompiler.class)).thenReturn(compiler);
when(serviceRegistrar.getService(Interpreter.class)).thenReturn(interpreter);
table = new CyTableImpl("homer", CyIdentifiable.SUID, Long.class, false, true, SavePolicy.SESSION_FILE, eventHelper, ColumnDataFactory.createDefaultFactory(), interpreter, 1000);
attrs = table.getRow(1L);
table2 = new CyTableImpl("marge", CyIdentifiable.SUID, Long.class, false, true, SavePolicy.SESSION_FILE, eventHelper, ColumnDataFactory.createDefaultFactory(), interpreter, 1000);
CyTableManagerImpl tblMgr = new CyTableManagerImpl(new CyNetworkTableManagerImpl(), new CyNetworkManagerImpl(serviceRegistrar), serviceRegistrar);
tblMgr.addTable(table);
((CyTableImpl) table).handleEvent(new TableAddedEvent(tblMgr, table));
tblMgr.addTable(table2);
((CyTableImpl) table2).handleEvent(new TableAddedEvent(tblMgr, table2));
}
use of org.cytoscape.event.DummyCyEventHelper in project cytoscape-impl by cytoscape.
the class CySubNetworkTest method setUp.
@Before
public void setUp() {
deh = new DummyCyEventHelper(true);
deh2 = new DummyCyEventHelper(false);
root = TestCyNetworkFactory.getPublicRootInstance(deh);
root2 = TestCyNetworkFactory.getPublicRootInstance(deh2);
}
use of org.cytoscape.event.DummyCyEventHelper in project cytoscape-impl by cytoscape.
the class DegreeTest 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.ANY)).thenReturn(edgeList);
when(network.getNode(101L)).thenReturn(node);
Collection<CyNode> nodes = new ArrayList<>(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 TargetIDTest 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.getTarget()).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 TestCyNetworkFactory method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
eh = new DummyCyEventHelper(false);
Interpreter interpreter = new InterpreterImpl();
EquationCompiler compiler = new EquationCompilerImpl(new EquationParserImpl(serviceRegistrar));
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);
netTblMgr = new CyNetworkTableManagerImpl();
netMgr = new CyNetworkManagerImpl(serviceRegistrar);
tblMgr = new CyTableManagerImpl(netTblMgr, netMgr, serviceRegistrar);
tblFactory = new CyTableFactoryImpl(eh, serviceRegistrar);
netFactory = new CyNetworkFactoryImpl(eh, tblMgr, netTblMgr, tblFactory, serviceRegistrar);
}
Aggregations