use of org.cytoscape.model.internal.CyNetworkManagerImpl in project cytoscape-impl by cytoscape.
the class TestCyNetworkFactory method getPrivateRootInstance.
public static CyRootNetwork getPrivateRootInstance(SavePolicy policy) {
DummyCyEventHelper deh = new DummyCyEventHelper();
CyServiceRegistrar serviceRegistrar = mockCyServiceRegistrar(deh);
CyNetworkTableManagerImpl ntm = new CyNetworkTableManagerImpl();
CyTableManagerImpl tm = new CyTableManagerImpl(ntm, new CyNetworkManagerImpl(serviceRegistrar), serviceRegistrar);
CyRootNetworkImpl ar = new CyRootNetworkImpl(deh, tm, ntm, new CyTableFactoryImpl(deh, serviceRegistrar), serviceRegistrar, false, policy);
return ar;
}
use of org.cytoscape.model.internal.CyNetworkManagerImpl in project cytoscape-impl by cytoscape.
the class CyTableManagerTest method setUp.
@Before
public void setUp() {
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);
networkTableMgr = new CyNetworkTableManagerImpl();
networkManager = new CyNetworkManagerImpl(serviceRegistrar);
mgr = new CyTableManagerImpl(networkTableMgr, networkManager, serviceRegistrar);
assertNotNull(mgr);
assertEquals(0, mgr.getAllTables(true).size());
final CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
final CyTableFactoryImpl tableFactory = new CyTableFactoryImpl(eventHelper, serviceRegistrar);
goodNetwork = new CyRootNetworkImpl(eventHelper, (CyTableManagerImpl) mgr, networkTableMgr, tableFactory, serviceRegistrar, true, SavePolicy.DO_NOT_SAVE).getBaseNetwork();
networkManager.addNetwork(goodNetwork);
globalTable = tableFactory.createTable("test table", CyIdentifiable.SUID, Long.class, true, true);
assertNotNull(globalTable);
assertNotNull(goodNetwork);
assertEquals(1, networkManager.getNetworkSet().size());
}
use of org.cytoscape.model.internal.CyNetworkManagerImpl in project cytoscape-impl by cytoscape.
the class TableTestSupportTest method setUp.
@Before
public void setUp() {
eventHelper = support.getDummyCyEventHelper();
EquationCompiler compiler = new EquationCompilerImpl(new EquationParserImpl(serviceRegistrar));
when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
when(serviceRegistrar.getService(CyNetworkNaming.class)).thenReturn(namingUtil);
when(serviceRegistrar.getService(EquationCompiler.class)).thenReturn(compiler);
table = factory.createTable(Integer.toString(rand.nextInt(10000)), CyIdentifiable.SUID, Long.class, false, true);
table2 = factory.createTable(Integer.toString(rand.nextInt(10000)), CyIdentifiable.SUID, Long.class, false, true);
attrs = table.getRow(1l);
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));
}
Aggregations