Search in sources :

Example 1 with TableTestSupport

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);
}
Also used : CyTableManager(org.cytoscape.model.CyTableManager) TableTestSupport(org.cytoscape.model.TableTestSupport) TaskMonitor(org.cytoscape.work.TaskMonitor) NetworkTestSupport(org.cytoscape.model.NetworkTestSupport) CyNetworkFactory(org.cytoscape.model.CyNetworkFactory) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) Before(org.junit.Before)

Example 2 with TableTestSupport

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();
}
Also used : CyNetworkTableManager(org.cytoscape.model.CyNetworkTableManager) CyRootNetworkManager(org.cytoscape.model.subnetwork.CyRootNetworkManager) InputStream(java.io.InputStream) CyNetworkReaderManager(org.cytoscape.io.read.CyNetworkReaderManager) ReadCache(org.cytoscape.io.internal.util.ReadCache) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) GroupUtil(org.cytoscape.io.internal.util.GroupUtil) VizmapReaderManager(org.cytoscape.io.read.VizmapReaderManager) CyPropertyReaderManager(org.cytoscape.io.read.CyPropertyReaderManager) TableTestSupport(org.cytoscape.model.TableTestSupport) SUIDUpdater(org.cytoscape.io.internal.util.SUIDUpdater) CSVCyReaderFactory(org.cytoscape.io.internal.read.datatable.CSVCyReaderFactory) EquationCompiler(org.cytoscape.equations.EquationCompiler) Before(org.junit.Before)

Example 3 with 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);
}
Also used : TableTestSupport(org.cytoscape.model.TableTestSupport) Before(org.junit.Before)

Example 4 with TableTestSupport

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);
}
Also used : NullVisualProperty(org.cytoscape.view.presentation.property.NullVisualProperty) RenderingEngineManager(org.cytoscape.view.presentation.RenderingEngineManager) NetworkTestSupport(org.cytoscape.model.NetworkTestSupport) Properties(java.util.Properties) NetworkViewTestSupport(org.cytoscape.ding.NetworkViewTestSupport) SimpleCyProperty(org.cytoscape.property.SimpleCyProperty) StreamUtilImpl(org.cytoscape.io.internal.util.StreamUtilImpl) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) CyApplicationManager(org.cytoscape.application.CyApplicationManager) TaskIterator(org.cytoscape.work.TaskIterator) CyLayoutAlgorithmManager(org.cytoscape.view.layout.CyLayoutAlgorithmManager) CyTableManager(org.cytoscape.model.CyTableManager) TaskMonitor(org.cytoscape.work.TaskMonitor) TableTestSupport(org.cytoscape.model.TableTestSupport) CyLayoutAlgorithm(org.cytoscape.view.layout.CyLayoutAlgorithm) BasicVisualLexicon(org.cytoscape.view.presentation.property.BasicVisualLexicon) GroupTestSupport(org.cytoscape.group.GroupTestSupport) ReadUtils(org.cytoscape.io.internal.util.ReadUtils) CyNetworkView(org.cytoscape.view.model.CyNetworkView) NetworkViewRenderer(org.cytoscape.application.NetworkViewRenderer) Before(org.junit.Before)

Example 5 with TableTestSupport

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();
}
Also used : CyTableManager(org.cytoscape.model.CyTableManager) TableTestSupport(org.cytoscape.model.TableTestSupport) CyNetworkView(org.cytoscape.view.model.CyNetworkView) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) Before(org.junit.Before)

Aggregations

TableTestSupport (org.cytoscape.model.TableTestSupport)5 Before (org.junit.Before)5 CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)4 CyTableManager (org.cytoscape.model.CyTableManager)3 NetworkTestSupport (org.cytoscape.model.NetworkTestSupport)2 CyNetworkView (org.cytoscape.view.model.CyNetworkView)2 TaskMonitor (org.cytoscape.work.TaskMonitor)2 InputStream (java.io.InputStream)1 Properties (java.util.Properties)1 CyApplicationManager (org.cytoscape.application.CyApplicationManager)1 NetworkViewRenderer (org.cytoscape.application.NetworkViewRenderer)1 NetworkViewTestSupport (org.cytoscape.ding.NetworkViewTestSupport)1 EquationCompiler (org.cytoscape.equations.EquationCompiler)1 GroupTestSupport (org.cytoscape.group.GroupTestSupport)1 CSVCyReaderFactory (org.cytoscape.io.internal.read.datatable.CSVCyReaderFactory)1 GroupUtil (org.cytoscape.io.internal.util.GroupUtil)1 ReadCache (org.cytoscape.io.internal.util.ReadCache)1 ReadUtils (org.cytoscape.io.internal.util.ReadUtils)1 SUIDUpdater (org.cytoscape.io.internal.util.SUIDUpdater)1 StreamUtilImpl (org.cytoscape.io.internal.util.StreamUtilImpl)1