Author: sdzmitrovich
Date: 2008-01-15 12:44:17 -0500 (Tue, 15 Jan 2008)
New Revision: 5724
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1580/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1580/JBIDE-1580-4button.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1580/JBIDE-1580-8button.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/listShuttle.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/Jbide1580Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1580
junits for new template was added
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1580/JBIDE-1580-4button.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1580/JBIDE-1580-4button.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1580/JBIDE-1580-4button.xhtml 2008-01-15
17:44:17 UTC (rev 5724)
@@ -0,0 +1,26 @@
+<!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:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+
+<head>
+</head>
+
+<body>
+<rich:listShuttle sourceValue="#{person.source}"
+ targetValue="#{person.target}" var="items"
targetListWidth="200"
+ sourceCaptionLabel="source label" targetCaptionLabel="target label"
+ orderControlsVerticalAlign="top" fastMoveControlsVisible="false"
+ fastOrderControlsVisible="false">
+
+ <rich:column>
+ <h:outputText value="#{items}"></h:outputText>
+ </rich:column>
+
+</rich:listShuttle>
+
+</body>
+</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1580/JBIDE-1580-8button.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1580/JBIDE-1580-8button.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1580/JBIDE-1580-8button.xhtml 2008-01-15
17:44:17 UTC (rev 5724)
@@ -0,0 +1,25 @@
+<!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:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+
+<head>
+</head>
+
+<body>
+<rich:listShuttle sourceValue="#{person.source}"
+ targetValue="#{person.target}" var="items"
targetListWidth="200"
+ sourceCaptionLabel="source label" targetCaptionLabel="target label"
+ orderControlsVerticalAlign="top">
+
+ <rich:column>
+ <h:outputText value="#{items}"></h:outputText>
+ </rich:column>
+
+</rich:listShuttle>
+
+</body>
+</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/listShuttle.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/listShuttle.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/listShuttle.xhtml 2008-01-15
17:44:17 UTC (rev 5724)
@@ -0,0 +1,25 @@
+<!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:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+
+<head>
+</head>
+
+<body>
+<rich:listShuttle sourceValue="#{person.source}"
+ targetValue="#{person.target}" var="items"
targetListWidth="200"
+ sourceCaptionLabel="source label" targetCaptionLabel="target label"
+ orderControlsVerticalAlign="top">
+
+ <rich:column>
+ <h:outputText value="#{items}"></h:outputText>
+ </rich:column>
+
+</rich:listShuttle>
+
+</body>
+</html>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java 2008-01-15
17:42:36 UTC (rev 5723)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java 2008-01-15
17:44:17 UTC (rev 5724)
@@ -16,6 +16,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
import org.jboss.tools.jsf.vpe.richfaces.test.jbide.JBIDE1579Test;
+import org.jboss.tools.jsf.vpe.richfaces.test.jbide.Jbide1580Test;
import org.jboss.tools.vpe.ui.test.VpeTestSetup;
import org.jboss.tools.vpe.ui.test.beans.ImportBean;
@@ -35,7 +36,7 @@
suite.addTestSuite(RichFacesComponentTest.class);
suite.addTestSuite(JBIDE1579Test.class);
-
+ suite.addTestSuite(Jbide1580Test.class);
// $JUnit-END$
List<ImportBean> projectToImport = new ArrayList<ImportBean>();
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java 2008-01-15
17:42:36 UTC (rev 5723)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java 2008-01-15
17:44:17 UTC (rev 5724)
@@ -211,4 +211,9 @@
performTestForVpeComponent((IFile) TestUtil.getComponentPath(
"components/contextMenu.xhtml", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
}
+
+ public void testListShuttle() throws Throwable {
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath(
+ "components/listShuttle.xhtml", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ }
}
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/Jbide1580Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/Jbide1580Test.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/Jbide1580Test.java 2008-01-15
17:44:17 UTC (rev 5724)
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.vpe.richfaces.test.jbide;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+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 sdzmitrovich
+ *
+ */
+public class Jbide1580Test extends VpeTest {
+
+ public static final String IMPORT_PROJECT_NAME = "richFacesTest";
+
+ public static final String FILE_NAME1 =
"JBIDE/1580/JBIDE-1580-8button.xhtml";
+ public static final String FILE_NAME2 =
"JBIDE/1580/JBIDE-1580-4button.xhtml";
+
+ public Jbide1580Test(String name) {
+ super(name);
+ }
+
+ public void testUsualState() throws Throwable {
+
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(FILE_NAME1,
+ IMPORT_PROJECT_NAME);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ // get dom document
+ nsIDOMDocument document = getVpeVisualDocument(part);
+ assertNotNull(document);
+
+ // get dom element
+ nsIDOMElement element = document.getDocumentElement();
+ assertNotNull(element);
+
+ // get root node
+ nsIDOMNode node = (nsIDOMNode) element
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "img" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_IMG);
+
+ Assert.assertEquals(8, elements.size());
+
+ // check exception
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+ public void testWithoutSomeButton() throws Throwable {
+
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(FILE_NAME2,
+ IMPORT_PROJECT_NAME);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ // get dom document
+ nsIDOMDocument document = getVpeVisualDocument(part);
+ assertNotNull(document);
+
+ // get dom element
+ nsIDOMElement element = document.getDocumentElement();
+ assertNotNull(element);
+
+ // get root node
+ nsIDOMNode node = (nsIDOMNode) element
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "img" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_IMG);
+
+ Assert.assertEquals(4, elements.size());
+
+ // check exception
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+}