Search in sources :

Example 6 with CyTableFactoryImpl

use of org.cytoscape.model.internal.CyTableFactoryImpl 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());
}
Also used : CyTableFactoryImpl(org.cytoscape.model.internal.CyTableFactoryImpl) Interpreter(org.cytoscape.equations.Interpreter) CyNetworkManagerImpl(org.cytoscape.model.internal.CyNetworkManagerImpl) CyNetworkTableManagerImpl(org.cytoscape.model.internal.CyNetworkTableManagerImpl) CyRootNetworkImpl(org.cytoscape.model.internal.CyRootNetworkImpl) InterpreterImpl(org.cytoscape.equations.internal.interpreter.InterpreterImpl) CyTableManagerImpl(org.cytoscape.model.internal.CyTableManagerImpl) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) Before(org.junit.Before)

Aggregations

CyNetworkManagerImpl (org.cytoscape.model.internal.CyNetworkManagerImpl)6 CyNetworkTableManagerImpl (org.cytoscape.model.internal.CyNetworkTableManagerImpl)6 CyTableFactoryImpl (org.cytoscape.model.internal.CyTableFactoryImpl)6 CyTableManagerImpl (org.cytoscape.model.internal.CyTableManagerImpl)6 Interpreter (org.cytoscape.equations.Interpreter)4 InterpreterImpl (org.cytoscape.equations.internal.interpreter.InterpreterImpl)4 CyRootNetworkImpl (org.cytoscape.model.internal.CyRootNetworkImpl)4 CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)4 Before (org.junit.Before)4 DummyCyEventHelper (org.cytoscape.event.DummyCyEventHelper)3 EquationCompiler (org.cytoscape.equations.EquationCompiler)2 EquationCompilerImpl (org.cytoscape.equations.internal.EquationCompilerImpl)2 EquationParserImpl (org.cytoscape.equations.internal.EquationParserImpl)2 CyNetworkFactoryImpl (org.cytoscape.model.internal.CyNetworkFactoryImpl)2 CyEventHelper (org.cytoscape.event.CyEventHelper)1 CyNetworkNaming (org.cytoscape.session.CyNetworkNaming)1