Author: sdzmitrovich
Date: 2008-07-08 12:14:04 -0400 (Tue, 08 Jul 2008)
New Revision: 9095
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2170/complex_doctype_test.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2170/templates/1.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2170/templates/2.xhtml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2170Test.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2170
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2170/complex_doctype_test.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2170/complex_doctype_test.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2170/complex_doctype_test.xhtml 2008-07-08
16:14:04 UTC (rev 9095)
@@ -0,0 +1,27 @@
+<!DOCTYPE html1 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">
+
+ <f:loadBundle basename="resources" var="msg" />
+
+ <ui:composition template="templates/1.xhtml">
+
+ <ui:define name="pageTitle">Input User Name</ui:define>
+
+ <ui:define name="pageHeader">Facelets 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" />
+ </form>
+
+ </ui:define>
+ </ui:composition>
+</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2170/templates/1.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2170/templates/1.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2170/templates/1.xhtml 2008-07-08
16:14:04 UTC (rev 9095)
@@ -0,0 +1,4 @@
+<!DOCTYPE html2 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
template="2.xhtml"></ui:composition>
+
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2170/templates/2.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2170/templates/2.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2170/templates/2.xhtml 2008-07-08
16:14:04 UTC (rev 9095)
@@ -0,0 +1,65 @@
+<!DOCTYPE html3 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;
+ }
+ </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
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2170Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2170Test.java 2008-07-08
15:32:51 UTC (rev 9094)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2170Test.java 2008-07-08
16:14:04 UTC (rev 9095)
@@ -30,14 +30,18 @@
*/
public class JsfJbide2170Test extends VpeTest {
- public static final String IMPORT_PROJECT_NAME = "jsfTest";
+ public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
- private static final String WITHOUT_DOCTYPE_TEST_PAGE_NAME =
"JBIDE/2170/there_is_not_doctype.xhtml";
+ private static final String WITHOUT_DOCTYPE_TEST_PAGE_NAME =
"JBIDE/2170/there_is_not_doctype.xhtml"; //$NON-NLS-1$
- private static final String WITH_DOCTYPE_TEST_PAGE_NAME =
"JBIDE/2170/there_is_doctype.xhtml";
+ private static final String WITH_DOCTYPE_TEST_PAGE_NAME =
"JBIDE/2170/there_is_doctype.xhtml"; //$NON-NLS-1$
- private static final String TEMPLATE_DOCTYPE_TEST_PAGE_NAME =
"JBIDE/2170/template_doctype_test.xhtml";
+ private static final String TEMPLATE_DOCTYPE_TEST_PAGE_NAME =
"JBIDE/2170/template_doctype_test.xhtml"; //$NON-NLS-1$
+ private static final String COMPLEX_DOCTYPE_TEST_PAGE_NAME =
"JBIDE/2170/complex_doctype_test.xhtml"; //$NON-NLS-1$
+
+ private static final String CORRECT_NAME = "html3"; //$NON-NLS-1$
+
public JsfJbide2170Test(String name) {
super(name);
}
@@ -177,4 +181,51 @@
}
}
+
+ /**
+ *
+ * @throws Throwable
+ */
+ public void testComplexDoctypePage() throws Throwable {
+
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(
+ COMPLEX_DOCTYPE_TEST_PAGE_NAME, IMPORT_PROJECT_NAME);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ // get doctype from opened page
+ String basicDoctypeString = DocTypeUtil.getDoctype(input);
+
+ // doctype must be not null
+ assertNotNull(basicDoctypeString);
+ // length of doctype must be more than 0
+ assertEquals(true, basicDoctypeString.length() > 0);
+
+ // get dom document
+ nsIDOMDocument document = getVpeVisualDocument(part);
+ assertNotNull(document);
+
+ // get doctype
+ nsIDOMDocumentType vpeDocumentType = document.getDoctype();
+
+ // doctype must be not null
+ assertNotNull(vpeDocumentType);
+
+ assertEquals(CORRECT_NAME, vpeDocumentType.getName());
+ // check exception
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
}