Menu

Commit [r4840]  Maximize  Restore  History

This commit changes the semantics of the Utilities.clearEventQueue()

method. Unless false is passed as parameter, it now also clears out
events that were enqueued by the events cleared in the first pass,
i.e. it will only return if the event queue is actually empty.

This helps with listeners and Runnables that themselves install
listeners or enqueue Runnables, which also have to complete. This is
mainly used in GlobalModelTestCase, where the assertXXXCount() method
now first clear the event queue using clearEventQueue(true) before
they compare the counts. This should fix several problems like "XXX
fired expected <1> but was <0>".

GlobalModelTestCase also waits for the interpreter to have started up
before tests are run. The GlobalModelJUnitTest test cases sometimes
received a late _junitModel.junitJVMReady() notification after the
unit tests had already been started, and that was interpreted as
trying to start JUnit tests while tests were already running. This
fixes the "number of times compileBeforeJUnit fired expected: <1> but
was:<0>" failure that was seen in Hudson build 272 and others:
http://localhost:8080/job/DrJava/272/testReport/edu.rice.cs.drjava.model/GlobalModelJUnitTest/testNoClassFile/
(You need to use SSH port forwarding to access this website, e.g.:
ssh -N -L 8080:finland.cs.rice.edu:8080 mgricken@...
Substitute your username for mgricken. Then connect your web browser
to http://localhost:8080 )

There is also a new RunnableEST class, which is a Runnable that
preserves the stack trace of where it was created and appends it to
the stack trace of any exception thrown inside the Runnable. That
makes it possible to trace an exception all the way back, past the
point where the Runnable was processed in the event queue.

M src/edu/rice/cs/drjava/model/GlobalModelTestCase.java
M src/edu/rice/cs/drjava/model/DefaultGlobalModel.java
M src/edu/rice/cs/drjava/model/definitions/ColoringGlyphPainter.java
M src/edu/rice/cs/drjava/model/junit/DefaultJUnitModel.java
M src/edu/rice/cs/drjava/ui/NewVersionPopup.java
A src/edu/rice/cs/util/swing/UtilitiesTest.java
M src/edu/rice/cs/util/swing/Utilities.java
A src/edu/rice/cs/util/RunnableEST.java

mgricken 2009-03-24

changed /trunk/drjava/src/edu/rice/cs/drjava/model/DefaultGlobalModel.java
changed /trunk/drjava/src/edu/rice/cs/drjava/model/GlobalModelTestCase.java
changed /trunk/drjava/src/edu/rice/cs/drjava/model/definitions/ColoringGlyphPainter.java
changed /trunk/drjava/src/edu/rice/cs/drjava/model/junit/DefaultJUnitModel.java
changed /trunk/drjava/src/edu/rice/cs/drjava/ui/NewVersionPopup.java
added /trunk/drjava/src/edu/rice/cs/util/RunnableEST.java
changed /trunk/drjava/src/edu/rice/cs/util/swing/Utilities.java
added /trunk/drjava/src/edu/rice/cs/util/swing/UtilitiesTest.java
/trunk/drjava/src/edu/rice/cs/drjava/model/DefaultGlobalModel.java Diff Switch to side-by-side view
Loading...
/trunk/drjava/src/edu/rice/cs/drjava/model/GlobalModelTestCase.java Diff Switch to side-by-side view
Loading...
/trunk/drjava/src/edu/rice/cs/drjava/model/definitions/ColoringGlyphPainter.java Diff Switch to side-by-side view
Loading...
/trunk/drjava/src/edu/rice/cs/drjava/model/junit/DefaultJUnitModel.java Diff Switch to side-by-side view
Loading...
/trunk/drjava/src/edu/rice/cs/drjava/ui/NewVersionPopup.java Diff Switch to side-by-side view
Loading...
/trunk/drjava/src/edu/rice/cs/util/RunnableEST.java Diff Switch to side-by-side view
Loading...
/trunk/drjava/src/edu/rice/cs/util/swing/Utilities.java Diff Switch to side-by-side view
Loading...
/trunk/drjava/src/edu/rice/cs/util/swing/UtilitiesTest.java Diff Switch to side-by-side view
Loading...
MongoDB Logo MongoDB