import edu.umd.cs.piccolox.PFrame;
import junit.framework.TestCase;

import java.awt.*;
import java.lang.reflect.InvocationTargetException;

public class PFrameTest extends TestCase {
    private static final int TEST_WIDTH = 500;
    private static final int TEST_HEIGHT = 300;

    public PFrameTest(String name) {
        super(name);
    }

    public void testComponentResized() throws InvocationTargetException, InterruptedException {
        final PFrame frame = new PFrame();
        frame.setBounds(0, 0, TEST_WIDTH, TEST_HEIGHT);
        EventQueue.invokeAndWait(new Runnable() {
            public void run() {
                // clear the event queue
            }
        });
        Rectangle bounds = frame.getCanvas().getBounds();
        assertTrue("Canvas width should be inset by frame decoration size", bounds.getWidth() < TEST_WIDTH);
        assertTrue("Canvas height should be inset by frame decoration size", bounds.getHeight() < TEST_HEIGHT);
    }
}

@@ -769,36 +769,38 @@
 %0D%0A        assert
-True
+Equals
 (%22Canvas width s
@@ -809,74 +809,85 @@
 uld 
-be inset by frame decoration size%22, bounds.getWidth() %3C TEST_WIDTH
+match width of content pane%22, frame.getContentPane().getWidth(), bounds.width
 );%0D%0A
@@ -904,12 +904,14 @@
 sert
-True
+Equals
 (%22Ca
@@ -933,76 +933,88 @@
 uld 
-be inset by frame decoration size%22, bounds.getHeight() %3C TEST_HEIGHT
+match height of content pane%22, frame.getContentPane().getHeight(), bounds.height
 );%0D%0A

Fix for issue 46: PFrameTest unit test fails on linux