Author: ruschein
Date: 2011-03-30 15:46:51 -0700 (Wed, 30 Mar 2011)
New Revision: 24624

Modified:
   core3/model-impl/trunk/performance/pom.xml
   
core3/model-impl/trunk/performance/src/test/java/org/cytoscape/model/ServiceConfigurationTest.java
   core3/model-impl/trunk/pom.xml
Log:
Performance-testing related changes.

Modified: core3/model-impl/trunk/performance/pom.xml
===================================================================
--- core3/model-impl/trunk/performance/pom.xml  2011-03-30 22:21:15 UTC (rev 
24623)
+++ core3/model-impl/trunk/performance/pom.xml  2011-03-30 22:46:51 UTC (rev 
24624)
@@ -45,6 +45,7 @@
                                <artifactId>maven-surefire-plugin</artifactId>
                                <configuration>
                                        
<redirectTestOutputToFile>true</redirectTestOutputToFile>
+                                       <argLine>-Xms512m -Xmx8000m</argLine>
                                </configuration>
                        </plugin>
                </plugins>
@@ -63,12 +64,6 @@
                </dependency>
                <dependency>
                        <groupId>org.cytoscape</groupId>
-                       <artifactId>model-api</artifactId>
-                       <version>3.0.0-alpha3-SNAPSHOT</version>
-                       <scope>provided</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.cytoscape</groupId>
                        <artifactId>integration-test-support</artifactId>
                        <version>3.0.0-alpha4-SNAPSHOT</version>
                        <scope>provided</scope>

Modified: 
core3/model-impl/trunk/performance/src/test/java/org/cytoscape/model/ServiceConfigurationTest.java
===================================================================
--- 
core3/model-impl/trunk/performance/src/test/java/org/cytoscape/model/ServiceConfigurationTest.java
  2011-03-30 22:21:15 UTC (rev 24623)
+++ 
core3/model-impl/trunk/performance/src/test/java/org/cytoscape/model/ServiceConfigurationTest.java
  2011-03-30 22:46:51 UTC (rev 24624)
@@ -3,8 +3,8 @@
 
 import org.easymock.EasyMock;
 import static org.junit.Assert.*;
+import org.junit.Before;
 import org.junit.Test;
-import org.junit.Before;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.junit.Configuration;
 import org.ops4j.pax.exam.junit.MavenConfiguredJUnit4TestRunner;
@@ -31,36 +31,49 @@
 
 @RunWith(MavenConfiguredJUnit4TestRunner.class)
 public class ServiceConfigurationTest extends ServiceTestSupport {
+       private CyNetworkFactory networkFactory;
+
        @Before 
        public void setup() {
                registerMockService(Interpreter.class);
                registerMockService(CyServiceRegistrar.class);
-       }
 
-       @Test
-       public void testAddNode() {
-               final ServiceTracker tracker =
+               // Obtain a CyNetworkFactory service:
+               final ServiceTracker networkFactoryTracker =
                        new ServiceTracker(bundleContext, 
CyNetworkFactory.class.getName(), null);
-               tracker.open();
-
-               // Obtain a CyNetworkFactory service:
-               CyNetworkFactory factory = null;
+               networkFactoryTracker.open();
+               networkFactory = null;
                try {
-                       final int WAIT_TIME = 4000; // seconds
-                       factory = 
(CyNetworkFactory)tracker.waitForService(WAIT_TIME);
+                       final int WAIT_TIME = 10000; // seconds
+                       networkFactory = 
(CyNetworkFactory)networkFactoryTracker.waitForService(WAIT_TIME);
                } catch (final InterruptedException ie) {
                        fail("Did not get an instance of a CyNetworkFactory 
service within the specified amount of time!");
                }
-               assertNotNull(factory);
+               assertNotNull(networkFactory);
+       }
 
-               final CyNetwork network = factory.getInstance();
-               assertNotNull(network);
+       @Test
+       public void runTestLoop() {
+               final int EFFECTIVE_LOOP_COUNT = 2;
+               for (int i = 0; i <= EFFECTIVE_LOOP_COUNT; ++i) {
+                       final long startTime = System.nanoTime();
+                       testMiscNodeAndEdgeOps();
+                       final long endTime = System.nanoTime();
+                       if (i > 0) // We throw the first value away.
+                               System.err.println("*** CTRT: " + 
getClass().getName() + ".testMiscNodeAndEdgeOps "
+                                                  + (endTime - startTime));
+               }
+       }
 
+       private void testMiscNodeAndEdgeOps() {
+               final CyNetwork network = networkFactory.getInstance();
+
                final int NODE_COUNT = 50000;
                final List<CyNode> nodes = new ArrayList<CyNode>(NODE_COUNT);
                for (int i = 0; i < NODE_COUNT; ++i)
                        nodes.add(network.addNode());
 
+/*
                boolean isDirected = true;
                final Random rand = new Random(1234L);
 
@@ -82,5 +95,6 @@
                        final CyNode target = nodes.get(i + 1000);
                        network.getConnectingEdgeList(source, target, 
CyEdge.Type.ANY);
                }
+*/
        }
 }

Modified: core3/model-impl/trunk/pom.xml
===================================================================
--- core3/model-impl/trunk/pom.xml      2011-03-30 22:21:15 UTC (rev 24623)
+++ core3/model-impl/trunk/pom.xml      2011-03-30 22:46:51 UTC (rev 24624)
@@ -15,6 +15,7 @@
        <modules>
                <module>impl</module>
                <module>it</module>
+               <module>performance</module>
        </modules>
 
        <scm>
@@ -87,7 +88,7 @@
                <dependency>
                        <groupId>org.cytoscape</groupId>
                        <artifactId>event-api</artifactId>
-                       <version>3.0.0-alpha3</version>
+                       <version>3.0.0-alpha4-SNAPSHOT</version>
                        <scope>provided</scope>
                </dependency>
                <dependency>
@@ -105,7 +106,7 @@
                <dependency>
                        <groupId>org.cytoscape</groupId>
                        <artifactId>event-api</artifactId>
-                       <version>3.0.0-alpha3</version>
+                       <version>3.0.0-alpha4-SNAPSHOT</version>
                        <type>test-jar</type>
                        <scope>test</scope>
                </dependency>

-- 
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