1 7 8 package org.netbeans.test.junit.testresults; 9 10 import org.netbeans.jellytools.nodes.Node; 11 import org.netbeans.jemmy.operators.JPopupMenuOperator; 12 import org.netbeans.junit.NbTestCase; 13 import org.netbeans.junit.NbTestSuite; 14 import org.netbeans.test.junit.utils.ResultWindowOperator; 15 import org.netbeans.test.junit.utils.Utilities; 16 17 21 public class ResultsWindowTest extends NbTestCase { 22 23 private static final String TEST_PACKAGE_PATH = 24 "org.netbeans.test.junit.testresults"; 25 26 27 private static final String TEST_PACKAGE_NAME = TEST_PACKAGE_PATH+".test"; 28 29 33 public static NbTestSuite suite() { 34 NbTestSuite suite = new NbTestSuite(ResultsWindowTest.class); 35 return suite; 36 } 37 38 39 public ResultsWindowTest(String testName) { 40 super(testName); 41 } 42 43 44 public void testResultWindowOpened() { 45 Node n = Utilities.openFile(Utilities.TEST_PACKAGES_PATH + 47 "|" + TEST_PACKAGE_NAME + "|" + Utilities.TEST_CLASS_NAME); 48 49 JPopupMenuOperator jpmo = n.callPopup(); 50 jpmo.pushMenu(Utilities.RUN_FILE); 51 Utilities.takeANap(4000); 52 ResultWindowOperator rwo = new ResultWindowOperator(); 53 assertTrue("Junit Output window should be visible", rwo.isVisible()); 54 rwo.close(); assertFalse("Junit Output window is visible," + 56 "should be closed", rwo.isShowing()); 57 } 58 59 62 public void testFilterButtonEnabled() { 63 Node n = Utilities.openFile(Utilities.TEST_PACKAGES_PATH + "|" 64 + TEST_PACKAGE_NAME + "|EmptyJUnitTest"); 65 JPopupMenuOperator jpmo = n.callPopup(); 66 jpmo.pushMenu(Utilities.RUN_FILE); 67 Utilities.takeANap(4000); 68 ResultWindowOperator rwo = new ResultWindowOperator(); 69 assertTrue("Filter button should eb enabled", 70 rwo.isFilterButtonEnabled()); 71 72 } 73 74 75 83 public void testPressFilterButton() { 84 Utilities.testWholeProject(); 85 Utilities.takeANap(4000); 86 ResultWindowOperator rwo = new ResultWindowOperator(); 87 rwo.pushFilterButton(); 88 89 } 91 92 93 } 94 | Popular Tags |