From jbosstools-commits at lists.jboss.org Tue Mar 16 14:35:17 2010 Content-Type: multipart/mixed; boundary="===============1588820025810952832==" MIME-Version: 1.0 From: jbosstools-commits at lists.jboss.org To: jbosstools-commits at lists.jboss.org Subject: [jbosstools-commits] JBoss Tools SVN: r20850 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5143 and 4 other directories. Date: Tue, 16 Mar 2010 14:35:17 -0400 Message-ID: <201003161835.o2GIZH3e028570@svn01.web.mwc.hst.phx2.redhat.com> --===============1588820025810952832== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: yzhishko Date: 2010-03-16 14:35:16 -0400 (Tue, 16 Mar 2010) New Revision: 20850 Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebCo= ntent/pages/JBIDE/5143/ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebCo= ntent/pages/JBIDE/5143/test.html trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf= /vpe/jsf/test/jbide/ExceptionInVPEComments_JBIDE5143.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.html/src/org/jboss/tools/vpe/html/= template/HtmlCommentTemplate.java trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/t= est/VpeTest.java Log: https://jira.jboss.org/jira/browse/JBIDE-5143 - fixed Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/W= ebContent/pages/JBIDE/5143/test.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/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebC= ontent/pages/JBIDE/5143/test.html (rev 0) +++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebC= ontent/pages/JBIDE/5143/test.html 2010-03-16 18:35:16 UTC (rev 20850) @@ -0,0 +1,10 @@ + + + + +Insert title here + + + Test --text--> + + \ No newline at end of file Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/to= ols/jsf/vpe/jsf/test/JsfAllTests.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/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/js= f/vpe/jsf/test/JsfAllTests.java 2010-03-16 17:19:22 UTC (rev 20849) +++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/js= f/vpe/jsf/test/JsfAllTests.java 2010-03-16 18:35:16 UTC (rev 20850) @@ -16,6 +16,7 @@ import org.jboss.tools.jsf.vpe.jsf.test.jbide.ChangeMessageBundleTest_JBID= E5818; import org.jboss.tools.jsf.vpe.jsf.test.jbide.ContextMenuDoubleInsertionTe= st_JBIDE3888; import org.jboss.tools.jsf.vpe.jsf.test.jbide.EditFontFamilyTest_JBIDE5872; +import org.jboss.tools.jsf.vpe.jsf.test.jbide.ExceptionInVPEComments_JBIDE= 5143; import org.jboss.tools.jsf.vpe.jsf.test.jbide.FacetProcessingTest; import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1105Test; import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1460Test; @@ -211,6 +212,7 @@ suite.addTestSuite(NaturesChecker_JBIDE5701.class); suite.addTestSuite(FacetProcessingTest.class); suite.addTestSuite(RefreshBundles_JBIDE5460.class); + suite.addTestSuite(ExceptionInVPEComments_JBIDE5143.class); = // $JUnit-END$ return new VpeTestSetup(suite); Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools= /jsf/vpe/jsf/test/jbide/ExceptionInVPEComments_JBIDE5143.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/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/js= f/vpe/jsf/test/jbide/ExceptionInVPEComments_JBIDE5143.java = (rev 0) +++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/js= f/vpe/jsf/test/jbide/ExceptionInVPEComments_JBIDE5143.java 2010-03-16 18:35= :16 UTC (rev 20850) @@ -0,0 +1,62 @@ +/*************************************************************************= ****** + * 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.jsf.vpe.jsf.test.jbide; + +import org.eclipse.core.resources.IFile; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.part.FileEditorInput; +import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests; +import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor; +import org.jboss.tools.vpe.ui.test.TestUtil; +import org.jboss.tools.vpe.ui.test.VpeTest; + +/** + * = + * @author yzhishko + * + */ + +public class ExceptionInVPEComments_JBIDE5143 extends VpeTest { + + public ExceptionInVPEComments_JBIDE5143(String name) { + super(name); + } + + public void testExceptionInVPEComments() throws Throwable { + setException(null); + IFile file =3D (IFile) TestUtil.getComponentPath("JBIDE/5143/test.html",= //$NON-NLS-1$ + JsfAllTests.IMPORT_PROJECT_NAME); + IEditorInput editorInput =3D new FileEditorInput(file); + JSPMultiPageEditor part =3D openEditor(editorInput); + TestUtil.delay(3000); + TestUtil.waitForIdle(); + StyledText styledText =3D part.getSourceEditor().getTextViewer() + .getTextWidget(); + String delimiter =3D styledText.getLineDelimiter(); + int offset =3D styledText.getOffsetAtLine(8); + styledText.setCaretOffset(offset - delimiter.length() - 28); + styledText.insert("-"); //$NON-NLS-1$ + TestUtil.delay(1000); + TestUtil.waitForIdle(); + styledText.insert("-"); //$NON-NLS-1$ + TestUtil.delay(1000); + TestUtil.waitForIdle(); + styledText.insert("!"); //$NON-NLS-1$ + TestUtil.delay(1000); + TestUtil.waitForIdle(); + styledText.insert("<"); //$NON-NLS-1$ + TestUtil.delay(1000); + TestUtil.waitForIdle(); + } + +} Modified: trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vp= e/html/template/HtmlCommentTemplate.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.html/src/org/jboss/tools/vpe/html= /template/HtmlCommentTemplate.java 2010-03-16 17:19:22 UTC (rev 20849) +++ trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html= /template/HtmlCommentTemplate.java 2010-03-16 18:35:16 UTC (rev 20850) @@ -28,7 +28,9 @@ * Template for comment node */ public class HtmlCommentTemplate extends VpeAbstractTemplate { + = = + private static final String doubleHyphen =3D "--"; //$NON-NLS-1$ private static final String COMMENT_STYLE =3D "font-style:italic; colo= r:green"; //$NON-NLS-1$ /* (non-Javadoc) * @see org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.= tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.inte= rfaces.nsIDOMDocument) @@ -44,9 +46,21 @@ ((nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEME= NT_IID)).appendChild(text); = } else { - visualNode =3D visualDocument.createComment(sourceNode.getNodeValue= ()); + visualNode =3D visualDocument.createComment(removeDoubleHyphens(sou= rceNode.getNodeValue())); } return new VpeCreationData(visualNode); } + = + //a part of https://jira.jboss.org/jira/browse/JBIDE-5143 fix + = + private String removeDoubleHyphens(String value){ + StringBuilder stringBuilder =3D new StringBuilder(""); //$NON-NLS-1$ + while (value.indexOf(doubleHyphen)>-1) { + stringBuilder.append(value.substring(0, value.indexOf(doubleHyphen))); + value =3D value.substring(value.indexOf(doubleHyphen)+doubleHyphen.leng= th()); + } + stringBuilder.append(value); + return stringBuilder.toString(); + } = } Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/v= pe/ui/test/VpeTest.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.ui.test/src/org/jboss/tools/vpe/ui/= test/VpeTest.java 2010-03-16 17:19:22 UTC (rev 20849) +++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/= test/VpeTest.java 2010-03-16 18:35:16 UTC (rev 20850) @@ -129,8 +129,12 @@ } = closeEditors(); - + = Platform.removeLogListener(this); + = + if (getException() !=3D null) { + throw new Exception(getException()); + } = super.tearDown(); = --===============1588820025810952832==--