use of org.cytoscape.io.internal.util.ReadUtils 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);
}
Aggregations