Author: lfryc(a)redhat.com
Date: 2010-12-06 12:55:11 -0500 (Mon, 06 Dec 2010)
New Revision: 20414
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/templates/header.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
Log:
added output of the view locale to the page and method AbstractMetamerTest.getLocale() for
obtaining locale from tests
Modified: modules/tests/metamer/trunk/application/src/main/webapp/templates/header.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/templates/header.xhtml 2010-12-06
17:54:03 UTC (rev 20413)
+++
modules/tests/metamer/trunk/application/src/main/webapp/templates/header.xhtml 2010-12-06
17:55:11 UTC (rev 20414)
@@ -62,7 +62,10 @@
</f:facet>
</a4j:status>
</a4j:outputPanel>
-
+
+ <h:outputLabel value="Locale" />
+ <h:outputText id="locale"
value="#{facesContext.viewRoot.locale}" />
+
<h:outputText id="showUiDebugLabel" value="Show
ui:debug" />
<h:outputText id="showUiDebug"
value="Ctrl+Shift+L" />
<ui:debug hotkey="L" />
@@ -136,6 +139,8 @@
</h:panelGrid>
+
+
</ui:composition>
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2010-12-06
17:54:03 UTC (rev 20413)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2010-12-06
17:55:11 UTC (rev 20414)
@@ -31,9 +31,11 @@
import static org.testng.Assert.assertTrue;
import java.net.URL;
+import java.util.Locale;
import javax.faces.event.PhaseId;
+import org.apache.commons.lang.LocaleUtils;
import org.jboss.test.selenium.AbstractTestCase;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.encapsulated.JavaScript;
@@ -176,6 +178,15 @@
waitGui.failWith("Attribute on" + attributeName + " does not work
correctly").until(
new EventFiredCondition(event));
}
+
+ /**
+ * Returns the locale of the tested page
+ * @return the locale of the tested page
+ */
+ public Locale getLocale() {
+ String localeString = selenium.getText(id("locale"));
+ return LocaleUtils.toLocale(localeString);
+ }
/**
* A helper method for testing attribute "style". It sets
"background-color: yellow; font-size: 1.5em;" to the input
Show replies by date