use of org.cytoscape.model.TableTestSupport in project cytoscape-impl by cytoscape.
the class GeneAssociationReaderTest method setUp.
@Before
public void setUp() throws Exception {
NetworkTestSupport netSupport = new NetworkTestSupport();
TableTestSupport tableSupport = new TableTestSupport();
CyNetworkFactory cyNetworkFactory = netSupport.getNetworkFactory();
tableFactory = tableSupport.getTableFactory();
tableManager = mock(CyTableManager.class);
dag = cyNetworkFactory.createNetwork();
tm = mock(TaskMonitor.class);
serviceRegistrar = mock(CyServiceRegistrar.class);
when(serviceRegistrar.getService(CyTableFactory.class)).thenReturn(tableFactory);
when(serviceRegistrar.getService(CyTableManager.class)).thenReturn(tableManager);
}
use of org.cytoscape.model.TableTestSupport in project cytoscape-impl by cytoscape.
the class Cy3SessionReaderImplTest method setUp.
@Before
public void setUp() {
InputStream is = mock(InputStream.class);
GroupUtil groupUtil = mock(GroupUtil.class);
SUIDUpdater suidUpdater = mock(SUIDUpdater.class);
CyNetworkReaderManager netReaderMgr = mock(CyNetworkReaderManager.class);
CyPropertyReaderManager propReaderMgr = mock(CyPropertyReaderManager.class);
VizmapReaderManager vizmapReaderMgr = mock(VizmapReaderManager.class);
CSVCyReaderFactory csvCyReaderFactory = mock(CSVCyReaderFactory.class);
CyNetworkTableManager netTblMgr = mock(CyNetworkTableManager.class);
CyRootNetworkManager rootNetMgr = mock(CyRootNetworkManager.class);
EquationCompiler compiler = mock(EquationCompiler.class);
CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
when(serviceRegistrar.getService(CyNetworkTableManager.class)).thenReturn(netTblMgr);
when(serviceRegistrar.getService(CyRootNetworkManager.class)).thenReturn(rootNetMgr);
when(serviceRegistrar.getService(EquationCompiler.class)).thenReturn(compiler);
ReadCache cache = new ReadCache(serviceRegistrar);
reader = new Cy3SessionReaderImpl(is, cache, groupUtil, suidUpdater, netReaderMgr, propReaderMgr, vizmapReaderMgr, csvCyReaderFactory, serviceRegistrar);
tblTestSupport = new TableTestSupport();
}
use of org.cytoscape.model.TableTestSupport in project cytoscape-impl by cytoscape.
the class CSVCyReaderTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
TableTestSupport tableTestSupport = new TableTestSupport();
tableFactory = tableTestSupport.getTableFactory();
when(serviceRegistrar.getService(CyTableFactory.class)).thenReturn(tableFactory);
}
use of org.cytoscape.model.TableTestSupport in project cytoscape-impl by cytoscape.
the class AbstractNetworkReaderTest method setUp.
@Before
public void setUp() throws Exception {
taskMonitor = mock(TaskMonitor.class);
CyLayoutAlgorithm def = mock(CyLayoutAlgorithm.class);
Object context = new Object();
when(def.createLayoutContext()).thenReturn(context);
when(def.getDefaultLayoutContext()).thenReturn(context);
when(def.createTaskIterator(Mockito.any(CyNetworkView.class), Mockito.any(Object.class), Mockito.anySet(), Mockito.any(String.class))).thenReturn(new TaskIterator(new SimpleTask()));
layouts = mock(CyLayoutAlgorithmManager.class);
when(layouts.getDefaultLayout()).thenReturn(def);
NetworkTestSupport nts = new NetworkTestSupport();
netFactory = nts.getNetworkFactory();
netManager = nts.getNetworkManager();
rootNetManager = nts.getRootNetworkFactory();
netTableManager = nts.getNetworkTableManager();
TableTestSupport tblTestSupport = new TableTestSupport();
tableFactory = tblTestSupport.getTableFactory();
tableManager = mock(CyTableManager.class);
GroupTestSupport groupTestSupport = new GroupTestSupport();
groupManager = groupTestSupport.getGroupManager();
groupFactory = groupTestSupport.getGroupFactory();
properties = new Properties();
CyProperty<Properties> cyProperties = new SimpleCyProperty<>("Test", properties, Properties.class, SavePolicy.DO_NOT_SAVE);
NetworkViewTestSupport nvts = new NetworkViewTestSupport();
setViewThreshold(DEF_THRESHOLD);
viewFactory = nvts.getNetworkViewFactory();
readUtil = new ReadUtils(new StreamUtilImpl(serviceRegistrar));
defRenderer = mock(NetworkViewRenderer.class);
when(defRenderer.getNetworkViewFactory()).thenReturn(viewFactory);
lexicon = new BasicVisualLexicon(new NullVisualProperty("MINIMAL_ROOT", "Minimal Root Visual Property"));
renderingEngineManager = mock(RenderingEngineManager.class);
when(renderingEngineManager.getDefaultVisualLexicon()).thenReturn(lexicon);
applicationManager = mock(CyApplicationManager.class);
when(applicationManager.getDefaultNetworkViewRenderer()).thenReturn(defRenderer);
serviceRegistrar = mock(CyServiceRegistrar.class);
when(serviceRegistrar.getService(CyProperty.class, "(cyPropertyName=cytoscape3.props)")).thenReturn(cyProperties);
when(serviceRegistrar.getService(CyApplicationManager.class)).thenReturn(applicationManager);
when(serviceRegistrar.getService(CyNetworkFactory.class)).thenReturn(netFactory);
when(serviceRegistrar.getService(CyNetworkViewFactory.class)).thenReturn(viewFactory);
when(serviceRegistrar.getService(CyNetworkManager.class)).thenReturn(netManager);
when(serviceRegistrar.getService(CyNetworkTableManager.class)).thenReturn(netTableManager);
when(serviceRegistrar.getService(CyRootNetworkManager.class)).thenReturn(rootNetManager);
when(serviceRegistrar.getService(CyLayoutAlgorithmManager.class)).thenReturn(layouts);
when(serviceRegistrar.getService(CyTableManager.class)).thenReturn(tableManager);
when(serviceRegistrar.getService(CyTableFactory.class)).thenReturn(tableFactory);
when(serviceRegistrar.getService(CyGroupManager.class)).thenReturn(groupManager);
when(serviceRegistrar.getService(CyGroupFactory.class)).thenReturn(groupFactory);
when(serviceRegistrar.getService(RenderingEngineManager.class)).thenReturn(renderingEngineManager);
}
use of org.cytoscape.model.TableTestSupport in project cytoscape-impl by cytoscape.
the class UnrecognizedVisualPropertyManagerTest method setUp.
@Before
public void setUp() throws Exception {
TableTestSupport tblTestSupport = new TableTestSupport();
tableFactory = tblTestSupport.getTableFactory();
tableManager = mock(CyTableManager.class);
serviceRegistrar = mock(CyServiceRegistrar.class);
when(serviceRegistrar.getService(CyTableFactory.class)).thenReturn(tableFactory);
when(serviceRegistrar.getService(CyTableManager.class)).thenReturn(tableManager);
unrecognizedVisualPropertyMgr = new UnrecognizedVisualPropertyManager(serviceRegistrar);
netView = mock(CyNetworkView.class);
when(netView.getSUID()).thenReturn(101L);
addUnrecognizedVisualProperties();
}
Aggregations