Search in sources :

Example 6 with SimpleCyProperty

use of org.cytoscape.property.SimpleCyProperty in project cytoscape-impl by cytoscape.

the class GenericXGMMLFileFilterTest method setUp.

@Before
public void setUp() {
    Set<String> extensions = new HashSet<String>();
    Set<String> contentTypes = new HashSet<String>();
    String description = "XGMML";
    Properties props = new Properties();
    CyProperty<Properties> cyProperties = new SimpleCyProperty<Properties>("test", props, Properties.class, SavePolicy.DO_NOT_SAVE);
    CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(CyProperty.class, "(cyPropertyName=cytoscape3.props)")).thenReturn(cyProperties);
    filter = new GenericXGMMLFileFilter(extensions, contentTypes, description, DataCategory.NETWORK, new StreamUtilImpl(serviceRegistrar));
}
Also used : Properties(java.util.Properties) SimpleCyProperty(org.cytoscape.property.SimpleCyProperty) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) StreamUtilImpl(org.cytoscape.io.internal.util.StreamUtilImpl) HashSet(java.util.HashSet) Before(org.junit.Before)

Example 7 with SimpleCyProperty

use of org.cytoscape.property.SimpleCyProperty in project cytoscape-impl by cytoscape.

the class GMLFileFilterTest method setUp.

@Before
public void setUp() {
    Set<String> extensions = new HashSet<String>();
    Set<String> contentTypes = new HashSet<String>();
    String description = "GML";
    Properties properties = new Properties();
    CyProperty<Properties> cyProperties = new SimpleCyProperty<Properties>("test", properties, Properties.class, SavePolicy.DO_NOT_SAVE);
    CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(CyProperty.class, "(cyPropertyName=cytoscape3.props)")).thenReturn(cyProperties);
    filter = new GMLFileFilter(extensions, contentTypes, description, DataCategory.NETWORK, new StreamUtilImpl(serviceRegistrar));
}
Also used : Properties(java.util.Properties) SimpleCyProperty(org.cytoscape.property.SimpleCyProperty) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) StreamUtilImpl(org.cytoscape.io.internal.util.StreamUtilImpl) HashSet(java.util.HashSet) Before(org.junit.Before)

Example 8 with SimpleCyProperty

use of org.cytoscape.property.SimpleCyProperty in project cytoscape-impl by cytoscape.

the class SessionFileFilterTest method setUp.

@Before
public void setUp() {
    extensions = new HashSet<String>();
    contentTypes = new HashSet<String>();
    Properties properties = new Properties();
    CyProperty<Properties> cyProperties = new SimpleCyProperty<Properties>("test", properties, Properties.class, SavePolicy.DO_NOT_SAVE);
    CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(CyProperty.class, "(cyPropertyName=cytoscape3.props)")).thenReturn(cyProperties);
    streamUtil = new StreamUtilImpl(serviceRegistrar);
}
Also used : Properties(java.util.Properties) SimpleCyProperty(org.cytoscape.property.SimpleCyProperty) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) StreamUtilImpl(org.cytoscape.io.internal.util.StreamUtilImpl) Before(org.junit.Before)

Example 9 with SimpleCyProperty

use of org.cytoscape.property.SimpleCyProperty in project cytoscape-api by cytoscape.

the class CySessionTest method getFakeProps.

private Set<CyProperty<?>> getFakeProps() {
    Set<CyProperty<?>> set = new HashSet<CyProperty<?>>();
    Properties p = new Properties();
    p.setProperty("key1", "value1");
    p.setProperty("key2", "value2");
    CyProperty<Properties> cyProps = new SimpleCyProperty<Properties>("test", p, Properties.class, CyProperty.SavePolicy.SESSION_FILE);
    set.add(cyProps);
    return set;
}
Also used : SimpleCyProperty(org.cytoscape.property.SimpleCyProperty) CyProperty(org.cytoscape.property.CyProperty) Properties(java.util.Properties) SimpleCyProperty(org.cytoscape.property.SimpleCyProperty) HashSet(java.util.HashSet)

Example 10 with SimpleCyProperty

use of org.cytoscape.property.SimpleCyProperty 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)

Aggregations

SimpleCyProperty (org.cytoscape.property.SimpleCyProperty)10 Properties (java.util.Properties)9 StreamUtilImpl (org.cytoscape.io.internal.util.StreamUtilImpl)4 CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)4 Before (org.junit.Before)4 HashSet (java.util.HashSet)3 CyPropertyReader (org.cytoscape.io.read.CyPropertyReader)3 Bookmarks (org.cytoscape.property.bookmark.Bookmarks)2 TaskIterator (org.cytoscape.work.TaskIterator)2 File (java.io.File)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 Matcher (java.util.regex.Matcher)1 CyApplicationManager (org.cytoscape.application.CyApplicationManager)1 NetworkViewRenderer (org.cytoscape.application.NetworkViewRenderer)1 NetworkViewTestSupport (org.cytoscape.ding.NetworkViewTestSupport)1 GroupTestSupport (org.cytoscape.group.GroupTestSupport)1 ReadUtils (org.cytoscape.io.internal.util.ReadUtils)1 CyTableManager (org.cytoscape.model.CyTableManager)1 NetworkTestSupport (org.cytoscape.model.NetworkTestSupport)1