1 6 7 package org.netbeans.i18n.test.internationalize; 8 9 import java.io.File ; 10 import java.util.Enumeration ; 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 25 public class Internationalize extends JellyTestCase { 26 27 String TEST_PACKAGE="data"; 28 String FILE_NAME="TestFrame"; 29 30 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 47 public void testInternationalize() throws Exception { 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 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 ("Must be mounted .../"+TEST_PACKAGE+" repository in explorer !"); 68 69 String 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 79 public static void main(String [] args) { 80 NbTestSuite nbTestSuite = new NbTestSuite(); 81 nbTestSuite.addTest(new Internationalize()); 82 junit.textui.TestRunner.run(nbTestSuite); 83 } 84 } 85 | Popular Tags |