Author: ppitonak(a)redhat.com
Date: 2011-02-02 04:21:41 -0500 (Wed, 02 Feb 2011)
New Revision: 21381
Removed:
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/a4jOutputPanel.css
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/A4JOutputPanelBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jOutputPanel/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jOutputPanel/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
Log:
* sample and tests for a4j:outputPanel refactored
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/A4JOutputPanelBean.properties
===================================================================
---
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/A4JOutputPanelBean.properties 2011-02-02
06:19:07 UTC (rev 21380)
+++
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/A4JOutputPanelBean.properties 2011-02-02
09:21:41 UTC (rev 21381)
@@ -5,7 +5,3 @@
attr.layout.block=block
attr.layout.inline=inline
attr.layout.none=none
-
-attr.styleClass.blue-background=blue-background
-attr.styleClass.gray-background=gray-background
-attr.styleClass.none=
\ No newline at end of file
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jOutputPanel/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jOutputPanel/list.xhtml 2011-02-02
06:19:07 UTC (rev 21380)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jOutputPanel/list.xhtml 2011-02-02
09:21:41 UTC (rev 21381)
@@ -5,7 +5,7 @@
<!--
JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc. and individual contributors
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
full listing of individual contributors.
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jOutputPanel/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jOutputPanel/simple.xhtml 2011-02-02
06:19:07 UTC (rev 21380)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jOutputPanel/simple.xhtml 2011-02-02
09:21:41 UTC (rev 21381)
@@ -6,7 +6,7 @@
<!--
JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc. and individual contributors
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
full listing of individual contributors.
@@ -34,7 +34,6 @@
<f:converter converterId="templatesListConverter" />
</f:viewParam>
</f:metadata>
- <h:outputStylesheet library="css"
name="a4jOutputPanel.css"/>
</ui:define>
<ui:define name="outOfTemplateBefore">
Deleted:
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/a4jOutputPanel.css
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/a4jOutputPanel.css 2011-02-02
06:19:07 UTC (rev 21380)
+++
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/a4jOutputPanel.css 2011-02-02
09:21:41 UTC (rev 21381)
@@ -1,8 +0,0 @@
-.blue-background {
- background-color: #85E9FF;
-}
-
-.gray-background {
- background-color: gray;
- color: white;
-}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java 2011-02-02
06:19:07 UTC (rev 21380)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java 2011-02-02
09:21:41 UTC (rev 21381)
@@ -32,8 +32,6 @@
import java.net.URL;
import org.jboss.test.selenium.dom.Event;
-import org.jboss.test.selenium.locator.Attribute;
-import org.jboss.test.selenium.locator.AttributeLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
@@ -77,19 +75,10 @@
JQueryLocator element = null;
if ("inline".equals(layout)) {
- // for inline layout set background to blue
selenium.click(pjq("input[name$=layoutInput][value=inline]"));
selenium.waitForPageToLoad(TIMEOUT);
-
- selenium.click(optionBlue);
- selenium.waitForPageToLoad(TIMEOUT);
-
element = outputSpan;
} else {
- // for inline layout set background to gray
- selenium.click(optionGray);
- selenium.waitForPageToLoad(TIMEOUT);
-
element = outputDiv;
}
@@ -185,50 +174,12 @@
@Test
public void testStyle() {
- String style = "background-color: magenta; color: white; font-weight:
bold;";
- JQueryLocator styleInput = pjq("input[id$=styleInput]");
- AttributeLocator<?> attributeStyle =
outputDiv.getAttribute(Attribute.STYLE);
-
- selenium.typeKeys(styleInput, style);
- selenium.waitForPageToLoad(TIMEOUT);
-
- String attributeValue = selenium.getAttribute(attributeStyle);
- assertEquals(attributeValue, style, "Value of attribute style.");
-
- selenium.typeKeys(styleInput, "");
- selenium.waitForPageToLoad(TIMEOUT);
-
- if (selenium.isAttributePresent(attributeStyle)) {
- attributeValue = selenium.getAttribute(attributeStyle);
- assertEquals(attributeValue, "", "Value of attribute
style.");
- }
+ testStyle(outputDiv, "style");
}
@Test
public void testStyleClass() {
- JQueryLocator optionNone =
pjq("input[name$=styleClassInput][value=]");
- AttributeLocator<?> attributeClass =
outputDiv.getAttribute(Attribute.CLASS);
-
- selenium.click(optionBlue);
- selenium.waitForPageToLoad(TIMEOUT);
- assertTrue(selenium.belongsClass(outputDiv, "blue-background"),
"Panel should have class blue-background set.");
- assertFalse(selenium.belongsClass(outputDiv, "gray-background"),
- "Panel should not have class gray-background set.");
-
- selenium.click(optionGray);
- selenium.waitForPageToLoad(TIMEOUT);
- assertTrue(selenium.belongsClass(outputDiv, "gray-background"),
"Panel should have class gray-background set.");
- assertFalse(selenium.belongsClass(outputDiv, "blue-background"),
- "Panel should not have class blue-background set.");
-
- selenium.click(optionNone);
- selenium.waitForPageToLoad(TIMEOUT);
- if (selenium.isAttributePresent(attributeClass)) {
- assertFalse(selenium.belongsClass(outputDiv, "blue-background"),
- "Panel should not have class blue-background set.");
- assertFalse(selenium.belongsClass(outputDiv, "gray-background"),
- "Panel should not have class gray-background set.");
- }
+ testStyleClass(outputDiv, "styleClass");
}
@Test