1 19 20 package java_smart_enter; 21 26 27 import java.awt.event.KeyEvent ; 28 import javax.swing.text.Document ; 29 import org.netbeans.jellytools.Bundle; 30 import org.netbeans.jellytools.EditorOperator; 31 import org.netbeans.jellytools.EditorWindowOperator; 32 import lib.JavaEditorTestCase; 33 import org.netbeans.jemmy.operators.JEditorPaneOperator; 34 35 36 40 public class SmartEnterTest extends JavaEditorTestCase { 41 42 private final int keyCode = KeyEvent.VK_ENTER; 43 44 45 public SmartEnterTest(String testMethodName) { 46 super(testMethodName); 47 } 48 49 50 public void testSmartEnter(){ 51 openDefaultProject(); 52 openDefaultSampleFile(); 53 try { 54 55 EditorOperator editor = getDefaultSampleEditorOperator(); 56 57 editor.setCaretPosition(5, 28); 59 60 JEditorPaneOperator txtOper = editor.txtEditorPane(); 62 txtOper.pushKey(KeyEvent.VK_ENTER); 63 64 compareReferenceFiles(txtOper.getDocument()); 66 67 } finally { 68 closeFileWithDiscard(); 69 } 70 } 71 72 } 73 | Popular Tags |