1 19 27 28 32 package org.netbeans.test.localhistory; 33 34 import java.io.File ; 35 import java.io.PrintStream ; 36 import junit.textui.TestRunner; 37 import org.netbeans.jellytools.JellyTestCase; 38 import org.netbeans.jellytools.nodes.Node; 39 import org.netbeans.jellytools.nodes.SourcePackagesNode; 40 import org.netbeans.jemmy.JemmyProperties; 41 import org.netbeans.jemmy.operators.Operator; 42 import org.netbeans.junit.NbTestSuite; 43 import org.netbeans.test.localhistory.operators.ShowLocalHistoryOperator; 44 import org.netbeans.test.localhistory.utils.TestKit; 45 46 47 48 52 public class LocalHistoryViewTest extends JellyTestCase { 53 54 public static final String TMP_PATH = "/tmp"; 55 public static final String WORK_PATH = "work"; 56 public static final String PROJECT_NAME = "JavaApp"; 57 public File projectPath; 58 public PrintStream stream; 59 String os_name; 60 Operator.DefaultStringComparator comOperator; 61 Operator.DefaultStringComparator oldOperator; 62 63 64 public LocalHistoryViewTest(String name) { 65 super(name); 66 } 67 68 protected void setUp() throws Exception { 69 os_name = System.getProperty("os.name"); 70 System.out.println("### "+getName()+" ###"); 72 73 } 74 75 protected boolean isUnix() { 76 boolean unix = false; 77 if (os_name.indexOf("Windows") == -1) { 78 unix = true; 79 } 80 return unix; 81 } 82 83 public static void main(String [] args) { 84 TestRunner.run(suite()); 86 } 87 88 public static NbTestSuite suite() { 89 NbTestSuite suite = new NbTestSuite(); 90 suite.addTest(new LocalHistoryViewTest("testLocalHistoryInvoke")); 91 return suite; 92 } 93 94 public void testLocalHistoryInvoke() throws Exception { 95 JemmyProperties.setCurrentTimeout("ComponentOperator.WaitComponentTimeout", 30000); 96 JemmyProperties.setCurrentTimeout("DialogWaiter.WaitDialogTimeout", 30000); 97 TestKit.closeProject(PROJECT_NAME); 98 99 new File (TMP_PATH).mkdirs(); 100 projectPath = TestKit.prepareProject("General", "Java Application", PROJECT_NAME); 101 Node node = new Node(new SourcePackagesNode(PROJECT_NAME), "javaapp|Main.java"); 102 ShowLocalHistoryOperator slho = ShowLocalHistoryOperator.invoke(node); 103 slho.verify(); 104 slho.performPopupAction(1, "Rollback from History"); 105 } 106 } 107 | Popular Tags |