Author: vrubezhny
Date: 2012-01-16 10:23:48 -0500 (Mon, 16 Jan 2012)
New Revision: 37867
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_0.html
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_1.html
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_2.html
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_0.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_1.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_2.xhtml
Log:
JBIDE-10472
CLONE - XHTML Validator hangs eclipse
JUnit Test is added for XHTML/Non-XHTML file detection and validtion
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_0.html
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_0.html
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_0.html 2012-01-16
15:23:48 UTC (rev 37867)
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <title>some title</title>
+</head>
+
+<body>
+<h2>some heading.</h2>
+
+SOME TEST!!!!<br>
+MORE TEXT
+
+<script type="text/javascript" language="javascript" >
+// A comment
+
+function GetCookie (name) {
+ var arg = name + "=";
+ var alen = arg.length;
+ var clen = document.cookie.length;
+ var i = 0;
+ while (i < clen) {
+ var j = i + alen;
+ if (document.cookie.substring(i, j) == arg)
+ return getCookieVal (j);
+ i = document.cookie.indexOf(" ", i) + 1;
+ if (i == 0) break;
+ }
+return null;
+}
+
+function getCookieVal (offset) {
+ var endstr = document.cookie.indexOf (";", offset);
+ if (endstr == -1)
+ endstr = document.cookie.length;
+ return document.cookie.substring(offset, endstr);
+}
+
+//comment
+var xyz = GetCookie('xyz'); // Comments
+
+var datum = new Date();
+
+var d1 = datum.getTime().toString();
+// comment "" bla
+var d2 = "100";
+// comment
+var d3 = "dba";
+// comment
+var abc = 999;
+// comment
+
+function urlEncode (string) {
+ string = string.replace(/ /g, '+');
+ return escape(string);
+ }
+
+// comment
+// comment
+if(cookie != "" && cookie != null ){
+ document.write("<img src=\"http://example.com./xxx?bla=" +
xyz + "&bar="+abc+"&d1=" +urlEncode(d1)+ "&d2="
+urlEncode(d2) +"&d3=" +urlEncode(d3)+"\" alt=\"\"
width=\"1\" height=\"1\" border=\"0\" >");
+}
+else {
+var cookie = "kaz"
+}
+</script>
+
+
+</body>
+</html>
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_0.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_1.html
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_1.html
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_1.html 2012-01-16
15:23:48 UTC (rev 37867)
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <title>some title</title>
+</head>
+
+<body>
+
+<script type="text/javascript" language="javascript" >
+// A comment
+
+function GetCookie (name) {
+
+ while (i < clen) {
+
+ }
+
+return null;
+}
+
+</script>
+
+
+</body>
+</html>
+
+However, the following does not hang:
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+
+<body>
+
+<script type="text/javascript" language="javascript" >
+// A comment
+
+function GetCookie (name) {
+
+ while (i < clen) {
+
+ }
+
+return null;
+}
+
+</script>
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_1.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_2.html
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_2.html
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_2.html 2012-01-16
15:23:48 UTC (rev 37867)
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <title>some title</title>
+</head>
+
+<body>
+
+<script type="text/javascript" language="javascript" >
+// A comment
+
+function GetCookie (name) {
+
+ while (i = clen) {
+
+ }
+
+return null;
+}
+
+</script>
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/html_page_2.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_0.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_0.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_0.xhtml 2012-01-16
15:23:48 UTC (rev 37867)
@@ -0,0 +1,19 @@
+<!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:ez="http://java.sun.com/jsf/composite/demo">
+
+ <ui:composition template="/templates/common.xhtml">
+
+ <ui:define name="pageTitle">Input User Name</ui:define>
+
+ <ui:define name="pageHeader">JSF 2 Hello Application</ui:define>
+
+ <ui:define name="body">
+ <h:message showSummary="true" showDetail="false"
style="color: red; font-weight: bold;" for="inputname" />
+ <ez:input id="inputname" label="${msgs.prompt}"
value="#{user.name}" action="#{user.sayHello}" submitlabel="Say
Hello"/>
+ </ui:define>
+ </ui:composition>
+</html>
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_0.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_1.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_1.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_1.xhtml 2012-01-16
15:23:48 UTC (rev 37867)
@@ -0,0 +1,71 @@
+<!DOCTYPE composition 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"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:m="http://http://java.sun.com/jsf/composite/components/model&q...
+
xmlns:p="http://http://java.sun.com/jsf/composite/components/propert...
+ template="/WEB-INF/layout/template.xhtml">
+
+ <ui:define name="content">
+
+ <div class="section">
+ <h1>Confirm Hotel Booking</h1>
+ </div>
+
+ <div class="section">
+ <m:displayHotel value="#{hotel}"/>
+
+ <p:output label="Total payment"
value="#{booking.total}">
+ <f:convertNumber for="output" type="currency"
currencySymbol="$"/>
+ </p:output>
+
+ <p:output label="Check-in date"
value="#{booking.checkinDate}">
+ <f:convertDateTime for="output" type="date"
pattern="MM/dd/yyyy"/>
+ </p:output>
+
+ <p:output label="Check-out date"
value="#{booking.checkoutDate}">
+ <f:convertDateTime for="output" type="date"
pattern="MM/dd/yyyy"/>
+ </p:output>
+
+ <p:output label="Credit card #"
value="#{booking.creditCardNumber}"/>
+
+ <p:output label="Credit card type"
value="#{booking.creditCardType}"/>
+
+ <div class="buttonBox">
+ <h:form id="confirmForm">
+ <h:commandButton id="confirm" value="Confirm"
action="#{bookingAgent.confirm}"/>
+ #{' '}
+ <h:button id="revise" value="Revise"
outcome="/book.xhtml">
+ <f:param name="cid"
value="#{conversation.id}"/>
+ </h:button>
+ #{' '}
+ <h:commandButton id="cancel" value="Cancel"
action="#{bookingAgent.cancel}" immediate="true"/>
+ </h:form>
+ </div>
+
+ </div>
+
+ </ui:define>
+
+ <ui:define name="sidebar">
+ <!--
+ <h1>Back button navigation</h1>
+ <p>
+ When you click "Confirm", the new booking is written to the
database,
+ the conversation ends, and state associated with the conversation is
+ automatically destroyed by Seam. After you confirm your booking, try
+ hitting the back button on your web browser and clicking "Confirm"
+ again. Seam makes it easy implement applications that behave elegantly
+ in response to the back, forward and refresh buttons.
+ </p>
+ <p>
+ <a href="#"
onclick="window.open('exp/confirmExp.html','exp','width=752,height=500,scrollbars=yes');">
+ What happens when the conversation ends?
+ </a>
+ </p>
+ -->
+ </ui:define>
+
+</ui:composition>
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_1.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_2.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_2.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_2.xhtml 2012-01-16
15:23:48 UTC (rev 37867)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!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">
+
+
+ <ui:composition template="/templates/common.xhtml">
+ <ui:define name="pageTitle">Greeting to User</ui:define>
+ <ui:define name="pageHeader">Greeting Page</ui:define>
+ <ui:define name="body">
+ #{msgs.greeting} #{user.name}!
+ <h:inputText readonly="true" />
+ <h:graphicImage value="/img/seamlogo.png" alt="Seam logo &
copyright" />
+ </ui:define>
+ </ui:composition>
+</html>
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/resources/pages2validate/xhtml_page_2.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain