Revision: 820
Author: mr0...@mro.name
Date: Sat Oct 24 08:29:31 2009
Log: Testcase for issue#142, followup to r816
http://code.google.com/p/piccolo2d/source/detail?r=820

Modified:
   
/piccolo2d.java/trunk/extras/src/test/java/edu/umd/cs/piccolox/nodes/P3DRectTest.java

=======================================
---  
/piccolo2d.java/trunk/extras/src/test/java/edu/umd/cs/piccolox/nodes/P3DRectTest.java
    
Fri Oct 23 19:23:06 2009
+++  
/piccolo2d.java/trunk/extras/src/test/java/edu/umd/cs/piccolox/nodes/P3DRectTest.java
    
Sat Oct 24 08:29:31 2009
@@ -29,18 +29,24 @@
  package edu.umd.cs.piccolox.nodes;

  import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;

  import junit.framework.TestCase;
+import edu.umd.cs.piccolo.util.PPaintContext;

  /**
   * Unit test for P3DRect.
   */
  public class P3DRectTest extends TestCase {
      public void testClone() {
-        P3DRect rect = new P3DRect(10, 10, 10, 10);
+        final P3DRect rect = new P3DRect(10, 10, 10, 10);
          rect.setPaint(Color.BLUE);
-        P3DRect cloned = (P3DRect) rect.clone();
+        final P3DRect cloned = (P3DRect) rect.clone();
          assertNotNull(cloned);
-        assertEquals(Color.BLUE, cloned.getPaint());
+        assertEquals(Color.BLUE, cloned.getPaint());
+
+        final BufferedImage img = new BufferedImage(3, 2,  
BufferedImage.TYPE_INT_ARGB);
+        cloned.paint(new PPaintContext((Graphics2D) img.getGraphics()));
      }
  }

--~--~---------~--~----~------------~-------~--~----~
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to