X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Ftest%2Forg%2Fjent%2Fchecksmtp%2FToListDialogTest.java;h=899024c8d65fe3db6cef1fb316c7a78f75042b68;hb=2c73289e908dab30954525a186ca63fca731f9df;hp=64bb464e70f30f820ce4558f56c226b395037478;hpb=1d2ae7b26cc68789624bb39db9bd3813269de9c0;p=mdc%2FBetaProject.git diff --git a/src/test/org/jent/checksmtp/ToListDialogTest.java b/src/test/org/jent/checksmtp/ToListDialogTest.java index 64bb464..899024c 100644 --- a/src/test/org/jent/checksmtp/ToListDialogTest.java +++ b/src/test/org/jent/checksmtp/ToListDialogTest.java @@ -48,21 +48,37 @@ public class ToListDialogTest extends TestCase implements ResultNotify { notifyResult(); } - public void test1() { + private void pushTestSetup(String msg) { + arrayList.add(msg); for (int i = 0; i < 100; i++) { arrayList.add("NO" + i); } toListDialog = new ToListDialog(this, arrayList); + arrayList.clear(); try { synchronized (this) { - wait(); + wait(30 * 1000); + //Wait 30sec } } catch (InterruptedException e) { - System.err.println("Dialg wait interrupted"); - e.printStackTrace(); + fail("Dialg wait interrupted"); } + } + + public void testPushOK() { + pushTestSetup("Please push OK button."); + assertTrue("Time out or push CANCEL", result); + } + + public void testPushCANCEL() { + pushTestSetup("Please push CANCEL button."); + assertTrue("Time out or push OK", !result); + } + public void testPushClose() { + pushTestSetup("Please close Window."); + assertTrue("Time out or push OK", !result); } }