1 19 20 package general; 21 22 import java.awt.event.KeyEvent ; 23 import junit.framework.Test; 24 import junit.framework.TestSuite; 25 import org.netbeans.jellytools.Bundle; 26 import org.netbeans.jellytools.EditorOperator; 27 import org.netbeans.jellytools.EditorWindowOperator; 28 import lib.EditorTestCase; 29 import org.netbeans.jemmy.operators.JEditorPaneOperator; 30 31 36 public class GeneralTypingTest extends EditorTestCase { 37 38 public GeneralTypingTest(String testMethodName) { 39 super(testMethodName); 40 } 41 42 public void testJavaEnterBeginAndEnd(){ 43 openDefaultProject(); 44 openDefaultSampleFile(); 45 try { 46 47 EditorOperator editor = getDefaultSampleEditorOperator(); 48 49 editor.setCaretPosition(0); 51 52 JEditorPaneOperator txtOper = editor.txtEditorPane(); 54 txtOper.pushKey(KeyEvent.VK_ENTER); 55 56 editor.setCaretPosition(txtOper.getDocument().getLength()); 58 59 txtOper.pushKey(KeyEvent.VK_ENTER); 61 62 compareReferenceFiles(txtOper.getDocument()); 64 65 } finally { 66 closeFileWithDiscard(); 67 } 68 } 69 70 } 71 | Popular Tags |