Author: mareshkau
Date: 2008-08-13 11:01:48 -0400 (Wed, 13 Aug 2008)
New Revision: 9701
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/924/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/924/pages/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/924/pages/inputname.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/924/templates/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/924/templates/common.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE924Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
junit for JBIDE-924
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/924/pages/inputname.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/924/pages/inputname.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/924/pages/inputname.xhtml 2008-08-13
15:01:48 UTC (rev 9701)
@@ -0,0 +1,27 @@
+<!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">
+
+ <f:loadBundle basename="resources" var="msg" />
+
+ <ui:composition template="/templates/common.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/924/templates/common.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/924/templates/common.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/924/templates/common.xhtml 2008-08-13
15:01:48 UTC (rev 9701)
@@ -0,0 +1,65 @@
+<!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;
+ }
+ </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/JsfAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-08-13
15:01:25 UTC (rev 9700)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-08-13
15:01:48 UTC (rev 9701)
@@ -36,6 +36,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2594Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE924Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1467Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1501Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1568Test;
@@ -88,6 +89,7 @@
suite.addTestSuite(JBIDE2010Test.class);
suite.addTestSuite(JBIDE2582Test.class);
suite.addTestSuite(JBIDE2594Test.class);
+ suite.addTestSuite(JBIDE924Test.class);
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE924Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE924Test.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE924Test.java 2008-08-13
15:01:48 UTC (rev 9701)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+* Copyright (c) 2007-2008 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.jsf.vpe.jsf.test.jbide;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.css.AbsoluteFolderReferenceList;
+import org.jboss.tools.vpe.editor.css.ResourceReference;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+
+/**
+ * @author mareshkau
+ *
+ * JUnit for JBIDE-924
+ */
+public class JBIDE924Test extends VpeTest{
+
+ public JBIDE924Test(String name) {
+ super(name);
+ }
+
+ public void testJBIDE924() throws Throwable {
+
+ // get test page path
+ setException(null);
+ IFile file = (IFile)
TestUtil.getComponentPath("JBIDE/924/pages/inputname.xhtml", //$NON-NLS-1$
+ JsfAllTests.IMPORT_PROJECT_NAME);
+ assertNotNull("Could not open specified file " + file.getFullPath(),
//$NON-NLS-1$
+ file);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input); //$NON-NLS-1$
+
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ VpeController vpeController = getVpeController(part);
+ nsIDOMDocument document = getVpeVisualDocument(part);
+ nsIDOMElement element = document.getDocumentElement();
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+ TestUtil.findAllElementsByName(element, elements, HTML.TAG_TABLE);
+ assertTrue("Faceletes loaded, but shouldn't",elements.size()==0);
//$NON-NLS-1$
+ ResourceReference[] resourceReference = new ResourceReference[1];
+ resourceReference[0] = new
ResourceReference(file.getParent().getParent().getLocation().toString()
,ResourceReference.FILE_SCOPE);
+ AbsoluteFolderReferenceList.getInstance().setAllResources(file, resourceReference
);
+ TestUtil.delay(10000);
+ vpeController.visualRefresh();
+ TestUtil.delay(10000);
+ document = getVpeVisualDocument(part);
+ element = document.getDocumentElement();
+ elements = new ArrayList<nsIDOMNode>();
+ TestUtil.findAllElementsByName(element, elements, HTML.TAG_TABLE);
+
+ assertTrue("Faceletes wasn't loaded from specified
path",elements.size()>=1); //$NON-NLS-1$
+ if(getException()!=null) {
+
+ throw getException();
+ }
+ }
+
+}