use of org.cytoscape.model.internal.CyTableFactoryImpl 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());
}
use of org.cytoscape.model.internal.CyTableFactoryImpl in project cytoscape-impl by cytoscape.
the class TestCyNetworkFactory method getPublicRootInstance.
public static CyRootNetwork getPublicRootInstance(DummyCyEventHelper deh, SavePolicy policy) {
CyServiceRegistrar serviceRegistrar = mockCyServiceRegistrar(deh);
final CyNetworkTableManagerImpl ntm = new CyNetworkTableManagerImpl();
final CyTableManagerImpl tm = new CyTableManagerImpl(ntm, new CyNetworkManagerImpl(serviceRegistrar), serviceRegistrar);
final CyTableFactoryImpl tableFactory = new CyTableFactoryImpl(deh, serviceRegistrar);
return new CyRootNetworkImpl(deh, tm, ntm, tableFactory, serviceRegistrar, true, policy);
}
use of org.cytoscape.model.internal.CyTableFactoryImpl in project cytoscape-impl by cytoscape.
the class CyNetworkTableManagerTest method setUp.
@Before
public void setUp() {
super.setUp();
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);
this.mgr = new CyNetworkTableManagerImpl();
this.networkManager = new CyNetworkManagerImpl(serviceRegistrar);
this.tableManager = new CyTableManagerImpl(mgr, networkManager, serviceRegistrar);
this.tableFactory = new CyTableFactoryImpl(eh, serviceRegistrar);
this.networkFactory = new CyNetworkFactoryImpl(eh, tableManager, mgr, tableFactory, serviceRegistrar);
goodNetwork = networkFactory.createNetwork();
}
use of org.cytoscape.model.internal.CyTableFactoryImpl 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);
}
use of org.cytoscape.model.internal.CyTableFactoryImpl 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;
}
Aggregations