You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2016/10/07 10:40:15 UTC
svn commit: r1763733 - in /myfaces/tobago/trunk/tobago-example:
tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/
tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/
tobago-example-demo/src/main/webapp/cont...
Author: lofwyr
Date: Fri Oct 7 10:40:15 2016
New Revision: 1763733
URL: http://svn.apache.org/viewvc?rev=1763733&view=rev
Log:
TOBAGO-1544 Revise Demo Application for Tobago 3.0
* test for input group
* test for <tc:columnEvent/>
* add a page with a sheet with more than 1000 entries
* QUnitTests can now ignore specific tests
* minor improvements on demo pages
[developed by hnoeth]
Added:
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/50-input-group/group.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/50-header+footer/x-header-footer-example.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/8000-sheet/20-1000-entries/
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/8000-sheet/20-1000-entries/1000-entries.xhtml
Modified:
myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/PartialReloadController.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/50-input-group/group.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/00-button+link/button+link.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/50-header+footer/header+footer.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/sheet.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4000-button+link/button+link.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/8000-sheet/10-sheet-types/sheet-types.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java?rev=1763733&r1=1763732&r2=1763733&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java Fri Oct 7 10:40:15 2016
@@ -72,6 +72,20 @@ public class SolarObject {
this.population = "Earth".equals(name) ? "ca. 6.800.000.000" : "0";
}
+ public SolarObject(final SolarObject solarObject) {
+ this.name = solarObject.getName();
+ this.number = solarObject.getNumber();
+ this.orbit = solarObject.getOrbit();
+ this.distance = solarObject.getDistance();
+ this.period = solarObject.getPeriod();
+ this.incl = solarObject.getIncl();
+ this.eccen = solarObject.getEccen();
+ this.discoverer = solarObject.getDiscoverer();
+ this.discoverYear = solarObject.getDiscoverYear();
+ this.population = getPopulation();
+ }
+
+
public String getName() {
return name;
}
@@ -234,7 +248,7 @@ public class SolarObject {
public static final SolarObject SUN = new SolarObject("Sun", "-", "-", 0, 0.0, 0.0, 0.0, "-", null);
- public static final SolarObject EARTH =new SolarObject("Earth", "III", "Sun", 149600, 365.26, 0.00, 0.02, "-", null);
+ public static final SolarObject EARTH = new SolarObject("Earth", "III", "Sun", 149600, 365.26, 0.00, 0.02, "-", null);
public static final SolarObject MOON = new SolarObject("Moon", "I", "Earth", 384, 27.32, 5.14, 0.05, "-", null);
public static final SolarObject[] DATA = {
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/PartialReloadController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/PartialReloadController.java?rev=1763733&r1=1763732&r2=1763733&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/PartialReloadController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/PartialReloadController.java Fri Oct 7 10:40:15 2016
@@ -20,6 +20,8 @@
package org.apache.myfaces.tobago.example.demo;
import org.apache.myfaces.tobago.util.AjaxUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.el.ELContext;
import javax.el.ValueExpression;
@@ -30,9 +32,6 @@ import javax.inject.Inject;
import javax.inject.Named;
import java.util.Date;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
@RequestScoped
@Named
public class PartialReloadController {
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java?rev=1763733&r1=1763732&r2=1763733&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java Fri Oct 7 10:40:15 2016
@@ -34,6 +34,7 @@ import javax.faces.convert.DateTimeConve
import javax.faces.event.ActionEvent;
import javax.inject.Named;
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
@@ -46,6 +47,7 @@ public class SheetController implements
private static final Logger LOG = LoggerFactory.getLogger(SheetController.class);
private List<SolarObject> solarList;
+ private List<SolarObject> hugeSolarList;
private SheetState sheetState;
private SolarObject selectedSolarObject;
private boolean automaticLayout;
@@ -54,12 +56,25 @@ public class SheetController implements
public SheetController() {
solarList = SolarObject.getList();
+
+ hugeSolarList = new ArrayList<SolarObject>();
+ for (int i = 1; i <= 12; i++) {
+ for (SolarObject solarObject : solarList) {
+ SolarObject solarObjectClone = new SolarObject(solarObject);
+ solarObjectClone.setName(solarObject.getName() + " (" + i + ". entry)");
+ hugeSolarList.add(solarObjectClone);
+ }
+ }
}
public List<SolarObject> getSolarList() {
return solarList;
}
+ public List<SolarObject> getHugeSolarList() {
+ return hugeSolarList;
+ }
+
public SheetState getSheetState() {
return sheetState;
}
Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/50-input-group/group.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/50-input-group/group.test.js?rev=1763733&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/50-input-group/group.test.js (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/50-input-group/group.test.js Fri Oct 7 10:40:15 2016
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+QUnit.test("span(https://example.com/) - inputfield", function(assert) {
+ var $mainForm = jQueryFrame("#page\\:mainForm");
+ var $inputfield = jQueryFrame("#page\\:mainForm\\:itextbefore");
+ var $span = $inputfield.find("span");
+ var $input = $inputfield.find("input");
+ var combinedWidth = $span.outerWidth(true) + $input.outerWidth(true);
+
+ assert.equal($inputfield.outerWidth(true), $mainForm.width());
+ assert.ok(combinedWidth <= $mainForm.width(),
+ "Width of inputfield (" + $span.outerWidth(true) + "px) + span (" + $input.outerWidth(true) + "px) (="
+ + combinedWidth + "px) must be smaller/equal than the width of the content box (" + $mainForm.width() + "px).");
+ assert.equal($span.outerHeight(), $input.outerHeight());
+});
+
+QUnit.test("label(Price) - inputfield - span(.00 €)", function(assert) {
+ var $mainForm = jQueryFrame("#page\\:mainForm");
+ var $inputfield = jQueryFrame("#page\\:mainForm\\:ipriceafter");
+ var $label = $inputfield.find("label");
+ var $input = $inputfield.find("input");
+ var $span = $inputfield.find("span");
+ var combinedWidth = $label.outerWidth(true) + $span.outerWidth(true) + $input.outerWidth(true);
+
+ assert.equal($inputfield.outerWidth(true), $mainForm.width());
+ assert.ok(combinedWidth <= $mainForm.width(),
+ "Width of label (" + $label.outerWidth(true) + "px) + input (" + $input.outerWidth(true) + "px) + span ("
+ + $span.outerWidth(true) + "px) (=" + combinedWidth
+ + "px) must be smaller/equal than the width of the content box (" + $mainForm.width() + "px).");
+ assert.equal($span.outerHeight(), $input.outerHeight());
+});
+
+QUnit.test("span(User Two) - inputfield - button(Send)", function(assert) {
+ var $mainForm = jQueryFrame("#page\\:mainForm");
+ var $inputfield = jQueryFrame("#page\\:mainForm\\:inewmessage");
+ var $span = $inputfield.find("span");
+ var $input = $inputfield.find("input");
+ var $button = $inputfield.find("button");
+ var combinedWidth = $span.outerWidth(true) + $input.outerWidth(true) + $button.outerWidth(true);
+
+ assert.equal($inputfield.outerWidth(true), $mainForm.width());
+ assert.ok(combinedWidth <= $mainForm.width(),
+ "Width of span (" + $span.outerWidth(true) + "px) + input (" + $input.outerWidth(true) + "px) + button ("
+ + $button.outerWidth(true) + "px) (=" + combinedWidth
+ + "px) must be smaller/equal than the width of the content box (" + $mainForm.width() + "px).");
+ assert.equal($span.outerHeight(), $input.outerHeight());
+ assert.equal($span.outerHeight(), $button.outerHeight());
+});
+
+QUnit.test("dropdown-button - inputfield", function(assert) {
+ var $mainForm = jQueryFrame("#page\\:mainForm");
+ var $inputfield = jQueryFrame("#page\\:mainForm\\:isendtoc");
+ var $button = $inputfield.find("button");
+ var $input = $inputfield.find("input");
+ var combinedWidth = $button.outerWidth(true) + $input.outerWidth(true);
+
+ assert.equal($inputfield.outerWidth(true), $mainForm.width());
+ assert.ok(combinedWidth <= $mainForm.width(),
+ "Width of button (" + $button.outerWidth(true) + "px) + input (" + $input.outerWidth(true) + "px) (="
+ + combinedWidth + "px) must be smaller/equal than the width of the content box (" + $mainForm.width() + "px).");
+ assert.equal($button.outerHeight(), $input.outerHeight());
+});
+
+QUnit.test("inputfield - span(Send To:) - dropdown-button", function(assert) {
+ var $mainForm = jQueryFrame("#page\\:mainForm");
+ var $inputfield = jQueryFrame("#page\\:mainForm\\:isendtorb");
+ var $input = $inputfield.find("input");
+ var $span = $inputfield.find(".input-group-addon");
+ var $button = $inputfield.find("button");
+ var combinedWidth = $input.outerWidth(true) + $span.outerWidth(true) + $button.outerWidth(true);
+
+ assert.equal($inputfield.outerWidth(true), $mainForm.width());
+ assert.ok(combinedWidth <= $mainForm.width(),
+ "Width of input (" + $input.outerWidth(true) + "px) + span (" + $span.outerWidth(true) + "px) + button ("
+ + $button.outerWidth(true) + "px) (=" + combinedWidth
+ + "px) must be smaller/equal than the width of the content box (" + $mainForm.width() + "px).");
+ assert.equal($input.outerHeight(), $span.outerHeight());
+ assert.equal($input.outerHeight(), $button.outerHeight());
+});
+
+QUnit.test("inputfield - dropdownbox", function(assert) {
+ var $mainForm = jQueryFrame("#page\\:mainForm");
+ var $inputfield = jQueryFrame("#page\\:mainForm\\:value");
+ var $input = $inputfield.find("input");
+ var $dropdown = $inputfield.find(".input-group-addon");
+ var combinedWidth = $input.outerWidth(true) + $dropdown.outerWidth(true);
+
+ assert.equal($inputfield.outerWidth(true), $mainForm.width());
+ assert.ok(combinedWidth <= $mainForm.width(),
+ "Width of input (" + $input.outerWidth(true) + "px) + dropdown (" + $dropdown.outerWidth(true) + "px) (="
+ + combinedWidth + "px) must be smaller/equal than the width of the content box (" + $mainForm.width() + "px).");
+ assert.equal($input.outerHeight(), $dropdown.outerHeight());
+});
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/50-input-group/group.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/50-input-group/group.xhtml?rev=1763733&r1=1763732&r2=1763733&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/50-input-group/group.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/50-input-group/group.xhtml Fri Oct 7 10:40:15 2016
@@ -108,7 +108,7 @@
<tc:section label="Radio Buttons">
<pre><code class="language-markup"><tc:in id="isendtorb" placeholder="type a message">
- <f:facet name="before">
+ <f:facet name="after">
<tc:button id="lsendtorb" label="\#{groupController.sendTo}" omit="true">
<tc:selectOneRadio value="\#{groupController.sendTo}">
<tc:selectItem itemValue="SendTo: Peter"/>
@@ -138,13 +138,13 @@
<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
<f:facet name="after">
<tc:selectOneChoice value="#{groupController.currency}">
- <f:selectItems value="#{groupController.currencies}" var="currency"
+ <tc:selectItems value="#{groupController.currencies}" var="currency"
itemValue="#{currency}" itemLabel="#{currency.displayName}"/>
<f:ajax listener="#{groupController.compute}" render="valueInEuro" execute="value"/>
</tc:selectOneChoice>
</f:facet>
</tc:in>
- <tc:out id="valueInEuro" label="Demo value in €" value="#{groupController.valueInEuro}">
+ <tc:out id="valueInEuro" label="Value in €" value="#{groupController.valueInEuro}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" currencySymbol="€"/>
</tc:out>
</tc:section>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/00-button+link/button+link.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/00-button%2Blink/button%2Blink.xhtml?rev=1763733&r1=1763732&r2=1763733&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/00-button+link/button+link.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/00-button+link/button+link.xhtml Fri Oct 7 10:40:15 2016
@@ -123,7 +123,7 @@
...</code></pre>
<p>In addition, a localized file must be available.</p>
<p>In this example, <tc:link label="this link"
- resource="content/20-component/040-command/10-button+link/sample.html"/>
+ resource="content/20-component/040-command/00-button+link/sample.html"/>
leads to a 'sample.html'. When the language is german, it leads to 'sample_de.html'.</p>
<tc:selectOneChoice label="#{overviewBundle.locale}" value="#{clientConfigController2.locale}">
<f:selectItems value="#{clientConfigController2.localeItems}"/>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/50-header+footer/header+footer.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/50-header%2Bfooter/header%2Bfooter.xhtml?rev=1763733&r1=1763732&r2=1763733&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/50-header+footer/header+footer.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/50-header+footer/header+footer.xhtml Fri Oct 7 10:40:15 2016
@@ -26,38 +26,20 @@
respectively <code class="language-markup"><tc:footer/></code> tag.</p>
<tc:section label="Basics">
- <p>In this simple example, a header and a footer are set.
- By default the value of the <code>fixed</code> attribute is 'false'.
- The content of the header, footer and the content between are wrapped in
- <code class="language-markup"><tc:box/></code> tags. The content boxes don't have a label, but a border.
- </p>
- <tc:header>
- <tc:box>
- <p>This is the header.</p>
- </tc:box>
- </tc:header>
- <tc:box>
- <p>This is the content between header and footer.</p>
- </tc:box>
- <tc:footer>
- <tc:box>
- <p>This is the footer.</p>
- </tc:box>
- </tc:footer>
- </tc:section>
-
- <tc:section label="Header">
- <p>The header on this site is fixed.
- It contain the feather icon, the toolbar and the searchbar with the buttons on the right.</p>
+ <p>In this simple example, a <code class="language-markup"><tc:object/></code> show a page with a fixed
+ header and footer. Also you can access this site in a
+ <tc:link label="new tab" link="x-header-footer-example.xhtml" target="_blank"/>.</p>
<pre><code class="language-markup"><tc:header fixed="true">
- ...</code></pre>
- </tc:section>
-
- <tc:section label="Footer">
- <p>The footer on this site is fixed.</p>
- <pre><code class="language-markup"><tc:footer fixed="true">
- © 2016 Apache Software Foundation, Licensed under the <a
- href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+ <tc:style customClass="bg-inverse"/>
+ <p>This is the header.</p>
+ </tc:header>
+ <p>Content between header and footer.</p>
+ ...
+ <tc:footer fixed="true">
+ <p>This is the footer.</p>
</tc:footer></code></pre>
+ <tc:object src="x-header-footer-example.xhtml">
+ <tc:style height="300px" width="100%"/>
+ </tc:object>
</tc:section>
</ui:composition>
Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/50-header+footer/x-header-footer-example.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/50-header%2Bfooter/x-header-footer-example.xhtml?rev=1763733&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/50-header+footer/x-header-footer-example.xhtml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/50-header+footer/x-header-footer-example.xhtml Fri Oct 7 10:40:15 2016
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<ui:composition template="/plain.xhtml"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ <tc:header fixed="true">
+ <tc:style customClass="bg-inverse"/>
+ <p>This is the header.</p>
+ </tc:header>
+ <p>Content between header and footer.</p>
+ <p>Content between header and footer.</p>
+ <p>Content between header and footer.</p>
+ <p>Content between header and footer.</p>
+ <p>Content between header and footer.</p>
+ <p>Content between header and footer.</p>
+ <p>Content between header and footer.</p>
+ <p>Content between header and footer.</p>
+ <p>Content between header and footer.</p>
+ <p>Content between header and footer.</p>
+ <tc:footer fixed="true">
+ <p>This is the footer.</p>
+ </tc:footer>
+</ui:composition>
Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.test.js?rev=1763733&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.test.js (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.test.js Fri Oct 7 10:40:15 2016
@@ -0,0 +1,191 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+QUnit.test("On click with ajax", function(assert) {
+ assert.expect(6);
+ var done = assert.async(4);
+
+ $oneClickAjax = jQueryFrame("#page\\:mainForm\\:changeExample\\:\\:0");
+ $venus = jQueryFrame("#page\\:mainForm\\:s1\\:2\\:columnEventAjax");
+ $jupiter = jQueryFrame("#page\\:mainForm\\:s1\\:5\\:columnEventAjax");
+ $saturn = jQueryFrame("#page\\:mainForm\\:s1\\:6\\:columnEventAjax");
+ $namefield = jQueryFrame("#page\\:mainForm\\:name\\:\\:field");
+
+ $oneClickAjax.click();
+
+ waitForAjax(function() {
+ $venus = jQueryFrame($venus.selector);
+ $jupiter = jQueryFrame($jupiter.selector);
+ $saturn = jQueryFrame($saturn.selector);
+ return $venus.length == 1 && $jupiter.length == 1 && $saturn.length == 1;
+ }, function() {
+ $venus = jQueryFrame($venus.selector);
+ $jupiter = jQueryFrame($jupiter.selector);
+ $saturn = jQueryFrame($saturn.selector);
+ assert.equal($venus.length, 1);
+ assert.equal($jupiter.length, 1);
+ assert.equal($saturn.length, 1);
+ done();
+
+ $venus.click();
+
+ waitForAjax(function() {
+ $namefield = jQueryFrame($namefield.selector);
+ return $namefield.val() == "Venus";
+ }, function() {
+ $namefield = jQueryFrame($namefield.selector);
+ assert.equal($namefield.val(), "Venus");
+ done();
+
+ $jupiter.click();
+
+ waitForAjax(function() {
+ $namefield = jQueryFrame($namefield.selector);
+ return $namefield.val() == "Jupiter";
+ }, function() {
+ $namefield = jQueryFrame($namefield.selector);
+ assert.equal($namefield.val(), "Jupiter");
+ done();
+
+ $saturn.click();
+
+ waitForAjax(function() {
+ $namefield = jQueryFrame($namefield.selector);
+ return $namefield.val() == "Saturn";
+ }, function() {
+ $namefield = jQueryFrame($namefield.selector);
+ assert.equal($namefield.val(), "Saturn");
+ done();
+ });
+ });
+ });
+ });
+});
+
+QUnit.test("On click with full request", function(assert) {
+ assert.expect(6);
+ var done = assert.async(4);
+ var step = 1;
+
+ $oneClickFullRequest = jQueryFrame("#page\\:mainForm\\:changeExample\\:\\:1");
+ $venus = jQueryFrame("#page\\:mainForm\\:s1\\:2\\:columnEventClick");
+ $jupiter = jQueryFrame("#page\\:mainForm\\:s1\\:5\\:columnEventClick");
+ $saturn = jQueryFrame("#page\\:mainForm\\:s1\\:6\\:columnEventClick");
+ $namefield = jQueryFrame("#page\\:mainForm\\:name\\:\\:field");
+
+ $oneClickFullRequest.click();
+
+ waitForAjax(function() {
+ $venus = jQueryFrame($venus.selector);
+ $jupiter = jQueryFrame($jupiter.selector);
+ $saturn = jQueryFrame($saturn.selector);
+ return $venus.length == 1 && $jupiter.length == 1 && $saturn.length == 1;
+ }, function() {
+ if (step == 1) {
+ $venus = jQueryFrame($venus.selector);
+ $jupiter = jQueryFrame($jupiter.selector);
+ $saturn = jQueryFrame($saturn.selector);
+ assert.equal($venus.length, 1);
+ assert.equal($jupiter.length, 1);
+ assert.equal($saturn.length, 1);
+
+ $venus.click();
+ }
+
+ done();
+ step++;
+ });
+
+ jQuery("#page\\:testframe").load(function() {
+ if (step == 2) {
+ $namefield = jQueryFrame($namefield.selector);
+ assert.equal($namefield.val(), "Venus");
+
+ $jupiter = jQueryFrame($jupiter.selector);
+ $jupiter.click();
+ } else if (step == 3) {
+ $namefield = jQueryFrame($namefield.selector);
+ assert.equal($namefield.val(), "Jupiter");
+
+ $saturn = jQueryFrame($saturn.selector);
+ $saturn.click();
+ } else if (step == 4) {
+ $namefield = jQueryFrame($namefield.selector);
+ assert.equal($namefield.val(), "Saturn");
+ }
+
+ step++;
+ done();
+ });
+});
+
+QUnit.test("On double click with full request", function(assert) {
+ assert.expect(6);
+ var done = assert.async(4);
+ var step = 1;
+
+ $doubleClickFullRequest = jQueryFrame("#page\\:mainForm\\:changeExample\\:\\:2");
+ $venus = jQueryFrame("#page\\:mainForm\\:s1\\:2\\:columnEventDblClick");
+ $jupiter = jQueryFrame("#page\\:mainForm\\:s1\\:5\\:columnEventDblClick");
+ $saturn = jQueryFrame("#page\\:mainForm\\:s1\\:6\\:columnEventDblClick");
+ $namefield = jQueryFrame("#page\\:mainForm\\:name\\:\\:field");
+
+ $doubleClickFullRequest.click();
+
+ waitForAjax(function() {
+ $venus = jQueryFrame($venus.selector);
+ $jupiter = jQueryFrame($jupiter.selector);
+ $saturn = jQueryFrame($saturn.selector);
+ return $venus.length == 1 && $jupiter.length == 1 && $saturn.length == 1;
+ }, function() {
+ if (step == 1) {
+ $venus = jQueryFrame($venus.selector);
+ $jupiter = jQueryFrame($jupiter.selector);
+ $saturn = jQueryFrame($saturn.selector);
+ assert.equal($venus.length, 1);
+ assert.equal($jupiter.length, 1);
+ assert.equal($saturn.length, 1);
+
+ $venus.dblclick();
+ }
+
+ done();
+ step++;
+ });
+
+ jQuery("#page\\:testframe").load(function() {
+ if (step == 2) {
+ $namefield = jQueryFrame($namefield.selector);
+ assert.equal($namefield.val(), "Venus");
+
+ $jupiter = jQueryFrame($jupiter.selector);
+ $jupiter.dblclick();
+ } else if (step == 3) {
+ $namefield = jQueryFrame($namefield.selector);
+ assert.equal($namefield.val(), "Jupiter");
+
+ $saturn = jQueryFrame($saturn.selector);
+ $saturn.dblclick();
+ } else if (step == 4) {
+ $namefield = jQueryFrame($namefield.selector);
+ assert.equal($namefield.val(), "Saturn");
+ }
+
+ step++;
+ done();
+ });
+});
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.xhtml?rev=1763733&r1=1763732&r2=1763733&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.xhtml Fri Oct 7 10:40:15 2016
@@ -30,7 +30,7 @@
<tc:section label="Example">
Here are different examples:
- <tc:selectOneRadio value="#{sheetController.columnEventSample}">
+ <tc:selectOneRadio id="changeExample" value="#{sheetController.columnEventSample}">
<tc:selectItem itemValue="0" itemLabel="on click with AJAX"/>
<tc:selectItem itemValue="1" itemLabel="on click with full request"/>
<tc:selectItem itemValue="2" itemLabel="on double click with full request"/>
@@ -39,10 +39,10 @@
<p>Select an object from the SolarObjects list.</p>
<tc:segmentLayout id="example" medium="5;7">
<tc:box label="Solar Objects">
- <tc:sheet id="s1" value="#{sheetController.solarList}" var="object" columns="1*">
+ <tc:sheet id="s1" value="#{sheetController.solarList}" var="object" columns="1*" markup="small">
<tc:style maxHeight="486px"/>
- <tc:column label="#{overviewBundle.solarArrayName}" id="name">
- <tc:out value="#{object.name}" id="t_name"/>
+ <tc:column label="#{overviewBundle.solarArrayName}">
+ <tc:out value="#{object.name}" id="t_name" labelLayout="skip"/>
</tc:column>
<tc:columnEvent id="sample0" rendered="#{sheetController.columnEventSample == 0}">
<tc:command actionListener="#{sheetController.selectSolarObject}" immediate="true" id="columnEventAjax">
@@ -65,7 +65,7 @@
<tc:box id="detail" label="Details">
<tc:panel rendered="#{sheetController.selectedSolarObject != null}">
- <tc:in label="Name" value="#{sheetController.selectedSolarObject.name}" required="true"/>
+ <tc:in id="name" label="Name" value="#{sheetController.selectedSolarObject.name}" required="true"/>
<tc:in label="Number" value="#{sheetController.selectedSolarObject.number}"/>
<tc:in label="Orbit" value="#{sheetController.selectedSolarObject.orbit}"/>
<tc:in label="Distance" value="#{sheetController.selectedSolarObject.distance}"/>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/sheet.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/sheet.xhtml?rev=1763733&r1=1763732&r2=1763733&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/sheet.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/sheet.xhtml Fri Oct 7 10:40:15 2016
@@ -39,10 +39,15 @@
The variablename of a single entry is set by the <code>var</code> attribute, which can be used in the
<code class="language-markup"><tc:column/></code> tags.
In this example, also the <code>rows</code> attribute is set. So only four rows are shown at a time.</p>
+ <p>In most cases, you should set <code class="language-markup">labelLayout="skip"</code> for
+ components which have usually a label.
+ Otherwise those components have a negative affect on the proportion of the sheet.<br/>
+ For components with a label the attribute <code class="language-css">margin-bottom</code> is set.
+ The margin is add to the height of a row.</p>
<pre><code class="language-markup"><tc:sheet value="\#{sheetController.solarList}"
var="solarobject" rows="4">
<tc:column label="Name">
- <tc:out value="\#{solarobject.name}"/>
+ <tc:out value="\#{solarobject.name}" labelLayout="skip"/>
...</code></pre>
<tc:sheet id="s1" value="#{sheetController.solarList}" var="object" rows="4">
<tc:style maxHeight="500px"/>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4000-button+link/button+link.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4000-button%2Blink/button%2Blink.test.js?rev=1763733&r1=1763732&r2=1763733&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4000-button+link/button+link.test.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4000-button+link/button+link.test.js Fri Oct 7 10:40:15 2016
@@ -33,7 +33,6 @@ QUnit.test("Standard Link Button", funct
testStandardCommands($command, $destinationSection, assert, done);
});
-/* PhantomJs don't work with 'resource' attribute. The value for 'href' leads to an nonexisting site.
QUnit.test("Standard Resource Button", function(assert) {
assert.expect(2);
var done = assert.async(2);
@@ -41,7 +40,7 @@ QUnit.test("Standard Resource Button", f
var $command = jQueryFrame("#page\\:mainForm\\:standardButtonResource");
var $destinationSection = jQueryFrame("#page\\:resourceSection");
testStandardCommands($command, $destinationSection, assert, done);
-});*/
+});
QUnit.test("Standard Action Link", function(assert) {
assert.expect(2);
@@ -61,7 +60,6 @@ QUnit.test("Standard Link Link", functio
testStandardCommands($command, $destinationSection, assert, done);
});
-/* PhantomJs don't work with 'resource' attribute. The value for 'href' leads to an nonexisting site.
QUnit.test("Standard Resource Link", function(assert) {
assert.expect(2);
var done = assert.async(2);
@@ -69,7 +67,7 @@ QUnit.test("Standard Resource Link", fun
var $command = jQueryFrame("#page\\:mainForm\\:standardLinkResource");
var $destinationSection = jQueryFrame("#page\\:resourceSection");
testStandardCommands($command, $destinationSection, assert, done);
-});*/
+});
function testStandardCommands($command, $destinationSection, assert, done) {
var step = 1;
@@ -91,8 +89,6 @@ function testStandardCommands($command,
});
}
-// TODO: Test Confirmation: Mock Alerts with sinon
-
QUnit.test("Target Action Button", function(assert) {
assert.expect(1);
var done = assert.async();
@@ -111,7 +107,6 @@ QUnit.test("Target Link Button", functio
testTargetCommands($command, $destinationSection, assert, done);
});
-/* PhantomJs don't work with 'resource' attribute. The value for 'href' leads to an nonexisting site.
QUnit.test("Target Resource Button", function(assert) {
assert.expect(1);
var done = assert.async();
@@ -119,7 +114,7 @@ QUnit.test("Target Resource Button", fun
var $command = jQueryFrame("#page\\:mainForm\\:targetButtonResource");
var $destinationSection = jQueryTargetFrame("#page\\:resourceSection");
testTargetCommands($command, $destinationSection, assert, done);
-});*/
+});
QUnit.test("Target Action Link", function(assert) {
assert.expect(1);
@@ -139,7 +134,6 @@ QUnit.test("Target Link Link", function(
testTargetCommands($command, $destinationSection, assert, done);
});
-/* PhantomJs don't work with 'resource' attribute. The value for 'href' leads to an nonexisting site.
QUnit.test("Target Resource Link", function(assert) {
assert.expect(1);
var done = assert.async();
@@ -147,7 +141,7 @@ QUnit.test("Target Resource Link", funct
var $command = jQueryFrame("#page\\:mainForm\\:targetLinkResource");
var $destinationSection = jQueryTargetFrame("#page\\:resourceSection");
testTargetCommands($command, $destinationSection, assert, done);
-});*/
+});
function testTargetCommands($command, $destinationSection, assert, done) {
$command[0].click();
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/8000-sheet/10-sheet-types/sheet-types.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/8000-sheet/10-sheet-types/sheet-types.test.js?rev=1763733&r1=1763732&r2=1763733&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/8000-sheet/10-sheet-types/sheet-types.test.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/8000-sheet/10-sheet-types/sheet-types.test.js Fri Oct 7 10:40:15 2016
@@ -64,14 +64,12 @@ QUnit.test("Column 6: tc:link", function
testWidthHeight(assert, $column, 70, 57, 29, 20);
});
-/* PhantomJs miscalculate the height of the dropdown box
QUnit.test("Column 7: tc:selectOneChoice", function(assert) {
assert.expect(4);
var $column = getColumn(7);
testWidthHeight(assert, $column, 180, 57, 180, 40);
});
-*/
QUnit.test("Column 8: tc:image", function(assert) {
assert.expect(4);
Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/8000-sheet/20-1000-entries/1000-entries.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/8000-sheet/20-1000-entries/1000-entries.xhtml?rev=1763733&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/8000-sheet/20-1000-entries/1000-entries.xhtml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/8000-sheet/20-1000-entries/1000-entries.xhtml Fri Oct 7 10:40:15 2016
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<ui:composition template="/main.xhtml"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ <ui:param name="title" value="#{overviewBundle.sheet_types}"/>
+ <tc:sheet value="#{sheetController.hugeSolarList}" id="sheet" var="luminary"
+ rows="10" markup="small" >
+ <tc:column label="Name">
+ <tc:out value="#{luminary.name}" labelLayout="skip"/>
+ </tc:column>
+ <tc:column label="Orbit">
+ <tc:out value="#{luminary.orbit}" labelLayout="skip"/>
+ </tc:column>
+ <tc:column label="Period (Days)">
+ <tc:out value="#{luminary.period}" labelLayout="skip"/>
+ </tc:column>
+ <tc:column label="Discoverer">
+ <tc:out value="#{luminary.discoverer}" labelLayout="skip"/>
+ </tc:column>
+ <tc:column label="Year">
+ <tc:out value="#{luminary.discoverYear}" labelLayout="skip"/>
+ </tc:column>
+ </tc:sheet>
+</ui:composition>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java?rev=1763733&r1=1763732&r2=1763733&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java Fri Oct 7 10:40:15 2016
@@ -83,10 +83,12 @@ public class QUnitTests {
private void runStandardTest(String page) throws UnsupportedEncodingException, InterruptedException {
testedPages.add(page);
- String testJs = page.substring(0, page.length() - 6) + ".test.js";
- setupBrowser(page, testJs);
+ if (!ignorePages().contains(page)) {
+ String testJs = page.substring(0, page.length() - 6) + ".test.js";
+ setupBrowser(page, testJs);
- checkQUnitResults(page);
+ checkQUnitResults(page);
+ }
}
private void checkQUnitResults(String page) throws InterruptedException {
@@ -228,6 +230,17 @@ public class QUnitTests {
return xhtmls;
}
+ private List<String> ignorePages() {
+ List<String> ignore = new ArrayList<String>();
+ //Knows bugs
+ ignore.add("content/20-component/010-input/50-input-group/group.xhtml");
+ //PhantomJs don't work with 'resource' attribute.
+ ignore.add("content/40-test/4000-button+link/button+link.xhtml");
+ //PhantomJs miscalculate the height of the dropdown box
+ ignore.add("content/40-test/8000-sheet/10-sheet-types/sheet-types.xhtml");
+ return ignore;
+ }
+
@Test
public void in() throws UnsupportedEncodingException, InterruptedException {
String page = "content/20-component/010-input/10-in/in.xhtml";
@@ -247,6 +260,12 @@ public class QUnitTests {
}
@Test
+ public void group() throws UnsupportedEncodingException, InterruptedException {
+ String page = "content/20-component/010-input/50-input-group/group.xhtml";
+ runStandardTest(page);
+ }
+
+ @Test
public void selectBooleanCheckbox() throws UnsupportedEncodingException, InterruptedException {
String page = "content/20-component/030-select/10-selectBooleanCheckbox/selectBooleanCheckbox.xhtml";
runStandardTest(page);
@@ -282,6 +301,12 @@ public class QUnitTests {
runStandardTest(page);
}
+ @Test
+ public void sheetColumnEvent() throws UnsupportedEncodingException, InterruptedException {
+ String page = "content/20-component/080-sheet/30-event/sheet-column-event.xhtml";
+ runStandardTest(page);
+ }
+
@Test
public void contentValidation() throws UnsupportedEncodingException, InterruptedException {
String page = "content/30-concept/06-validation/00/content-validation.xhtml";