Author: vrubezhny
Date: 2008-02-20 12:31:38 -0500 (Wed, 20 Feb 2008)
New Revision: 6484
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1704Test/WebContent/pages/greeting.xhtml
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1799 CA: There is no CA for <h:outputText
value="|"/> on XHTML pages.
JUnit test case is made to be used with xhtml file
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1704Test/WebContent/pages/greeting.xhtml
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1704Test/WebContent/pages/greeting.xhtml 2008-02-20
17:20:52 UTC (rev 6483)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1704Test/WebContent/pages/greeting.xhtml 2008-02-20
17:31:38 UTC (rev 6484)
@@ -9,6 +9,7 @@
<ui:define name="pageTitle">Greeting to User</ui:define>
<ui:define name="pageHeader">Facelets Greeting Page</ui:define>
<ui:define name="body">
+ <h:outputText value="#{msg.greeting}" />
#{msg.greeting} #{person.name}!
</ui:define>
</ui:composition>
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java 2008-02-20
17:20:52 UTC (rev 6483)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java 2008-02-20
17:31:38 UTC (rev 6484)
@@ -32,7 +32,8 @@
IProject project = null;
boolean makeCopy = false;
private static final String PROJECT_NAME = "JsfJbide1704Test";
- private static final String PAGE_NAME = "/WebContent/pages/greeting.jsp";
+ private static final String PAGE_NAME = "/WebContent/pages/greeting";
+ private static final String[] PAGE_EXTS = {".jsp", ".xhtml"};
private static final String INSERT_BEFORE_STRING = "<h:outputText";
private static final String INSERTION_BEGIN_STRING = "<h:outputText
value=\"";
private static final String INSERTION_END_STRING = "\" />";
@@ -69,11 +70,18 @@
}
assertTrue("Test project \"" + PROJECT_NAME + "\" is not
loaded", (project != null));
- IFile jspFile = project.getFile(PAGE_NAME);
+ for (int i = 0; i < PAGE_EXTS.length; i++) {
+ testJstJspJbide1641(PAGE_NAME + PAGE_EXTS[i]);
+ }
+ }
+
+ private void testJstJspJbide1641(String pageName) {
- assertTrue("The file \"" + PAGE_NAME + "\" is not found",
(jspFile != null));
- assertTrue("The file \"" + PAGE_NAME + "\" is not found",
(jspFile.exists()));
+ IFile jspFile = project.getFile(pageName);
+ assertTrue("The file \"" + pageName + "\" is not found",
(jspFile != null));
+ assertTrue("The file \"" + pageName + "\" is not found",
(jspFile.exists()));
+
FileEditorInput editorInput = new FileEditorInput(jspFile);
Throwable exception = null;
IEditorPart editorPart = null;
@@ -106,13 +114,13 @@
SourceViewerConfiguration config =
TestUtil.getSourceViewerConfiguration(jspTextEditor);
IContentAssistant contentAssistant = (config == null ? null :
config.getContentAssistant(viewer));
- assertTrue("Cannot get the Content Assistant instance for the editor for page
\"" + PAGE_NAME + "\"", (contentAssistant != null));
+ assertTrue("Cannot get the Content Assistant instance for the editor for page
\"" + pageName + "\"", (contentAssistant != null));
// Find start of <h:outputText> tag
String documentContent = document.get();
int start = (documentContent == null ? -1 :
documentContent.indexOf(INSERT_BEFORE_STRING));
- assertTrue("Cannot find the starting point in the test file \"" +
PAGE_NAME + "\"", (start != -1));
+ assertTrue("Cannot find the starting point in the test file \"" +
pageName + "\"", (start != -1));
// First of all perform the test on a region placed in one space behind empty-valued
attribute -
// this is to return normal list of attribute names proposal list