Search in sources :

Example 46 with CyNetworkManager

use of org.cytoscape.model.CyNetworkManager in project cytoscape-api by cytoscape.

the class NetworkAboutToBeDestroyedEventTest method testGetNetwork.

@Test
public final void testGetNetwork() {
    final CyNetworkManager networkManager = mock(CyNetworkManager.class);
    final CyNetwork network = mock(CyNetwork.class);
    final NetworkAboutToBeDestroyedEvent event = new NetworkAboutToBeDestroyedEvent(networkManager, network);
    assertEquals("Network returned by getNetwork() is *not* the one passed into the constructor!", network, event.getNetwork());
}
Also used : CyNetworkManager(org.cytoscape.model.CyNetworkManager) CyNetwork(org.cytoscape.model.CyNetwork) Test(org.junit.Test)

Example 47 with CyNetworkManager

use of org.cytoscape.model.CyNetworkManager in project cytoscape-api by cytoscape.

the class NetworkAboutToBeDestroyedEventTest method testNullNetworkConstructorFailure.

@Test
public final void testNullNetworkConstructorFailure() {
    final CyNetworkManager networkManager = mock(CyNetworkManager.class);
    try {
        final NetworkAboutToBeDestroyedEvent event = new NetworkAboutToBeDestroyedEvent(networkManager, null);
    } catch (final NullPointerException e) {
        return;
    }
    fail("The expected NullPointerException was *not* triggered!");
}
Also used : CyNetworkManager(org.cytoscape.model.CyNetworkManager) Test(org.junit.Test)

Example 48 with CyNetworkManager

use of org.cytoscape.model.CyNetworkManager in project cytoscape-api by cytoscape.

the class NetworkDestroyedEventTest method testGetNetwork.

@Test
public final void testGetNetwork() {
    final CyNetworkManager networkManager = mock(CyNetworkManager.class);
    final NetworkDestroyedEvent event = new NetworkDestroyedEvent(networkManager);
    assertEquals("NetworkManager returned by getSource() is *not* the one passed into the constructor!", networkManager, event.getSource());
}
Also used : CyNetworkManager(org.cytoscape.model.CyNetworkManager) Test(org.junit.Test)

Example 49 with CyNetworkManager

use of org.cytoscape.model.CyNetworkManager in project cytoscape-api by cytoscape.

the class AbstractNetworkEventTest method testNullNetworkConstructorFailure.

@Test(expected = NullPointerException.class)
public final void testNullNetworkConstructorFailure() {
    final CyNetworkManager networkManager = mock(CyNetworkManager.class);
    new AbstractNetworkEvent(networkManager, Object.class, null);
}
Also used : CyNetworkManager(org.cytoscape.model.CyNetworkManager) Test(org.junit.Test)

Aggregations

CyNetworkManager (org.cytoscape.model.CyNetworkManager)49 CyNetwork (org.cytoscape.model.CyNetwork)28 CyApplicationManager (org.cytoscape.application.CyApplicationManager)14 Test (org.junit.Test)14 CyNetworkViewManager (org.cytoscape.view.model.CyNetworkViewManager)12 CyNode (org.cytoscape.model.CyNode)9 ArrayList (java.util.ArrayList)8 CyGroupManager (org.cytoscape.group.CyGroupManager)8 CyNetworkFactory (org.cytoscape.model.CyNetworkFactory)8 CyRootNetworkManager (org.cytoscape.model.subnetwork.CyRootNetworkManager)7 CyNetworkViewFactory (org.cytoscape.view.model.CyNetworkViewFactory)7 VisualMappingManager (org.cytoscape.view.vizmap.VisualMappingManager)7 CyTableManager (org.cytoscape.model.CyTableManager)6 CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)6 CyNetworkView (org.cytoscape.view.model.CyNetworkView)6 RenderingEngineManager (org.cytoscape.view.presentation.RenderingEngineManager)6 TaskIterator (org.cytoscape.work.TaskIterator)6 CyEventHelper (org.cytoscape.event.CyEventHelper)5 CyLayoutAlgorithmManager (org.cytoscape.view.layout.CyLayoutAlgorithmManager)5 UndoSupport (org.cytoscape.work.undo.UndoSupport)5