1 package test.org.jent.checksmtp;
3 import java.util.ArrayList;
5 import javax.swing.JDialog;
7 import junit.framework.TestCase;
9 import junit.swingui.TestRunner;
11 import org.jent.checksmtp.ResultNotify;
12 import org.jent.checksmtp.ToListDialog;
14 public class ToListDialogTest extends TestCase implements ResultNotify {
16 private final ArrayList arrayList = new ArrayList();
17 private JDialog toListDialog = null;
18 private boolean result = false;
20 public ToListDialogTest(String sTestName) {
24 public static void main(String args[]) {
25 String args2[] = {"-noloading", "test.org.jent.checksmtp.ToListDialogTest"};
26 TestRunner.main(args2);
29 protected void setUp() throws Exception {
34 protected void tearDown() throws Exception {
36 toListDialog.dispose();
39 private synchronized void notifyResult() {
51 private void pushTestSetup(String msg) {
53 for (int i = 0; i < 100; i++) {
54 arrayList.add("NO" + i);
56 toListDialog = new ToListDialog(this, arrayList);
64 } catch (InterruptedException e) {
65 fail("Dialg wait interrupted");
69 public void testPushOK() {
70 pushTestSetup("Please push OK button.");
71 assertTrue("Time out or push CANCEL", result);
74 public void testPushCANCEL() {
75 pushTestSetup("Please push CANCEL button.");
76 assertTrue("Time out or push OK", !result);
79 public void testPushClose() {
80 pushTestSetup("Please close Window.");
81 assertTrue("Time out or push OK", !result);