Search in sources :

Example 11 with DummyCyEventHelper

use of org.cytoscape.event.DummyCyEventHelper in project cytoscape-impl by cytoscape.

the class TestCyNetworkFactory method getPrivateRootInstance.

public static CyRootNetwork getPrivateRootInstance(SavePolicy policy) {
    DummyCyEventHelper deh = new DummyCyEventHelper();
    CyServiceRegistrar serviceRegistrar = mockCyServiceRegistrar(deh);
    CyNetworkTableManagerImpl ntm = new CyNetworkTableManagerImpl();
    CyTableManagerImpl tm = new CyTableManagerImpl(ntm, new CyNetworkManagerImpl(serviceRegistrar), serviceRegistrar);
    CyRootNetworkImpl ar = new CyRootNetworkImpl(deh, tm, ntm, new CyTableFactoryImpl(deh, serviceRegistrar), serviceRegistrar, false, policy);
    return ar;
}
Also used : CyTableFactoryImpl(org.cytoscape.model.internal.CyTableFactoryImpl) CyNetworkManagerImpl(org.cytoscape.model.internal.CyNetworkManagerImpl) CyNetworkTableManagerImpl(org.cytoscape.model.internal.CyNetworkTableManagerImpl) CyRootNetworkImpl(org.cytoscape.model.internal.CyRootNetworkImpl) DummyCyEventHelper(org.cytoscape.event.DummyCyEventHelper) CyTableManagerImpl(org.cytoscape.model.internal.CyTableManagerImpl) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar)

Example 12 with DummyCyEventHelper

use of org.cytoscape.event.DummyCyEventHelper in project cytoscape-impl by cytoscape.

the class EquationTest method setUp.

@Before
public void setUp() {
    support = new TableTestSupport();
    eventHelper = new DummyCyEventHelper();
    serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
    parser = new EquationParserImpl(serviceRegistrar);
}
Also used : EquationParserImpl(org.cytoscape.equations.internal.EquationParserImpl) DummyCyEventHelper(org.cytoscape.event.DummyCyEventHelper) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) Before(org.junit.Before)

Example 13 with DummyCyEventHelper

use of org.cytoscape.event.DummyCyEventHelper in project cytoscape-impl by cytoscape.

the class OutDegreeTest method init.

@Before
public void init() {
    final CyNode node = mock(CyNode.class);
    when(node.getSUID()).thenReturn(101L);
    final List<CyEdge> edgeList = mock(List.class);
    when(edgeList.size()).thenReturn(3);
    final CyNetwork network = mock(CyNetwork.class);
    when(network.getAdjacentEdgeList(node, CyEdge.Type.OUTGOING)).thenReturn(edgeList);
    when(network.getNode(101L)).thenReturn(node);
    Collection<CyNode> nodes = new ArrayList<CyNode>(1);
    nodes.add(node);
    applicationManager = mock(CyApplicationManager.class);
    when(applicationManager.getCurrentNetwork()).thenReturn(network);
    eventHelper = new DummyCyEventHelper();
    serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(CyApplicationManager.class)).thenReturn(applicationManager);
    when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
}
Also used : CyApplicationManager(org.cytoscape.application.CyApplicationManager) ArrayList(java.util.ArrayList) CyNetwork(org.cytoscape.model.CyNetwork) CyNode(org.cytoscape.model.CyNode) DummyCyEventHelper(org.cytoscape.event.DummyCyEventHelper) CyEdge(org.cytoscape.model.CyEdge) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) Before(org.junit.Before)

Example 14 with DummyCyEventHelper

use of org.cytoscape.event.DummyCyEventHelper in project cytoscape-impl by cytoscape.

the class TestCyGroupFactory method getFactory.

public static CyGroupFactory getFactory() {
    final DummyCyEventHelper eventHelper = new DummyCyEventHelper();
    final VisualMappingManager vmMgr = mock(VisualMappingManager.class);
    final CyNetworkViewManager netViewMgr = mock(CyNetworkViewManager.class);
    final CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
    when(serviceRegistrar.getService(VisualMappingManager.class)).thenReturn(vmMgr);
    when(serviceRegistrar.getService(CyNetworkViewManager.class)).thenReturn(netViewMgr);
    final CyGroupManagerImpl mgr = new CyGroupManagerImpl(serviceRegistrar);
    final LockedVisualPropertiesManager lvpMgr = new LockedVisualPropertiesManager(serviceRegistrar);
    final CyGroupFactoryImpl groupFactory = new CyGroupFactoryImpl(mgr, lvpMgr);
    return groupFactory;
}
Also used : CyNetworkViewManager(org.cytoscape.view.model.CyNetworkViewManager) CyGroupManagerImpl(org.cytoscape.group.internal.CyGroupManagerImpl) LockedVisualPropertiesManager(org.cytoscape.group.internal.LockedVisualPropertiesManager) DummyCyEventHelper(org.cytoscape.event.DummyCyEventHelper) VisualMappingManager(org.cytoscape.view.vizmap.VisualMappingManager) CyGroupFactoryImpl(org.cytoscape.group.internal.CyGroupFactoryImpl) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar)

Aggregations

DummyCyEventHelper (org.cytoscape.event.DummyCyEventHelper)14 Before (org.junit.Before)12 CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)11 ArrayList (java.util.ArrayList)5 CyApplicationManager (org.cytoscape.application.CyApplicationManager)5 EquationParserImpl (org.cytoscape.equations.internal.EquationParserImpl)5 CyEdge (org.cytoscape.model.CyEdge)5 CyNetwork (org.cytoscape.model.CyNetwork)5 CyNode (org.cytoscape.model.CyNode)5 EquationCompilerImpl (org.cytoscape.equations.internal.EquationCompilerImpl)4 CyNetworkManagerImpl (org.cytoscape.model.internal.CyNetworkManagerImpl)4 CyNetworkTableManagerImpl (org.cytoscape.model.internal.CyNetworkTableManagerImpl)4 CyTableManagerImpl (org.cytoscape.model.internal.CyTableManagerImpl)4 Interpreter (org.cytoscape.equations.Interpreter)3 InterpreterImpl (org.cytoscape.equations.internal.interpreter.InterpreterImpl)3 CyTableFactoryImpl (org.cytoscape.model.internal.CyTableFactoryImpl)3 EquationCompiler (org.cytoscape.equations.EquationCompiler)2 CyRootNetworkImpl (org.cytoscape.model.internal.CyRootNetworkImpl)2 CyEventHelper (org.cytoscape.event.CyEventHelper)1 CyGroupFactoryImpl (org.cytoscape.group.internal.CyGroupFactoryImpl)1