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 2012/02/14 13:29:19 UTC

svn commit: r1243897 - in /myfaces/tobago/trunk/tobago-example/tobago-example-test/src: main/webapp/tc/sheet/ test/java/org/apache/myfaces/tobago/example/test/tc/sheet/

Author: lofwyr
Date: Tue Feb 14 12:29:18 2012
New Revision: 1243897

URL: http://svn.apache.org/viewvc?rev=1243897&view=rev
Log:
TOBAGO-1090: tc:sheet with selectable="single" - clear selected row on switching to another table page
 - unit test

Added:
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-bug-tobago-1090.xhtml
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/sheet/
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/sheet/BugTobago1090SeleniumTest.java

Added: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-bug-tobago-1090.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-bug-tobago-1090.xhtml?rev=1243897&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-bug-tobago-1090.xhtml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-bug-tobago-1090.xhtml Tue Feb 14 12:29:18 2012
@@ -0,0 +1,56 @@
+<?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.
+-->
+
+<f:view
+    xmlns:tc="http://myfaces.apache.org/tobago/component"
+    xmlns:tx="http://myfaces.apache.org/tobago/extension"
+    xmlns:ui="http://java.sun.com/jsf/facelets"
+    xmlns:f="http://java.sun.com/jsf/core">
+
+  <tc:page width="800px" height="400px" id="page">
+
+    <tc:box label="TOBAGO-1090">
+      <f:facet name="layout">
+        <tc:gridLayout rows="auto;*;auto"/>
+      </f:facet>
+      <tc:link
+          label="Bug-Tracking: TOBAGO-1090" link="https://issues.apache.org/jira/browse/TOBAGO-1090"/>
+      <tc:out escape="false" value="Single select in the sheet doesn't respect paging.
+            &lt;br/>Checklist:
+            &lt;ol>
+            &lt;li>Click on the 3rd row (Venus)&lt;/li>
+            &lt;li>Click on button for next page&lt;/li>
+            &lt;li>Click on the 2nd row (Saturn)&lt;/li>
+            &lt;li>Click on button for previous page&lt;/li>
+            &lt;li>Check: 3rd row (Venus) must not be selected&lt;/li>
+            &lt;li>Click on button for next page&lt;/li>
+            &lt;li>Check: 2nd row (Saturn) must be selected&lt;/li>
+            &lt;/ol>"/>
+
+      <tc:sheet value="#{sheet.solarArray}" id="sheet" columns="*;*" var="luminary" rows="5" selectable="single">
+        <tc:column label="Name" sortable="true">
+          <tc:out value="#{luminary.name}" id="name"/>
+        </tc:column>
+        <tc:column label="Orbit Of">
+          <tc:out value="#{luminary.orbit}"/>
+        </tc:column>
+      </tc:sheet>
+
+    </tc:box>
+  </tc:page>
+</f:view>

Added: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/sheet/BugTobago1090SeleniumTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/sheet/BugTobago1090SeleniumTest.java?rev=1243897&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/sheet/BugTobago1090SeleniumTest.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/sheet/BugTobago1090SeleniumTest.java Tue Feb 14 12:29:18 2012
@@ -0,0 +1,61 @@
+package org.apache.myfaces.tobago.example.test.tc.sheet;
+
+/*
+ * 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.
+ */
+
+import org.apache.myfaces.tobago.example.test.MultiSuffixSeleniumTest;
+import org.apache.myfaces.tobago.util.Parameterized;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(Parameterized.class)
+public class BugTobago1090SeleniumTest extends MultiSuffixSeleniumTest {
+
+  public BugTobago1090SeleniumTest(String suffix) {
+    super(suffix);
+  }
+
+  @Test
+  public void testWithoutModel() throws InterruptedException {
+
+    // load page
+    open("/tc/sheet/sheet-bug-tobago-1090.");
+
+    // select Venus
+    getSelenium().click("page:sheet:2:name");
+
+    // next page
+    getSelenium().click("page:sheet::pagingPages::Next");
+    getSelenium().waitForCondition(
+        "selenium.browserbot.getCurrentWindow().document.getElementById('page:sheet:6:name') != null", "5000");
+
+    // select Saturn
+    getSelenium().click("page:sheet:6:name");
+
+    // previous page
+    getSelenium().click("page:sheet::pagingPages::Prev");
+    getSelenium().waitForCondition(
+        "selenium.browserbot.getCurrentWindow().document.getElementById('page:sheet:2:name') != null", "5000");
+
+    // Venus is row 3
+    Assert.assertEquals(
+        "Only Saturn should be selected!",
+        ",6,",
+        getSelenium().getAttribute("page:sheet::selected@value"));
+  }
+}