Author: vrubezhny
Date: 2011-06-08 11:23:54 -0400 (Wed, 08 Jun 2011)
New Revision: 31915
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/Jbide9092Test.java
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/Jbide1791Test.java
Log:
JBIDE-9092
Wrong attribute name proposals appear in CA Window for CSS styles inside
<style></style> tag
JUnit Test is added
JBIDE-7100
Wrong proposals appear in CA Window for CSS styles inside <style></style> tag
Issue is fixed in UpStream WTP 3.3. JUnit test that covers the issue is enabled
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java 2011-06-08
15:03:55 UTC (rev 31914)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java 2011-06-08
15:23:54 UTC (rev 31915)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Copyright (c) 2007-2011 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,
@@ -13,7 +13,9 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.jboss.tools.jst.jsp.test.ca.Jbide1791Test;
import org.jboss.tools.jst.jsp.test.ca.Jbide6061Test;
+import org.jboss.tools.jst.jsp.test.ca.Jbide9092Test;
import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1585Test;
import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1641Test;
import org.jboss.tools.jst.jsp.test.selbar.SelectionBarTest;
@@ -27,13 +29,8 @@
suite.addTestSuite(JstJspJbide1585Test.class);
suite.addTestSuite(JstJspJbide1641Test.class);
- /*
- * TODO: Uncomment the following test case after
https://jira.jboss.org/browse/JBIDE-7100 issue
- * is resolved due to enable the test to run
- *
suite.addTestSuite(Jbide1791Test.class);
- */
-
+ suite.addTestSuite(Jbide9092Test.class);
suite.addTestSuite(Jbide6061Test.class);
suite.addTestSuite(JspPreferencesPageTest.class);
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/Jbide1791Test.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/Jbide1791Test.java 2011-06-08
15:03:55 UTC (rev 31914)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/Jbide1791Test.java 2011-06-08
15:23:54 UTC (rev 31915)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Copyright (c) 2007-2011 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,
@@ -20,7 +20,8 @@
import org.jboss.tools.test.util.TestProjectProvider;
/**
- * Test cast testing
http://jira.jboss.com/jira/browse/JBIDE-1791 issue.
+ * Test case testing
http://jira.jboss.com/jira/browse/JBIDE-1791 issue.
+ * The same test case is suitable for
http://jira.jboss.com/jira/browse/JBIDE-7100 issue
*
* @author Eugene Stherbin
*
@@ -62,6 +63,8 @@
} catch (BadLocationException e) {
fail(e.getMessage());
}
+ assertNotNull("Cannot find a text region to test", reg);
+
final ICompletionProposal[] rst = checkProposals(PAGE_NAME,reg.getOffset(),
proposals, false);
checkResult(rst,proposals);
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/Jbide9092Test.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/Jbide9092Test.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/Jbide9092Test.java 2011-06-08
15:23:54 UTC (rev 31915)
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jst.jsp.test.ca;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.jboss.tools.test.util.TestProjectProvider;
+
+/**
+* Test case testing
http://jira.jboss.com/jira/browse/JBIDE-9092 issue.
+*
+* @author Victor Rubezhny
+*
+*/
+public class Jbide9092Test extends ContentAssistantTestCase {
+ private static final String PROJECT_NAME = "JsfJbide1791Test";
//$NON-NLS-1$
+ private static final String PAGE_NAME = "/WebContent/pages/jbide1791.xhtml";
//$NON-NLS-1$
+ private TestProjectProvider provider = null;
+
+ public static Test suite() {
+ return new TestSuite(Jbide9092Test.class);
+ }
+
+ public void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null,
PROJECT_NAME,false); //$NON-NLS-1$
+ project = provider.getProject();
+ }
+
+ protected void tearDown() throws Exception {
+ if(provider != null) {
+ provider.dispose();
+ }
+ }
+
+ public void testJbide9092(){
+
+ // Do not use dir-attribute here because there is dir-tag proposal (the correct
proposal with the same name)
+ final String[] wrongProposals = new String[]{
+ "jsfc", //$NON-NLS-1$
+ "lang", //$NON-NLS-1$
+ "media", //$NON-NLS-1$
+ "title", //$NON-NLS-1$
+ "type", //$NON-NLS-1$
+ };
+ openEditor(PAGE_NAME);
+ try {
+ IRegion reg=null;
+ try {
+ reg = new FindReplaceDocumentAdapter(this.document).find(0, "<style",
true, false, false, false); //$NON-NLS-1$
+ } catch (BadLocationException e) {
+ fail(e.getMessage());
+ }
+ assertNotNull("Cannot find a text region to test", reg);
+ try {
+ reg = new FindReplaceDocumentAdapter(this.document).find(reg.getOffset(),
">", true, false, false, false); //$NON-NLS-1$
+ } catch (BadLocationException e) {
+ fail(e.getMessage());
+ }
+ assertNotNull("Cannot find a text region to test", reg);
+
+ final ICompletionProposal[] rst = checkProposals(PAGE_NAME,reg.getOffset() +
reg.getLength(), new String[] {}, false);
+
+ checkNotInResult(rst,wrongProposals);
+ } finally {
+ closeEditor();
+ }
+ }
+ /**
+ * @param rst
+ * @param proposals
+ */
+ private void checkNotInResult(ICompletionProposal[] rst, String[] proposals) {
+ for ( int i = 0 ; i < proposals.length ; i ++ ){
+ assertTrue("Proposal '" + proposals[i] + "' should NOT
be in proposals list",isNotInResultList(rst,proposals[i])); //$NON-NLS-1$
+ }
+
+ }
+ /**
+ * @param rst
+ * @param string
+ * @return
+ */
+ private boolean isNotInResultList(ICompletionProposal[] rst, String string) {
+ for(ICompletionProposal cp:rst){
+ if(cp.getDisplayString().equals(string)){
+ return false;
+ }
+ }
+ return true;
+ }
+}
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/Jbide9092Test.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain