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