/[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

branches/1.0-gt2-2.6/src/junit/skrueger/i8n/SwitchLanguageDialogTest.java revision 392 by alfonx, Sun Sep 13 13:33:51 2009 UTC branches/2.3.x/src_junit/skrueger/i8n/SwitchLanguageDialogTest.java revision 1240 by alfonx, Fri Nov 5 13:02:30 2010 UTC
# Line 25  Line 25 
25   *   *
26   * Contributors:   * Contributors:
27   *     Martin O. J. Schmitz - initial API and implementation   *     Martin O. J. Schmitz - initial API and implementation
28   *     Stefan A. Krüger - additional utility classes   *     Stefan A. Tzeggai - additional utility classes
29   ******************************************************************************/   ******************************************************************************/
30  package junit.skrueger.i8n;  package skrueger.i8n;
31    
32  import java.util.ArrayList;  import java.util.ArrayList;
33    
34  import junit.framework.TestCase;  import junit.framework.TestCase;
35    
36  import skrueger.i8n.SwitchLanguageDialog;  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.isInteractive())
46                  SwitchLanguageDialog switchLanguageDialog = new SwitchLanguageDialog(null, langsa);                          // Test needed here because following GUI creation would crash
47                  switchLanguageDialog.setVisible(true);                          // without X11 DISPLAY
48                            return;
49    
50                    ArrayList<String> langs = new ArrayList<String>();
51                    langs.add("tr");
52                    langs.add("fr");
53                    langs.add("kj");
54                    TestingUtil.testGui(new SwitchLanguageDialog(null, langs, false), 20);
55            }
56    
57            @Test
58            public void testDialogDoesntAppearIf0OrOneLangOnly() throws Throwable {
59                    if (!TestingUtil.isInteractive())
60                            // Test needed here because following GUI creation would crash
61                            // without X11 DISPLAY
62                            return;
63    
64                    ArrayList<String> langs = new ArrayList<String>();
65                    langs.add("fr");
66    
67                    long startTime = System.currentTimeMillis();
68                    TestingUtil.testGui(new SwitchLanguageDialog(null, langs, false), 2);
69                    assertTrue("dialog did pop up incorrectly", System.currentTimeMillis()
70                                    - startTime < 1000);
71          }          }
72    
73  }  }

Legend:
Removed from v.392  
changed lines
  Added in v.1240

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26