Author: mareshkau
Date: 2009-08-31 12:07:52 -0400 (Mon, 31 Aug 2009)
New Revision: 17383
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4816/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4816/testVisualContentBeforeRefreshAndAfter.html
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/VPERefreshTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/Jsf20ComponentContentTest.java
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
Log:
https://jira.jboss.org/jira/browse/JBIDE-4816
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4816/testVisualContentBeforeRefreshAndAfter.html
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4816/testVisualContentBeforeRefreshAndAfter.html
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4816/testVisualContentBeforeRefreshAndAfter.html 2009-08-31
16:07:52 UTC (rev 17383)
@@ -0,0 +1,2 @@
+<html>
+</html>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/Jsf20ComponentContentTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/Jsf20ComponentContentTest.java 2009-08-31
15:25:12 UTC (rev 17382)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/Jsf20ComponentContentTest.java 2009-08-31
16:07:52 UTC (rev 17383)
@@ -49,6 +49,7 @@
performInvisibleTagTest("components/outputStylesheet.xhtml",
"outputStylesheetBlue"); //$NON-NLS-1$ //$NON-NLS-2$
}
+ @Override
protected String getTestProjectName() {
return JsfAllTests.IMPORT_JSF_20_PROJECT_NAME;
}
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-08-31
15:25:12 UTC (rev 17382)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-08-31
16:07:52 UTC (rev 17383)
@@ -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.VPERefreshTest;
import org.jboss.tools.tests.ImportBean;
import org.jboss.tools.vpe.ui.test.VpeTestSetup;
@@ -161,6 +162,7 @@
suite.addTestSuite(JBIDE3247Test.class);
suite.addTestSuite(JBIDE2550Test.class);
suite.addTestSuite(OpenOnCssClassTest_JBIDE4775.class);
+ suite.addTestSuite(VPERefreshTest.class);
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/VPERefreshTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/VPERefreshTest.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/VPERefreshTest.java 2009-08-31
16:07:52 UTC (rev 17383)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * 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;
+/*******************************************************************************
+ * 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
+ ******************************************************************************/
+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.nsIDOMElement;
+
+/**
+ *
+ * Test case for
https://jira.jboss.org/jira/browse/JBIDE-4816
+ *
+ * @author mareshkau
+ */
+public class VPERefreshTest extends VpeTest{
+
+ public VPERefreshTest(String name) {
+ super(name);
+ }
+
+ public void testVisualContentInVpeVeforeRefreshAndAfter() throws Throwable {
+ VpeController vpeController =
+ openInVpe(JsfAllTests.IMPORT_PROJECT_NAME,
"JBIDE/4816/testVisualContentBeforeRefreshAndAfter.html");//$NON-NLS-1$
+ vpeController.getSourceEditor().getTextViewer().setSelectedRange(0, 0);
+ nsIDOMElement bodyBeforeRefresh = vpeController.getVisualBuilder().getContentArea();
+ long beforeRefreshChields = bodyBeforeRefresh.getChildNodes().getLength();
+ vpeController.visualRefresh();
+ TestUtil.waitForIdle();
+ nsIDOMElement bodyAfterRefresh = vpeController.getVisualBuilder().getContentArea();
+ assertEquals("Number of child nodes before and after refresh should be the
same",beforeRefreshChields, bodyAfterRefresh.getChildNodes().getLength());
//$NON-NLS-1$
+ }
+
+}
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-08-31
15:25:12 UTC (rev 17382)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-08-31
16:07:52 UTC (rev 17383)
@@ -249,7 +249,11 @@
nsIDOMNodeList children = getContentArea().getChildNodes();
long len = children.getLength();
for (long i = len - 1; i >= 0; i--) {
- getContentArea().removeChild(children.item(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));
+ }
}
if (sourceDocument != null) {