Author: mes
Date: 2010-06-01 17:00:55 -0700 (Tue, 01 Jun 2010)
New Revision: 20401

Modified:
   
corelibs/trunk/render.immed/tests/cytoscape/render/immed/GraphGraphicsTest.java
   
corelibs/trunk/render.immed/tests/cytoscape/render/immed/OldGraphGraphics.java
Log:
fixed a rather significant bug in the unit test where I was not properly 
testing against the old version of the code

Modified: 
corelibs/trunk/render.immed/tests/cytoscape/render/immed/GraphGraphicsTest.java
===================================================================
--- 
corelibs/trunk/render.immed/tests/cytoscape/render/immed/GraphGraphicsTest.java 
    2010-06-01 23:44:22 UTC (rev 20400)
+++ 
corelibs/trunk/render.immed/tests/cytoscape/render/immed/GraphGraphicsTest.java 
    2010-06-02 00:00:55 UTC (rev 20401)
@@ -185,7 +185,7 @@
                long duration = (end - begin) + nodeDur;
 
 //             try {
-//                     ImageIO.write(image,"PNG",new 
File("/tmp/homer-current.png"));
+//                     ImageIO.write(image,"PNG",new 
File("/tmp/homer-current-" + rand.nextInt(100) + ".png"));
 //             } catch (IOException ioe) { ioe.printStackTrace(); }
                return duration;
        }
@@ -198,7 +198,7 @@
                for ( int i = 0; i < numNodes; i++ ) {
                        float x = rand.nextFloat() * (rand.nextBoolean() ? size 
: -size); 
                        float y = rand.nextFloat() * (rand.nextBoolean() ? size 
: -size); 
-                       currentGraphGraphics.drawNodeFull( (byte)(i % (int) 
GraphGraphics.s_last_shape), 
+                       oldGraphGraphics.drawNodeFull( (byte)(i % (int) 
OldGraphGraphics.s_last_shape), 
                                                        x,
                                                        y,
                                                        (x + (rand.nextFloat() 
* nodeSizeFactor)),      
@@ -214,7 +214,7 @@
 
                begin = System.nanoTime();
                for ( int i = 0; i < numEdges; i++ ) {
-                       currentGraphGraphics.drawEdgeFull(
+                       oldGraphGraphics.drawEdgeFull(
                                (byte)((i % 7)-8),
                                rand.nextFloat() * (20f),
                                Color.red, 
@@ -223,19 +223,19 @@
                                Color.orange, 
                                rand.nextFloat() * (rand.nextBoolean() ? size : 
-size),
                                rand.nextFloat() * (rand.nextBoolean() ? size : 
-size), 
-                               currentGraphGraphics.m_noAnchors,
+                               oldGraphGraphics.m_noAnchors,
                                rand.nextFloat() * (rand.nextBoolean() ? size : 
-size),
                                rand.nextFloat() * (rand.nextBoolean() ? size : 
-size), 
                                1f, 
-                               edgeStroke, 
-                               Color.green);
+                               Color.green,
+                               0f);
                }
                end = System.nanoTime();
                
                long duration = (end - begin) + nodeDur;
 
 //             try {
-//                     ImageIO.write(image,"PNG",new 
File("/tmp/homer-old.png"));
+//                     ImageIO.write(image,"PNG",new File("/tmp/homer-old-" + 
rand.nextInt(100) + ".png"));
 //             } catch (IOException ioe) { ioe.printStackTrace(); }
                return duration;        
        }

Modified: 
corelibs/trunk/render.immed/tests/cytoscape/render/immed/OldGraphGraphics.java
===================================================================
--- 
corelibs/trunk/render.immed/tests/cytoscape/render/immed/OldGraphGraphics.java  
    2010-06-01 23:44:22 UTC (rev 20400)
+++ 
corelibs/trunk/render.immed/tests/cytoscape/render/immed/OldGraphGraphics.java  
    2010-06-02 00:00:55 UTC (rev 20401)
@@ -140,8 +140,10 @@
         * 
         */
        public static final byte SHAPE_VEE = 8;
-       private static final byte s_last_shape = SHAPE_VEE;
 
+       // package scoped for unit testing
+       static final byte s_last_shape = SHAPE_VEE;
+
        /**
         * This value is currently 100.
         */
@@ -222,7 +224,9 @@
        new double[2 * CUSTOM_SHAPE_MAX_VERTICES];
        private final HashMap<Byte, double[]> m_customShapes = new 
HashMap<Byte, double[]>();
        private final double[] m_ptsBuff = new double[4];
-       private final EdgeAnchors m_noAnchors = new EdgeAnchors() {
+
+       // package scoped for unit testing
+       final EdgeAnchors m_noAnchors = new EdgeAnchors() {
                public final int numAnchors() {
                        return 0;
                }

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