Author: ruschein
Date: 2011-08-18 14:28:09 -0700 (Thu, 18 Aug 2011)
New Revision: 26605

Modified:
   
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArrayGraph.java
   
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArraySubGraph.java
   
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyNetworkFactoryImpl.java
   
core3/impl/trunk/model-impl/impl/src/main/resources/META-INF/spring/bundle-context-osgi.xml
   
core3/impl/trunk/model-impl/impl/src/main/resources/META-INF/spring/bundle-context.xml
   
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/CyTableManagerTest.java
   
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/NetworkTestSupport.java
   
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/TestCyNetworkFactory.java
   
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/subnetwork/CySubNetworkCyTableManagerTest.java
Log:
Performance optimisation by suppressing event firing during the loading of a 
network.

Modified: 
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArrayGraph.java
===================================================================
--- 
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArrayGraph.java
 2011-08-18 21:02:33 UTC (rev 26604)
+++ 
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArrayGraph.java
 2011-08-18 21:28:09 UTC (rev 26605)
@@ -1,5 +1,5 @@
 /*
- Copyright (c) 2008, 2010, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2008, 2010-2011, The Cytoscape Consortium (www.cytoscape.org)
 
  This library is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public License as published
@@ -35,6 +35,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 
 import org.cytoscape.event.CyEventHelper;
 import org.cytoscape.model.CyEdge;
@@ -46,12 +47,13 @@
 import org.cytoscape.model.CyTableFactory;
 import org.cytoscape.model.Identifiable;
 import org.cytoscape.model.SUIDFactory;
+import org.cytoscape.service.util.CyServiceRegistrar;
 import org.cytoscape.model.subnetwork.CyRootNetwork;
 import org.cytoscape.model.subnetwork.CySubNetwork;
 
 
 /**
-A linked list implmentation of CyNetwork and CyRootNetwork.
+A linked list implementation of CyNetwork and CyRootNetwork.
 The fundamental idea here is instead of having NodePointer (and EdgePointer) 
contain
 single references to other NodePointers, it instead contains arrays of 
references to NodePointers.  
 The arrays are indexed by an internal subnetwork id where the root network has 
an id of 0.
@@ -86,17 +88,19 @@
        private final CyEventHelper eventHelper;
        private final List<CySubNetwork> subNetworks;
        private final CySubNetwork base;
-
        private final CyTableManagerImpl tableMgr;
+       private final CyServiceRegistrar serviceRegistrar;
 
        /**
         * Creates a new ArrayGraph object.
         * @param eh The CyEventHelper used for firing events.
         */
        public ArrayGraph(final CyEventHelper eh, final CyTableManagerImpl 
tableMgr,
-                         final CyTableFactory tableFactory, final boolean 
publicTables)
+                         final CyTableFactory tableFactory,
+                         final CyServiceRegistrar serviceRegistrar, final 
boolean publicTables)
        {
                this.tableMgr = tableMgr;
+               this.serviceRegistrar = serviceRegistrar;
                suid = SUIDFactory.getNextSUID();
                numSubNetworks = 0;
                nodeCount = 0;
@@ -854,6 +858,7 @@
        public synchronized CySubNetwork addSubNetwork() {
                final int newId = ++numSubNetworks;
                final ArraySubGraph sub = new 
ArraySubGraph(this,newId,eventHelper);
+               serviceRegistrar.registerAllServices(sub, new Properties());
                subNetworks.add(sub);
                tableMgr.setTableMap(CyNetwork.class, sub, netAttrMgr);
                tableMgr.setTableMap(CyNode.class, sub, nodeAttrMgr);

Modified: 
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArraySubGraph.java
===================================================================
--- 
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArraySubGraph.java
      2011-08-18 21:02:33 UTC (rev 26604)
+++ 
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArraySubGraph.java
      2011-08-18 21:28:09 UTC (rev 26605)
@@ -41,6 +41,8 @@
 import org.cytoscape.model.events.AddedEdgesEvent;
 import org.cytoscape.model.events.AboutToRemoveNodesEvent;
 import org.cytoscape.model.events.AboutToRemoveEdgesEvent;
+import org.cytoscape.model.events.NetworkAddedEvent;
+import org.cytoscape.model.events.NetworkAddedListener;
 import org.cytoscape.model.events.RemovedNodesEvent;
 import org.cytoscape.model.events.RemovedEdgesEvent;
 import org.cytoscape.model.subnetwork.CySubNetwork;
@@ -57,7 +59,7 @@
  * An implementation of CySubNetwork that is largely a passthrough to
  * {@link ArrayGraph}.
  */
-class ArraySubGraph implements CySubNetwork {
+class ArraySubGraph implements CySubNetwork, NetworkAddedListener {
        private final int internalId;
        private final long internalSUID;
        private final CyEventHelper eventHelper;
@@ -67,6 +69,7 @@
        private NodePointer inFirstNode;
        private Set<CyNode> nodeSet;
        private Set<CyEdge> edgeSet;
+       private boolean fireAddedNodesAndEdgesEvents;
 
        ArraySubGraph(final ArrayGraph par, final int inId, final CyEventHelper 
eventHelper) {
                assert(par != null);
@@ -75,12 +78,13 @@
                this.eventHelper = DIUtil.stripProxy(eventHelper);
 
                internalSUID = SUIDFactory.getNextSUID();
-               
+
                nodeSet = new HashSet<CyNode>();
                edgeSet = new HashSet<CyEdge>();
 
-               internalNodeCount = 0; 
-               internalEdgeCount = 0; 
+               internalNodeCount = 0;
+               internalEdgeCount = 0;
+               fireAddedNodesAndEdgesEvents = false;
        }
 
        private void updateNode(final CyNode n) {
@@ -121,15 +125,17 @@
         * {@inheritDoc}
         */
        public CyNode addNode() {
-               final CyNode ret; 
+               final CyNode ret;
                synchronized (this) {
                        ret = parent.nodeAdd();
                        updateNode(ret);
                        internalNodeCount++;
                        nodeSet.add(ret);
                }
-               eventHelper.addEventPayload((CyNetwork)this, ret, 
AddedNodesEvent.class);
 
+               if (fireAddedNodesAndEdgesEvents)
+                       eventHelper.addEventPayload((CyNetwork)this, ret, 
AddedNodesEvent.class);
+
                return ret;
        }
 
@@ -138,15 +144,17 @@
         */
        public CyEdge addEdge(final CyNode source, final CyNode target, final 
boolean isDirected) {
                // important that it's edgeAdd and not addEdge
-               final CyEdge ret; 
+               final CyEdge ret;
                synchronized (this) {
-                       ret = parent.edgeAdd(source, target, isDirected, this); 
+                       ret = parent.edgeAdd(source, target, isDirected, this);
                        updateEdge(ret);
                        internalEdgeCount++;
                        edgeSet.add(ret);
                }
-               eventHelper.addEventPayload((CyNetwork)this, ret, 
AddedEdgesEvent.class);
 
+               if (fireAddedNodesAndEdgesEvents)
+                       eventHelper.addEventPayload((CyNetwork)this, ret, 
AddedEdgesEvent.class);
+
                return ret;
        }
 
@@ -212,7 +220,7 @@
                // make sure the subnetwork still contains the node
                if ( nodeSet.contains(n) )
                        return n;
-               else    
+               else
                        return null;
        }
 
@@ -228,7 +236,7 @@
                // make sure the subnetwork still contains the edge
                if ( edgeSet.contains(e) )
                        return e;
-               else    
+               else
                        return null;
        }
 
@@ -274,15 +282,15 @@
        public boolean addNode(final CyNode node) {
                if (node == null)
                        throw new NullPointerException("node is null");
-               
+
                synchronized (this) {
                        if (containsNode(node))
-                               return false;   
+                               return false;
 
                        if (!parent.containsNode(node))
                                throw new IllegalArgumentException("node is not 
contained in parent network!");
 
-                       // add node 
+                       // add node
                        internalNodeCount++;
                        nodeSet.add(node);
                        updateNode(node);
@@ -295,7 +303,7 @@
        public boolean addEdge(final CyEdge edge) {
                if (edge == null)
                        throw new NullPointerException("edge is null");
-               
+
                synchronized (this) {
                        if (containsEdge(edge))
                                return false;
@@ -303,14 +311,14 @@
                        if (!parent.containsEdge(edge))
                                throw new IllegalArgumentException("edge is not 
contained in parent network!");
 
-                       // This will: 
+                       // This will:
                        // -- add the node if it doesn't already exist
-                       // -- do nothing if the node does exist 
+                       // -- do nothing if the node does exist
                        // -- throw an exception if the node isn't part of the 
root network
                        addNode(edge.getSource());
                        addNode(edge.getTarget());
 
-                       // add edge 
+                       // add edge
                        internalEdgeCount++;
                        edgeSet.add(edge);
                        updateEdge(edge);
@@ -334,21 +342,21 @@
 
                synchronized (this) {
                        for (CyNode n : nodes) {
-                               
+
                                if (!containsNode(n))
                                        return false;
-       
+
                                // remove adjacent edges
                                removeEdgesInternal(getAdjacentEdgeList(n, 
CyEdge.Type.ANY));
-               
+
                                final NodePointer node = 
parent.getNodePointer(n);
                                inFirstNode = 
node.remove(inFirstNode,internalId);
-       
+
                                internalNodeCount--;
                                nodeSet.remove(n);
                        }
                }
-               
+
                eventHelper.fireEvent(new RemovedNodesEvent(this));
 
                return true;
@@ -381,41 +389,47 @@
                for (CyEdge edge : edges) {
                        if (!containsEdge(edge))
                                return false;
-       
+
                        final EdgePointer e = parent.getEdgePointer(edge);
-       
+
                        e.remove(internalId);
-       
+
                        internalEdgeCount--;
                        edgeSet.remove(edge);
                }
                return true;
        }
 
-    /**
-     * Tests object for equality with this object.
-     * @param o The object to test for equality.
-     * @return True if the object is an ArrayGraph and the SUID matches, false 
otherwise.
-     */
-    @Override
-    public boolean equals(final Object o) {
-        if (!(o instanceof ArraySubGraph))
-            return false;
+       @Override
+       public void handleEvent(final NetworkAddedEvent e) {
+               if (e.getNetwork() == this)
+                       fireAddedNodesAndEdgesEvents = true;
+       }
 
-        final ArraySubGraph ag = (ArraySubGraph) o;
+       /**
+        * Tests object for equality with this object.
+        * @param o The object to test for equality.
+        * @return True if the object is an ArrayGraph and the SUID matches, 
false otherwise.
+        */
+       @Override
+       public boolean equals(final Object o) {
+               if (!(o instanceof ArraySubGraph))
+                       return false;
 
-        return ag.internalSUID == this.internalSUID;
-    }
+               final ArraySubGraph ag = (ArraySubGraph) o;
 
-    /**
-     * Returns a hashcode for this object. 
-     * @return A mangled version of the SUID. 
-     */
-    @Override
-    public int hashCode() {
-        return (int) (internalSUID ^ (internalSUID >>> 32));
-    }
+               return ag.internalSUID == this.internalSUID;
+       }
 
+       /**
+        * Returns a hashcode for this object.
+        * @return A mangled version of the SUID.
+        */
+       @Override
+       public int hashCode() {
+               return (int) (internalSUID ^ (internalSUID >>> 32));
+       }
+
        public CyTable getDefaultNetworkTable() {
                return parent.getDefaultNetworkTable();
        }

Modified: 
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyNetworkFactoryImpl.java
===================================================================
--- 
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyNetworkFactoryImpl.java
       2011-08-18 21:02:33 UTC (rev 26604)
+++ 
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyNetworkFactoryImpl.java
       2011-08-18 21:28:09 UTC (rev 26605)
@@ -1,5 +1,5 @@
 /*
- Copyright (c) 2008, 2010, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2008, 2010-2011, The Cytoscape Consortium (www.cytoscape.org)
 
  This library is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public License as published
@@ -33,6 +33,8 @@
 import org.cytoscape.model.CyNetworkFactory;
 import org.cytoscape.model.CyTableManager;
 import org.cytoscape.model.CyTableFactory;
+import org.cytoscape.service.util.CyServiceRegistrar;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -43,6 +45,7 @@
        private final CyEventHelper help;
        private final CyTableManagerImpl mgr;
        private final CyTableFactory tableFactory;
+       private final CyServiceRegistrar serviceRegistrar;
 
        /**
         * Creates a new CyNetworkFactoryImpl object.
@@ -50,20 +53,25 @@
         * @param help An instance of CyEventHelper. 
         */
        public CyNetworkFactoryImpl(final CyEventHelper help, final 
CyTableManagerImpl mgr,
-                                   final CyTableFactory tableFactory)
+                                   final CyTableFactory tableFactory,
+                                   final CyServiceRegistrar serviceRegistrar)
        {
                if (help == null)
-                       throw new NullPointerException("CyEventHelper is null");
+                       throw new NullPointerException("CyEventHelper is 
null!");
 
                if (mgr == null)
-                       throw new NullPointerException("CyTableManager is 
null");
+                       throw new NullPointerException("CyTableManager is 
null!");
 
                if (tableFactory == null)
-                       throw new NullPointerException("CyTableFactory is 
null");
+                       throw new NullPointerException("CyTableFactory is 
null!");
 
-               this.help = help;
-               this.mgr = mgr;
-               this.tableFactory = tableFactory;
+               if (serviceRegistrar == null)
+                       throw new NullPointerException("CyServiceRegistrar is 
null!");
+
+               this.help             = help;
+               this.mgr              = mgr;
+               this.tableFactory     = tableFactory;
+               this.serviceRegistrar = serviceRegistrar;
        }
 
        /**
@@ -71,7 +79,7 @@
         */
        @Override
        public CyNetwork getInstance() {
-               ArrayGraph net = new ArrayGraph(help, mgr, tableFactory, true);
+               ArrayGraph net = new ArrayGraph(help, mgr, tableFactory, 
serviceRegistrar, true);
                logger.info("CyNetwork w/ public tables created: ID = " +  
net.getSUID());
                logger.info("CyNetwork w/ public tables created: Base Graph ID 
= " +  net.getBaseNetwork().getSUID());
                return net.getBaseNetwork(); 
@@ -82,7 +90,7 @@
         */
        @Override
        public CyNetwork getInstanceWithPrivateTables() {
-               ArrayGraph net = new ArrayGraph(help, mgr, tableFactory, false);
+               ArrayGraph net = new ArrayGraph(help, mgr, tableFactory, 
serviceRegistrar, false);
                logger.info("CyNetwork w/ private tables created: ID = " +  
net.getSUID());
                logger.info("CyNetwork w/ private tables created: Base Graph ID 
= " +  net.getBaseNetwork().getSUID());
                return net.getBaseNetwork(); 

Modified: 
core3/impl/trunk/model-impl/impl/src/main/resources/META-INF/spring/bundle-context-osgi.xml
===================================================================
--- 
core3/impl/trunk/model-impl/impl/src/main/resources/META-INF/spring/bundle-context-osgi.xml
 2011-08-18 21:02:33 UTC (rev 26604)
+++ 
core3/impl/trunk/model-impl/impl/src/main/resources/META-INF/spring/bundle-context-osgi.xml
 2011-08-18 21:28:09 UTC (rev 26605)
@@ -10,7 +10,10 @@
                interface="org.cytoscape.event.CyEventHelper" />
        <osgi:reference id="InterpreterRef"
                interface="org.cytoscape.equations.Interpreter" />
+       <osgi:reference id="cyServiceRegistrarServiceRef"
+               interface="org.cytoscape.service.util.CyServiceRegistrar" />
 
+
        <!-- Individual Service -->
        <osgi:service id="cyNetworkFactoryService"
                ref="cyNetworkFactory" 
interface="org.cytoscape.model.CyNetworkFactory">

Modified: 
core3/impl/trunk/model-impl/impl/src/main/resources/META-INF/spring/bundle-context.xml
===================================================================
--- 
core3/impl/trunk/model-impl/impl/src/main/resources/META-INF/spring/bundle-context.xml
      2011-08-18 21:02:33 UTC (rev 26604)
+++ 
core3/impl/trunk/model-impl/impl/src/main/resources/META-INF/spring/bundle-context.xml
      2011-08-18 21:28:09 UTC (rev 26605)
@@ -29,6 +29,7 @@
                <constructor-arg ref="cyEventHelperServiceRef" />
                <constructor-arg ref="cyTableManager" />
                <constructor-arg ref="cyTableFactory" />
+               <constructor-arg ref="cyServiceRegistrarServiceRef" />
        </bean>
 
        <bean id="cyNetworkManager" 
class="org.cytoscape.model.internal.CyNetworkManagerImpl">

Modified: 
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/CyTableManagerTest.java
===================================================================
--- 
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/CyTableManagerTest.java
  2011-08-18 21:02:33 UTC (rev 26604)
+++ 
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/CyTableManagerTest.java
  2011-08-18 21:28:09 UTC (rev 26605)
@@ -43,8 +43,11 @@
 import org.cytoscape.model.internal.CyTableFactoryImpl;
 import org.cytoscape.model.internal.CyTableImpl;
 import org.cytoscape.model.internal.CyTableManagerImpl;
+import org.cytoscape.service.util.CyServiceRegistrar;
 
+import static org.mockito.Mockito.*;
 
+
 public class CyTableManagerTest extends AbstractCyTableManagerTest {
        CyTableManagerImpl mgrImpl;
 
@@ -55,9 +58,10 @@
                mgrImpl = new CyTableManagerImpl(eh);
                mgr = mgrImpl;
                final Interpreter interpreter = new InterpreterImpl();
+               final CyServiceRegistrar serviceRegistrar = 
mock(CyServiceRegistrar.class);
                goodNetwork =
                        new ArrayGraph(eh, mgrImpl,
-                                      new CyTableFactoryImpl(eh, mgrImpl, 
interpreter), true).getBaseNetwork();
+                                      new CyTableFactoryImpl(eh, mgrImpl, 
interpreter), serviceRegistrar, true).getBaseNetwork();
        }
 
        @After

Modified: 
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/NetworkTestSupport.java
===================================================================
--- 
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/NetworkTestSupport.java
  2011-08-18 21:02:33 UTC (rev 26604)
+++ 
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/NetworkTestSupport.java
  2011-08-18 21:28:09 UTC (rev 26605)
@@ -1,6 +1,6 @@
-
 package org.cytoscape.model;
 
+
 import org.cytoscape.equations.Interpreter;
 import org.cytoscape.event.CyEventHelper;
 import org.cytoscape.event.DummyCyEventHelper;
@@ -11,9 +11,11 @@
 import org.cytoscape.model.internal.CyNetworkFactoryImpl;
 import org.cytoscape.model.internal.CyTableFactoryImpl;
 import org.cytoscape.model.internal.CyTableManagerImpl;
+import org.cytoscape.service.util.CyServiceRegistrar;
 
 import static org.mockito.Mockito.*;
 
+
 public class NetworkTestSupport {
 
        protected CyNetworkFactory networkFactory;
@@ -24,8 +26,10 @@
                eventHelper = new DummyCyEventHelper();
                tableMgr = mock(CyTableManagerImpl.class); 
                CyTableFactoryImpl tableFactory = new 
CyTableFactoryImpl(eventHelper,tableMgr, mock(Interpreter.class));
-
-               networkFactory = new CyNetworkFactoryImpl( eventHelper, 
tableMgr, tableFactory );
+               final CyServiceRegistrar serviceRegistrar = 
mock(CyServiceRegistrar.class);
+               networkFactory =
+                       new CyNetworkFactoryImpl(eventHelper, tableMgr, 
tableFactory,
+                                                serviceRegistrar);
        }
 
        public CyNetwork getNetwork() {

Modified: 
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/TestCyNetworkFactory.java
===================================================================
--- 
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/TestCyNetworkFactory.java
        2011-08-18 21:02:33 UTC (rev 26604)
+++ 
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/TestCyNetworkFactory.java
        2011-08-18 21:28:09 UTC (rev 26605)
@@ -1,5 +1,5 @@
 /*
- Copyright (c) 2008, 2010, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2008, 2010-2011, The Cytoscape Consortium (www.cytoscape.org)
 
  This library is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public License as published
@@ -35,12 +35,14 @@
 import org.cytoscape.model.internal.CyTableManagerImpl;
 import org.cytoscape.model.internal.CyTableFactoryImpl;
 import org.cytoscape.model.subnetwork.CyRootNetwork;
+import org.cytoscape.service.util.CyServiceRegistrar;
 
-
 import org.junit.Test;
 import static org.junit.Assert.*;
 
+import static org.mockito.Mockito.*;
 
+
 public class TestCyNetworkFactory {
        public TestCyNetworkFactory() { }
 
@@ -56,7 +58,9 @@
                DummyCyEventHelper deh = new DummyCyEventHelper();
                CyTableManagerImpl tm = new CyTableManagerImpl(deh);
                Interpreter interp = new InterpreterImpl();
-               ArrayGraph ar = new ArrayGraph(deh, tm, new 
CyTableFactoryImpl(deh, tm, interp), true);
+               final CyServiceRegistrar serviceRegistrar = 
mock(CyServiceRegistrar.class);
+               ArrayGraph ar =
+                       new ArrayGraph(deh, tm, new CyTableFactoryImpl(deh, tm, 
interp), serviceRegistrar, true);
                return ar; 
        }
 
@@ -64,7 +68,9 @@
                DummyCyEventHelper deh = new DummyCyEventHelper();
                CyTableManagerImpl tm = new CyTableManagerImpl(deh);
                Interpreter interp = new InterpreterImpl();
-               ArrayGraph ar = new ArrayGraph(deh, tm, new 
CyTableFactoryImpl(deh, tm, interp), false);
+               final CyServiceRegistrar serviceRegistrar = 
mock(CyServiceRegistrar.class);
+               ArrayGraph ar =
+                       new ArrayGraph(deh, tm, new CyTableFactoryImpl(deh, tm, 
interp), serviceRegistrar, false);
                return ar; 
        }
        

Modified: 
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/subnetwork/CySubNetworkCyTableManagerTest.java
===================================================================
--- 
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/subnetwork/CySubNetworkCyTableManagerTest.java
   2011-08-18 21:02:33 UTC (rev 26604)
+++ 
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/subnetwork/CySubNetworkCyTableManagerTest.java
   2011-08-18 21:28:09 UTC (rev 26605)
@@ -1,5 +1,5 @@
 /*
- Copyright (c) 2008, 2010, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2008, 2010-2011, The Cytoscape Consortium (www.cytoscape.org)
 
  This library is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public License as published
@@ -30,7 +30,6 @@
 
 import java.util.Map;
 
-
 import org.cytoscape.model.internal.CyTableManagerImpl;
 import org.cytoscape.model.internal.CyTableFactoryImpl;
 import org.cytoscape.model.internal.ArrayGraph;
@@ -39,9 +38,13 @@
 import org.cytoscape.event.CyEventHelper;
 import org.cytoscape.event.DummyCyEventHelper;
 import org.cytoscape.model.AbstractCyTableManagerTest;
+import org.cytoscape.service.util.CyServiceRegistrar;
 
 import org.junit.Test;
 
+import static org.mockito.Mockito.*;
+
+
 /**
  * The purpose of this test is to validate that everything that holds true
  * for CyNetworks in CyTableManager also holds true for CySubNetworks!
@@ -53,9 +56,10 @@
                CyTableManagerImpl mgrImpl = new CyTableManagerImpl(eh);
                mgr = mgrImpl; 
                final Interpreter interpreter = new InterpreterImpl();
+               final CyServiceRegistrar serviceRegistrar = 
mock(CyServiceRegistrar.class);
                ArrayGraph baseNet =
                        new ArrayGraph(eh, mgrImpl,
-                                      new CyTableFactoryImpl(eh, mgrImpl, 
interpreter), true);
+                                      new CyTableFactoryImpl(eh, mgrImpl, 
interpreter), serviceRegistrar, true);
                // This is a different subnetwork and not "baseNetwork" in 
ArrayGraph.
                goodNetwork = baseNet.addSubNetwork(); 
        }

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to