Skip to content

Commit

Permalink
trying to fix oscillating test
Browse files Browse the repository at this point in the history
  • Loading branch information
janotav committed Mar 26, 2014
1 parent 8406f68 commit 6f698bc
Showing 1 changed file with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.junit.Before;
import org.junit.Test;

import javax.swing.SwingUtilities;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
Expand Down Expand Up @@ -158,18 +157,9 @@ public void register(@NotNull String groupDisplayName, @NotNull NotificationDisp
for(int i = 0; i < 100; i++) {
troubleShootService.request(getProject(), "GET", new MyInputData("<foo/>"), "defects/{0}", "0");
}

try {
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
// additional 10 notifications
Assert.assertEquals(11, times.getValue());
}
});
} catch (Exception e) {
throw new RuntimeException(e);
}
testApplication.waitForBackgroundActivityToFinish();
// additional 10 notifications
Assert.assertEquals(11, times.getValue());

connection.disconnect();
troubleShootService.stop();
Expand Down

0 comments on commit 6f698bc

Please sign in to comment.