/[schmitzm]/branches/2.3.x/src_junit/skrueger/i8n/SwitchLanguageDialogTest.java
ViewVC logotype

Diff of /branches/2.3.x/src_junit/skrueger/i8n/SwitchLanguageDialogTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 862 by alfonx, Sat May 22 01:24:46 2010 UTC revision 1099 by alfonx, Sun Oct 10 22:58:24 2010 UTC
# Line 33  import java.util.ArrayList; Line 33  import java.util.ArrayList;
33    
34  import junit.framework.TestCase;  import junit.framework.TestCase;
35    
36    import org.junit.Test;
37    
38    import schmitzm.swing.TestingUtil;
39    
40  public class SwitchLanguageDialogTest extends TestCase {  public class SwitchLanguageDialogTest extends TestCase {
41    
42          public void testDialog() {          @Test
43                  ArrayList<String> langsa = new ArrayList<String>();          public void testDialog() throws Throwable {
44                  langsa.add("fr");  
45                  langsa.add("tr");                  if (!TestingUtil.INTERACTIVE)
46                  // INteractive test diabled                          // Test needed here because following GUI creation would crash
47                  // new SwitchLanguageDialog(null, langsa).setModal(false);                          // without X11 DISPLAY
48                            return;
49    
50                    ArrayList<String> langs = new ArrayList<String>();
51                    langs.add("fr");
52                    langs.add("tr");
53                    TestingUtil.testGui(new SwitchLanguageDialog(null, langs, false), 10);
54          }          }
55    
56            @Test
57            public void testDialogDoesntAppearIf0OrOneLangOnly() throws Throwable {
58                    if (!TestingUtil.INTERACTIVE)
59                            // Test needed here because following GUI creation would crash
60                            // without X11 DISPLAY
61                            return;
62    
63                    ArrayList<String> langs = new ArrayList<String>();
64                    langs.add("fr");
65    
66                    long startTime = System.currentTimeMillis();
67                    TestingUtil.testGui(new SwitchLanguageDialog(null, langs, false), 2);
68                    assertTrue("dialog did pop up incorrectly", System.currentTimeMillis()
69                                    - startTime < 1000);
70            }
71    
72  }  }

Legend:
Removed from v.862  
changed lines
  Added in v.1099

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26