/[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/2.0-RC2/src_junit/skrueger/i8n/SwitchLanguageDialogTest.java revision 621 by alfonx, Thu Jan 28 10:06:05 2010 UTC trunk/src_junit/skrueger/i8n/SwitchLanguageDialogTest.java revision 1099 by alfonx, Sun Oct 10 22:58:24 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 skrueger.i8n;  package skrueger.i8n;
31    
# 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                  new SwitchLanguageDialog(null, langsa);                          // Test needed here because following GUI creation would crash
47                            // 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.621  
changed lines
  Added in v.1099

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26