From: takuya-o Date: Sun, 6 Nov 2005 07:59:37 +0000 (+0000) Subject: JUnit: Close, CANCEL and OK button test. X-Git-Tag: StartNetBeans55Development~7 X-Git-Url: http://git.osdn.net/view?p=mdc%2FBetaProject.git;a=commitdiff_plain;h=d691757d35bed779065d3f4cdc2b81f6f09b7d22 JUnit: Close, CANCEL and OK button test. --- 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); } }