Author: mareshkau
Date: 2008-02-14 09:35:23 -0500 (Thu, 14 Feb 2008)
New Revision: 6314
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/788/templates/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/788/templates/common.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/788/testCAMessageBundlesAndEL.xhtml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/WEB-INF/faces-config.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/788/testCAforHtml.html
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
Log:
junit tests for CA
http://jira.jboss.com/jira/browse/JBIDE-788
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/WEB-INF/faces-config.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/WEB-INF/faces-config.xml 2008-02-14
10:51:19 UTC (rev 6313)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/WEB-INF/faces-config.xml 2008-02-14
14:35:23 UTC (rev 6314)
@@ -1,7 +1,15 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
-
xmlns:xi="http://www.w3.org/2001/XInclude"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
-
-</faces-config>
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+ <managed-bean>
+ <managed-bean-name>user</managed-bean-name>
+ <managed-bean-class>demo.User</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>name</property-name>
+ <value />
+ </managed-property>
+ </managed-bean>
+</faces-config>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/788/templates/common.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/788/templates/common.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/788/templates/common.xhtml 2008-02-14
14:35:23 UTC (rev 6314)
@@ -0,0 +1,68 @@
+<!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">
+
+ <f:loadBundle basename="resources" var="msg" />
+ <head>
+ <title><ui:insert name="pageTitle">Page
Title</ui:insert></title>
+ <style type="text/css">
+ body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ }
+ .header {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 18px;
+ }
+ .bottom {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 9px;
+ text-align: center;
+ vertical-align: middle;
+ color: #8E969D;
+ }
+ .mystyle {
+ ba
+ }
+ </style>
+ </head>
+
+<body bgcolor="#ffffff">
+<table style="border:1px solid #CAD6E0" align="center"
cellpadding="0" cellspacing="0" border="0"
width="400">
+<tbody>
+
+ <tr>
+ <td class="header" height="42" align="center"
valign="middle" width="100%" bgcolor="#E4EBEB">
+ <ui:insert name="pageHeader">Page Header</ui:insert>
+ </td>
+ </tr>
+ <tr>
+ <td height="1" width="100%"
bgcolor="#CAD6E0"></td>
+ </tr>
+
+ <tr>
+ <td width="100%" colspan="2">
+ <table width="100%" style="height:150px" align="left"
cellpadding="0" cellspacing="0" border="0">
+ <tbody>
+ <tr>
+ <td align="center" width="100%"
valign="middle">
+
+ <ui:insert name="body">Page Body</ui:insert>
+
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" valign="bottom" height="1"
width="100%" bgcolor="#CAD6E0"></td>
+ </tr>
+</tbody>
+</table>
+</body>
+
+</html>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/788/testCAMessageBundlesAndEL.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/788/testCAMessageBundlesAndEL.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/788/testCAMessageBundlesAndEL.xhtml 2008-02-14
14:35:23 UTC (rev 6314)
@@ -0,0 +1,32 @@
+<!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"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <f:loadBundle basename="resources" var="msg" />
+
+ <ui:composition template="./templates/common.xhtml">
+
+ <ui:define name="pageTitle">JSF 1.2 and Facelets under Tomcat.
KickStart Application</ui:define>
+
+ <ui:define name="pageHeader">JSF 1.2 Hello
Application</ui:define>
+
+ <ui:define name="body">
+ <h:message showSummary="true" showDetail="false"
style="color: red; font-weight: bold;" for="name" />
+ <form jsfc="h:form" id="helloForm">
+ ${msg.prompt}
+ <input label="Name" jsfc="h:inputText"
required="true" id="name" value="#{person.name}" />
+ <input type="submit" jsfc="h:commandButton"
id="submit"
+ action="greeting" value="Say Hello" />
+ <h:outputText value="#{person.name}" />
+ </form>
+
+ <form jsfc="" id="Test Form">
+ <h:outputText value="" />
+ </form>
+ </ui:define>
+ </ui:composition>
+</html>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/788/testCAforHtml.html
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/788/testCAforHtml.html 2008-02-14
10:51:19 UTC (rev 6313)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/788/testCAforHtml.html 2008-02-14
14:35:23 UTC (rev 6314)
@@ -2,6 +2,6 @@
<head>
</head>
<body>
- Test
+ Test
</body>
</html>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2008-02-14
10:51:19 UTC (rev 6313)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2008-02-14
14:35:23 UTC (rev 6314)
@@ -33,11 +33,52 @@
public class JBIDE788Test extends VpeTest{
private static final String IMPORT_PROJECT_NAME = "jsfTest";
+
+ private static final String CA_NAME = "org.eclipse.wst.html.HTML_DEFAULT";
public JBIDE788Test(String name) {
super(name);
}
/**
+ * Tests CA for Messages Bundles and EL Values
+ * @throws Throwable
+ */
+ public void testCAforMessageBundlesAndELExpressions() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+ //Tests CA
+
+ baseCheckofCA(CA_NAME, "JBIDE/788/testCAMessageBundlesAndEL.xhtml", 1245,
2);
+
+ // check exception
+ if (getException() != null) {
+
+ throw getException();
+ }
+ }
+
+ /**
+ * Tests CA for proposals for JSFC
+ * @throws Throwable
+ */
+ public void testCAforForJSFCProposals() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+ //Tests CA
+ baseCheckofCA(CA_NAME, "JBIDE/788/testCAMessageBundlesAndEL.xhtml", 1200,
101);
+
+ // check exception
+ if (getException() != null) {
+
+ throw getException();
+ }
+
+ }
+ /**
* Tests CA on html files
* @throws Throwable
*/
@@ -47,7 +88,7 @@
// set exception
setException(null);
//Tests CA
- baseCheckofCA("org.eclipse.wst.html.HTML_DEFAULT",
"JBIDE/788/testCAforHtml.html", 32, 79);
+ baseCheckofCA(CA_NAME, "JBIDE/788/testCAforHtml.html", 39, 79);
// check exception
if (getException() != null) {
@@ -65,7 +106,7 @@
// set exception
setException(null);
//Tests CA
- baseCheckofCA("org.eclipse.wst.html.HTML_DEFAULT",
"JBIDE/788/testCAforJSP.jsp", 1000, 110);
+ baseCheckofCA(CA_NAME, "JBIDE/788/testCAforJSP.jsp", 1000, 110);
// check exception
if (getException() != null) {
@@ -82,7 +123,7 @@
// set exception
setException(null);
//Tests CA
- baseCheckofCA("org.eclipse.wst.html.HTML_DEFAULT",
"JBIDE/788/testCAforXHTML.xhtml", 745, 96);
+ baseCheckofCA(CA_NAME, "JBIDE/788/testCAforXHTML.xhtml", 745, 96);
// check exception
if (getException() != null) {
@@ -111,6 +152,9 @@
// open and get editor
JSPMultiPageEditor part = openEditor(input);
+
+ //sets cursor position
+ part.getSourceEditor().getTextViewer().getTextWidget().setCaretOffset(position);
TestUtil.waitForJobs();
TestUtil.delay(2000);
SourceViewerConfiguration sourceViewerConfiguration =
((JSPTextEditor)part.getSourceEditor()).getSourceViewerConfigurationForTest();