fahad - 2005-07-05

Hi I have just started to use jfcunit to test a Java Swing application that I am developing.

I need to test the dragging of an JComponent Object which is added to a JPanel.

I have looked at the API doc (jfcunit), for help on testing this feature, I have instanciated the JFCTestHelper and calleds its method enterDragAndLeave.  However this does not move the object on the screen at all, I seem to be at a loss, if anyone has any ideas it would be much appreciated.  Below is code snippet of my work

in the test method :

MouseEventData EventData = new MouseEventData(this,mf.getMapPanel().getComponent(0));
DragEventData DragEvent = new DragEventData(this,EventData);
                       
            Point[] mouseMovement = new Point[1];
            mouseMovement[0] = new Point();
            mouseMovement[0].x = 30;
            mouseMovement[0].y = 0;
            DragEvent.setPoints(mouseMovement);
           
            helper.enterDragAndLeave(DragEvent);

My understanding of the Library is that this call should be valid, but I might have misunderstood.