diff -r caf8bd911720 performance/j2se/nbproject/project.xml
--- a/performance/j2se/nbproject/project.xml Wed Sep 09 02:41:48 2009 +0200
+++ b/performance/j2se/nbproject/project.xml Wed Sep 09 11:04:00 2009 +0200
@@ -132,6 +132,10 @@
+ org.netbeans.modules.java.source
+
+
+
org.netbeans.modules.jellytools.ide
@@ -152,6 +156,10 @@
+ org.netbeans.modules.parsing.api
+
+
+
org.netbeans.modules.projectui
diff -r caf8bd911720 performance/j2se/test/qa-functional/src/org/netbeans/performance/j2se/actions/PasteInEditorTest.java
--- a/performance/j2se/test/qa-functional/src/org/netbeans/performance/j2se/actions/PasteInEditorTest.java Wed Sep 09 02:41:48 2009 +0200
+++ b/performance/j2se/test/qa-functional/src/org/netbeans/performance/j2se/actions/PasteInEditorTest.java Wed Sep 09 11:04:00 2009 +0200
@@ -43,6 +43,10 @@
import java.awt.event.KeyEvent;
+import java.io.File;
+import java.util.concurrent.atomic.AtomicLong;
+import javax.swing.JEditorPane;
+import org.netbeans.api.java.source.SourceUtils;
import org.netbeans.modules.performance.utilities.PerformanceTestCase;
import org.netbeans.performance.j2se.setup.J2SESetup;
@@ -56,6 +60,11 @@
import org.netbeans.jemmy.operators.ComponentOperator;
import org.netbeans.junit.NbTestSuite;
import org.netbeans.junit.NbModuleSuite;
+import org.openide.cookies.EditorCookie;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.util.Exceptions;
+import org.openide.util.Utilities;
/**
* Test of Paste text to opened source editor.
@@ -81,6 +90,7 @@
}
public static NbTestSuite suite() {
+ CountingSecurityManager.initialize("non-existing");
NbTestSuite suite = new NbTestSuite();
suite.addTest(NbModuleSuite.create(NbModuleSuite.createConfiguration(J2SESetup.class)
.addTest(PasteInEditorTest.class)
@@ -109,7 +119,30 @@
new ActionNoBlock(null, null, new Shortcut(KeyEvent.VK_C, KeyEvent.CTRL_MASK)).perform(editorOperator1);
editorOperator2.makeComponentVisible();
editorOperator2.setCaretPositionToLine(29);
- new ActionNoBlock(null, null, new Shortcut(KeyEvent.VK_END, KeyEvent.CTRL_MASK)).perform(editorOperator2);
+ EditorCookie ec = Utilities.actionsGlobalContext().lookup(EditorCookie.class);
+ assertNotNull("Editor is selected", ec);
+ int len = ec.getDocument().getLength();
+ JEditorPane[] arr = ec.getOpenedPanes();
+ assertNotNull("Pane opened", arr);
+ assertEquals("One Pane opened", 1, arr.length);
+ arr[0].setCaretPosition(len);
+ try {
+ SourceUtils.waitScanFinished();
+ } catch (InterruptedException ex) {
+ fail("No interrupts please");
+ }
+
+ FileObject fo = Utilities.actionsGlobalContext().lookup(FileObject.class);
+ assertNotNull("File object found", fo);
+ assertEquals("Correct name", "TestClassForCopyPaste.java", fo.getNameExt());
+ File dir = FileUtil.toFile(fo.getParent());
+ assertNotNull("Directory is backed by java.io.File", dir);
+
+ AtomicLong l = new AtomicLong();
+ new ActionNoBlock(null, null, new Shortcut(KeyEvent.VK_ENTER, 0)).perform(editorOperator2);
+ CountingSecurityManager.initialize(dir.getPath());
+ new ActionNoBlock(null, null, new Shortcut(KeyEvent.VK_ENTER, 0)).perform(editorOperator2);
+ CountingSecurityManager.assertCounts("No files touched", 0, l);
}
public ComponentOperator open(){