From jbosstools-commits at lists.jboss.org Sat Nov 29 11:37:05 2008 Content-Type: multipart/mixed; boundary="===============3540597929001018453==" MIME-Version: 1.0 From: jbosstools-commits at lists.jboss.org To: jbosstools-commits at lists.jboss.org Subject: [jbosstools-commits] JBoss Tools SVN: r12148 - in trunk/vpe: tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages and 3 other directories. Date: Sat, 29 Nov 2008 11:37:04 -0500 Message-ID: --===============3540597929001018453== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: yradtsevich Date: 2008-11-29 11:37:04 -0500 (Sat, 29 Nov 2008) New Revision: 12148 Added: trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebCont= ent/pages/jbide3280/ trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebCont= ent/pages/jbide3280/jbide3280.html trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/ht= ml/test/jbide/ trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/ht= ml/test/jbide/JBIDE3280Test.java Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/moz= illa/MozillaEditor.java trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/ht= ml/test/HtmlAllTests.java Log: RESOLVED - issue JBIDE-3280: Styles crash in tag after refresh butto= n press. https://jira.jboss.org/jira/browse/JBIDE-3280 - JUnit test has been written Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/edi= tor/mozilla/MozillaEditor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mo= zilla/MozillaEditor.java 2008-11-29 15:58:03 UTC (rev 12147) +++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mo= zilla/MozillaEditor.java 2008-11-29 16:37:04 UTC (rev 12148) @@ -86,7 +86,7 @@ = public class MozillaEditor extends EditorPart implements IReusableEditor { protected static final String INIT_URL =3D /*"file://" +*/ (new File(VpeP= lugin.getDefault().getResourcePath("ve"), "init.html")).getAbsolutePath(); = //$NON-NLS-1$ //$NON-NLS-2$ - private static final String CONTENT_AREA_ID =3D "__content__area__"; //$N= ON-NLS-1$ + public static final String CONTENT_AREA_ID =3D "__content__area__"; //$NO= N-NLS-1$ = static String SELECT_BAR =3D "SELECT_LBAR"; //$NON-NLS-1$ private XulRunnerEditor xulRunnerEditor; Added: trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/Web= Content/pages/jbide3280/jbide3280.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebCon= tent/pages/jbide3280/jbide3280.html (rev 0) +++ trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebCon= tent/pages/jbide3280/jbide3280.html 2008-11-29 16:37:04 UTC (rev 12148) @@ -0,0 +1,10 @@ + + + + +Insert title here + + + Red Text + + \ No newline at end of file Modified: trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools= /vpe/html/test/HtmlAllTests.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/h= tml/test/HtmlAllTests.java 2008-11-29 15:58:03 UTC (rev 12147) +++ trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/h= tml/test/HtmlAllTests.java 2008-11-29 16:37:04 UTC (rev 12148) @@ -17,6 +17,7 @@ import junit.framework.TestSuite; = import org.jboss.tools.tests.ImportBean; +import org.jboss.tools.vpe.html.test.jbide.JBIDE3280Test; import org.jboss.tools.vpe.ui.test.VpeTestSetup; = = @@ -36,6 +37,7 @@ = TestSuite suite =3D new TestSuite("Tests for Vpe Jsf components"); //$NO= N-NLS-1$ // $JUnit-BEGIN$ + suite.addTestSuite(JBIDE3280Test.class); suite.addTestSuite(HtmlComponentTest.class); suite.addTestSuite(HtmlComponentContentTest.class); = Added: trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vp= e/html/test/jbide/JBIDE3280Test.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/h= tml/test/jbide/JBIDE3280Test.java (rev 0) +++ trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/h= tml/test/jbide/JBIDE3280Test.java 2008-11-29 16:37:04 UTC (rev 12148) @@ -0,0 +1,93 @@ +/*************************************************************************= ****** + * Copyright (c) 2007-2008 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.vpe.html.test.jbide; + +import org.eclipse.core.resources.IFile; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.part.FileEditorInput; +import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor; +import org.jboss.tools.vpe.VpeDebug; +import org.jboss.tools.vpe.editor.VpeController; +import org.jboss.tools.vpe.editor.mozilla.MozillaEditor; +import org.jboss.tools.vpe.editor.util.HTML; +import org.jboss.tools.vpe.html.test.HtmlAllTests; +import org.jboss.tools.vpe.ui.test.TestUtil; +import org.jboss.tools.vpe.ui.test.VpeTest; +import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper; +import org.mozilla.interfaces.nsIDOMDocument; + +/** + * Check if style of body before refresh equals style of body after refresh + * = + * @author yradtsevich + * + */ +public class JBIDE3280Test extends VpeTest { + + private static final String TEST_PAGE_NAME=3D"jbide3280/jbide3280.html"; = //$NON-NLS-1$ + = + public JBIDE3280Test(String name) { + super(name); + } + = + public void testJBIDE3280() throws Throwable { + setException(null); + + IFile elementPageFile =3D (IFile) TestUtil.getComponentPath( + TEST_PAGE_NAME, HtmlAllTests.IMPORT_PROJECT_NAME); + + IEditorInput input =3D new FileEditorInput(elementPageFile); + + TestUtil.waitForJobs(); + + IEditorPart editor =3D PlatformUI.getWorkbench() + .getActiveWorkbenchWindow().getActivePage().openEditor(input, + EDITOR_ID, true); + + assertNotNull(editor); + + TestUtil.waitForJobs(); + + VpeController controller =3D getVpeController((JSPMultiPageEditor) edito= r); + + final nsIDOMDocument oldDocument =3D controller.getXulRunnerEditor().get= DOMDocument(); + final String oldStyle =3D oldDocument + .getElementById(MozillaEditor.CONTENT_AREA_ID) + .getAttribute(HTML.ATTR_STYLE); + = + controller.visualRefresh(); + + TestUtil.waitForIdle(); + + final nsIDOMDocument newDocument =3D controller.getXulRunnerEditor().get= DOMDocument(); + final String newStyle =3D newDocument + .getElementById(MozillaEditor.CONTENT_AREA_ID) + .getAttribute(HTML.ATTR_STYLE); + = + = + // check if style of body before refresh equals style of body after refr= esh = + assertEquals(oldStyle, newStyle); + + if (getException() !=3D null) { + throw getException(); + } + } + = + protected String dump(nsIDOMDocument document) { + DOMTreeDumper dumper =3D new DOMTreeDumper( + VpeDebug.VISUAL_DUMP_PRINT_HASH); + dumper.setIgnoredAttributes(VpeDebug.VISUAL_DUMP_IGNORED_ATTRIBUTES); + dumper.dumpToStream(System.out, document); + return null; + } +} --===============3540597929001018453==--