Author: yradtsevich
Date: 2009-09-18 08:42:33 -0400 (Fri, 18 Sep 2009)
New Revision: 17660
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4853/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4853/SelectAllAndCut.html
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/SelectAllAndCut_JBIDE4853.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/ve/init.html
Log:
RESOLVED - issue JBIDE-4853: AutoRefresh doesn't work after Select All and source edit
https://jira.jboss.org/jira/browse/JBIDE-4853
- reverted back the changes of JBIDE-4816: Dump Source give us different results before
and after refresh
- fixed JBIDE-4816 in an another way
- written JUnit test for JBIDE-4853
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4853/SelectAllAndCut.html
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4853/SelectAllAndCut.html
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4853/SelectAllAndCut.html 2009-09-18
12:42:33 UTC (rev 17660)
@@ -0,0 +1 @@
+<div id="cut-div">abc</div>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-09-18
12:29:24 UTC (rev 17659)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-09-18
12:42:33 UTC (rev 17660)
@@ -76,6 +76,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide2170Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide2362Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.OpenOnCssClassTest_JBIDE4775;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.SelectAllAndCut_JBIDE4853;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.VPERefreshTest;
import org.jboss.tools.tests.ImportBean;
import org.jboss.tools.vpe.ui.test.VpeTestSetup;
@@ -102,6 +103,7 @@
suite.addTestSuite(Jsf20ComponentContentTest.class);
suite.addTestSuite(JBIDE3519Test.class);
suite.addTestSuite(ContextMenuDoubleInsertionTest_JBIDE3888.class);
+ suite.addTestSuite(SelectAllAndCut_JBIDE4853.class);
suite.addTestSuite(JBIDE4037Test.class);
suite.addTestSuite(JBIDE3734Test.class);
suite.addTestSuite(JBIDE3617Test.class);
@@ -188,7 +190,5 @@
projectToImport.add(jbide3247TestProject);
return new VpeTestSetup(suite, projectToImport);
-
}
-
}
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/SelectAllAndCut_JBIDE4853.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/SelectAllAndCut_JBIDE4853.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/SelectAllAndCut_JBIDE4853.java 2009-09-18
12:42:33 UTC (rev 17660)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.eclipse.swt.custom.StyledText;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.mozilla.interfaces.nsIDOMDocument;
+
+/**
+ * Tests for JIRA issue JBIDE-4859: AutoRefresh doesn't work after
+ * Select All and source edit.
+ * (
https://jira.jboss.org/jira/browse/JBIDE-4859 )
+ *
+ * @author yradtsevich
+ */
+public class SelectAllAndCut_JBIDE4853 extends VpeTest {
+ private static final String TEST_PAGE_NAME
+ = "JBIDE/4853/SelectAllAndCut.html"; //$NON-NLS-1$
+ private static final String CUT_ELEMENT_ID = "cut-div"; //$NON-NLS-1$
+
+ public SelectAllAndCut_JBIDE4853(String name) {
+ super(name);
+ }
+
+ public void testSelectAllAndCut() throws Throwable {
+ VpeController vpeController = openInVpe(JsfAllTests.IMPORT_PROJECT_NAME,
+ TEST_PAGE_NAME);
+ StyledText textWidget = vpeController.getSourceEditor()
+ .getTextViewer().getTextWidget();
+
+ textWidget.selectAll();
+ textWidget.cut();
+ TestUtil.waitForIdle();
+
+ nsIDOMDocument document = vpeController.getXulRunnerEditor()
+ .getDOMDocument();
+ assertNull("Element with id='" + CUT_ELEMENT_ID //$NON-NLS-1$
+ + "' has been cut, but still" //$NON-NLS-1$
+ + " exists in the visual part.", //$NON-NLS-1$
+ document.getElementById(CUT_ELEMENT_ID));
+ }
+}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-09-18
12:29:24 UTC (rev 17659)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-09-18
12:42:33 UTC (rev 17660)
@@ -251,11 +251,7 @@
nsIDOMNodeList children = getContentArea().getChildNodes();
long len = children.getLength();
for (long i = len - 1; i >= 0; i--) {
- //added by Maksim Areshkau as fix for
https://jira.jboss.org/jira/browse/JBIDE-4816
- //for XR-1.8 addes <BR _MOZ_EDITOR_BOGUS_NODE="TRUE"
_MOZ_DIRTY=""/> node in document and it's should be deleted
- if(PSEUDO_ELEMENT.equalsIgnoreCase(children.item(i).getNodeName())) {
- getContentArea().removeChild(children.item(i));
- }
+ getContentArea().removeChild(children.item(i));
}
if (sourceDocument != null) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/ve/init.html
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/ve/init.html 2009-09-18 12:29:24 UTC (rev
17659)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/ve/init.html 2009-09-18 12:42:33 UTC (rev
17660)
@@ -68,7 +68,6 @@
<body id="__content__area__">
-<!--This comment is of JBIDE-3396 -->
</body>
</html>