Author: vrubezhny
Date: 2011-05-13 07:22:31 -0400 (Fri, 13 May 2011)
New Revision: 31293
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/.classpath
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/.project
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/jsp_page.jsp
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/theme1.css
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/xhtml_page.xhtml
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/Jbide6061Test.java
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java
Log:
JBIDE-6061
Incorrect Code assist proposals
issue is fixed. Junit Test Case is added
Added: trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/.classpath
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/.classpath
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/.classpath 2011-05-13
11:22:31 UTC (rev 31293)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="JavaSource"/>
+ <classpathentry exported="true" kind="con"
path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry exported="true" kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output"
path="WebContent/WEB-INF/classes"/>
+</classpath>
\ No newline at end of file
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/.project
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/.project
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/.project 2011-05-13
11:22:31 UTC (rev 31293)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Jbide6061Test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.jboss.tools.jsf.jsfnature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ </natures>
+</projectDescription>
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/jsp_page.jsp
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/jsp_page.jsp
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/jsp_page.jsp 2011-05-13
11:22:31 UTC (rev 31293)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html">
+ <jsp:directive.page language="java"
+ contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
/>
+ <jsp:text>
+ <![CDATA[ <?xml version="1.0" encoding="UTF-8" ?>
]]>
+ </jsp:text>
+ <jsp:text>
+ <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ]]>
+ </jsp:text>
+<html
xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
/>
+<title>Insert title here</title>
+<link rel="stylesheet" href="theme1.css" type="text/css"
/>
+</head>
+<body>
+<f:view>
+ <h:inputText value="" styleClass="" />
+</f:view>
+</body>
+</html>
+</jsp:root>
\ No newline at end of file
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/jsp_page.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/theme1.css
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/theme1.css
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/theme1.css 2011-05-13
11:22:31 UTC (rev 31293)
@@ -0,0 +1,49 @@
+.errors {
+ color: red;
+ vertical-align: middle;
+}
+
+h1 {
+ font-family: Arial, sans-serif;
+ color: #578888;
+ font-size: 1.6em;
+ margin-top: 0;
+}
+
+input.cls1[type=submit] {
+color: #FF0000;
+}
+input[type=submit].cls2 {
+color: #0000FF;
+}
+input[type=submit].cls3 {
+color: #00FF00;
+}
+
+a.cls4:link{ text-decoration: none;
+ color: gray;
+}
+
+a.cls4:visited{ text-decoration: none;
+ color: gray;
+}
+
+a.cls4:hover{ text-decoration: none;
+ color: green;
+ font-weight: bolder;
+ letter-spacing: 2px;
+}
+
+a:link.cls5{ text-decoration: none;
+ color: gray;
+}
+
+a:visited.cls5{ text-decoration: none;
+ color: gray;
+}
+
+a:hover.cls5{ text-decoration: none;
+ color: green;
+ font-weight: bolder;
+ letter-spacing: 2px;
+}
\ No newline at end of file
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/theme1.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/xhtml_page.xhtml
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/xhtml_page.xhtml
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/xhtml_page.xhtml 2011-05-13
11:22:31 UTC (rev 31293)
@@ -0,0 +1,12 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core">
+<head>
+ <link rel="stylesheet" href="theme1.css"
type="text/css" />
+</head>
+
+<body class="">
+</body>
+</html>
\ No newline at end of file
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/Jbide6061Test/WebContent/pages/xhtml_page.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
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-05-13
11:11:28 UTC (rev 31292)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java 2011-05-13
11:22:31 UTC (rev 31293)
@@ -13,6 +13,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.jboss.tools.jst.jsp.test.ca.Jbide6061Test;
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;
@@ -21,6 +22,7 @@
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.jboss.tools.jst.jsp.test");
//$NON-NLS-1$
+
suite.addTestSuite(JstJspJbide1585Test.class);
suite.addTestSuite(JstJspJbide1641Test.class);
@@ -31,6 +33,9 @@
*
suite.addTestSuite(Jbide1791Test.class);
*/
+
+ suite.addTestSuite(Jbide6061Test.class);
+
suite.addTestSuite(JspPreferencesPageTest.class);
suite.addTestSuite(SelectionBarTest.class);
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/Jbide6061Test.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/Jbide6061Test.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/Jbide6061Test.java 2011-05-13
11:22:31 UTC (rev 31293)
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * 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 cast testing
http://jira.jboss.com/jira/browse/JBIDE-6061 issue.
+ *
+ * @author Victor V. Rubezhny
+ *
+ */
+public class Jbide6061Test extends ContentAssistantTestCase {
+ private static final String PROJECT_NAME = "Jbide6061Test"; //$NON-NLS-1$
+ private static final String JSP_PAGE_NAME =
"/WebContent/pages/jsp_page.jsp"; //$NON-NLS-1$
+ private static final String XHTML_PAGE_NAME =
"/WebContent/pages/xhtml_page.xhtml"; //$NON-NLS-1$
+ private TestProjectProvider provider = null;
+ private final String[] CSSCLASS_PROPOSALS = new String[]{
+ "errors", //$NON-NLS-1$
+ "cls1", //$NON-NLS-1$
+ "cls2", //$NON-NLS-1$
+ "cls3", //$NON-NLS-1$
+ "cls4", //$NON-NLS-1$
+ "cls5", //$NON-NLS-1$
+ };
+ private static final String STRING_TO_FIND_IN_JSP = "styleClass=\"";
+ private static final String STRING_TO_FIND_IN_XHTML = "class=\"";
+
+ public static Test suite() {
+ return new TestSuite(Jbide6061Test.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 testJbide6061OnJspPage(){
+ openEditor(JSP_PAGE_NAME);
+ IRegion reg=null;
+ try {
+ reg = new FindReplaceDocumentAdapter(this.document).find(0, STRING_TO_FIND_IN_JSP,
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(JSP_PAGE_NAME,reg.getOffset() +
STRING_TO_FIND_IN_JSP.length(), CSSCLASS_PROPOSALS, false);
+
+ checkResult(rst,CSSCLASS_PROPOSALS);
+ closeEditor();
+ }
+
+ public void testJbide6061OnXhtmlPage(){
+ openEditor(XHTML_PAGE_NAME);
+ IRegion reg=null;
+ try {
+ reg = new FindReplaceDocumentAdapter(this.document).find(0, STRING_TO_FIND_IN_XHTML,
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(XHTML_PAGE_NAME,reg.getOffset() +
STRING_TO_FIND_IN_XHTML.length(), CSSCLASS_PROPOSALS, false);
+
+ checkResult(rst,CSSCLASS_PROPOSALS);
+ closeEditor();
+ }
+
+ /**
+ * @param rst
+ * @param proposals
+ */
+ private void checkResult(ICompletionProposal[] rst, String[] proposals) {
+ for ( int i = 0 ; i < proposals.length ; i ++ ){
+ assertTrue("Should be in proposals
list",isInResultList(rst,proposals[i])); //$NON-NLS-1$
+ }
+
+ }
+ /**
+ * @param rst
+ * @param string
+ * @return
+ */
+ private boolean isInResultList(ICompletionProposal[] rst, String string) {
+ boolean r = false;
+
+ for(ICompletionProposal cp:rst){
+ if(cp.getDisplayString().equals(string)){
+ r = true;
+ break;
+ }
+ }
+ return r;
+ }
+}
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/Jbide6061Test.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain