KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > i18n > test > internationalize > Internationalize


1 /*
2  * Internationalize.java
3  *
4  * Created on October 29, 2003, 4:06 PM
5  */

6
7 package org.netbeans.i18n.test.internationalize;
8
9 import java.io.File JavaDoc;
10 import java.util.Enumeration JavaDoc;
11 import org.netbeans.i18n.jelly.InternationalizeOperator;
12 import org.netbeans.jellytools.JellyTestCase;
13 import org.netbeans.jellytools.actions.Action;
14 import org.netbeans.jellytools.nodes.FilesystemNode;
15 import org.netbeans.jemmy.EventTool;
16 import org.netbeans.junit.NbTestSuite;
17 import org.openide.filesystems.FileObject;
18 import org.openide.filesystems.FileSystem;
19 import org.openide.filesystems.Repository;
20
21 /**
22  *
23  * @author eh103527
24  */

25 public class Internationalize extends JellyTestCase {
26     
27     String JavaDoc TEST_PACKAGE="data";
28     String JavaDoc FILE_NAME="TestFrame";
29     
30     /**
31      * Constructor - Creates new instance of this class
32      */

33     public Internationalize() {
34         super("testInternationalize");
35     }
36     
37     public static NbTestSuite suite() {
38         NbTestSuite suite = new NbTestSuite();
39         suite.addTest(new Internationalize());
40         return suite;
41     }
42     
43     /**
44      * This method contains body of test
45      * @return void
46      */

47     public void testInternationalize() throws Exception JavaDoc {
48         System.out.println();
49         System.out.println("===================================================================================");
50         System.out.println("= Test : Internationalize - complex walkthrough =");
51         System.out.println("= See testspec of i18n module: =");
52         System.out.println("= http://beetle.czech/modules/i18n/ =");
53         System.out.println("===================================================================================");
54         
55         FileSystem[] fileSystems = Repository.getDefault().toArray();
56         String JavaDoc fileSystemName = null;
57         
58         for ( int ii = 0; ii < fileSystems.length; ii++ ) {
59             FileObject file = fileSystems[ii].findResource(TEST_PACKAGE);
60             if (file != null) {
61                 System.out.println("> Used Filesystem = "+fileSystems[ii].getDisplayName());
62                 fileSystemName = fileSystems[ii].getDisplayName();
63             }
64         }
65         
66         if ( fileSystemName == null )
67             throw new Exception JavaDoc("Must be mounted .../"+TEST_PACKAGE+" repository in explorer !");
68         
69         String JavaDoc path = fileSystemName.concat("|"+TEST_PACKAGE+"|"+FILE_NAME);
70         new Action("Tools","Tools|Internationalization|Internationalize").performPopup(new FilesystemNode(path));
71         new EventTool().waitNoEvent(2500);
72         InternationalizeOperator io = new InternationalizeOperator();
73
74     }
75     
76     /**
77      * @param args the command line arguments
78      */

79     public static void main(String JavaDoc[] args) {
80         NbTestSuite nbTestSuite = new NbTestSuite();
81         nbTestSuite.addTest(new Internationalize());
82         junit.textui.TestRunner.run(nbTestSuite);
83     }
84 }
85
Popular Tags