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());
}
Aggregations