Author: ppitonak(a)redhat.com
Date: 2011-01-19 06:19:22 -0500 (Wed, 19 Jan 2011)
New Revision: 21076
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JLogBean.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java
Log:
* sample and tests for a4j:log fixed
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JLogBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JLogBean.java 2011-01-19
10:31:30 UTC (rev 21075)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JLogBean.java 2011-01-19
11:19:22 UTC (rev 21076)
@@ -1,6 +1,6 @@
/*******************************************************************************
* 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.
*
@@ -57,7 +57,7 @@
name = "John";
- attributes = Attributes.getComponentAttributesFromClass(UIAjaxLog.class,
getClass());
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIAjaxLog.class,
getClass());
attributes.setAttribute("rendered", true);
attributes.setAttribute("level", "debug");
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java 2011-01-19
10:31:30 UTC (rev 21075)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java 2011-01-19
11:19:22 UTC (rev 21076)
@@ -195,8 +195,8 @@
private void testLogging(LogLevel logLevel, LogLevel filterLevel) {
JQueryLocator logButton = pjq("input[id$=" +
logLevel.toString().toLowerCase() + "Button]");
JQueryLocator levelInput = pjq("input[type=radio][value=" +
filterLevel.toString().toLowerCase() + "]");
- JQueryLocator msgType = logMsg.getChild(jq("span:eq(0)"));
- JQueryLocator msgContent = logMsg.getChild(jq("span:eq(1)"));
+ JQueryLocator msgType = logMsg.getChild(jq("span.rf-log-entry-lbl"));
+ JQueryLocator msgContent =
logMsg.getChild(jq("span.rf-log-entry-msg"));
if (filterLevel != LogLevel.DEBUG) {
selenium.click(levelInput);
@@ -217,10 +217,9 @@
return;
}
- String output = selenium.getText(msgType).replaceAll(" *\\[.*\\]:$",
"");
- assertEquals(output, logLevel.toString().toLowerCase(), "Message type in
log.");
- output = selenium.getText(msgContent);
- assertEquals(output, logLevel.toString(), "Message content.");
-
+ String loggedValue = selenium.getText(msgType).replaceAll("
*\\[.*\\]:$", "");
+ assertEquals(loggedValue, logLevel.toString().toLowerCase(), "Message type
in log.");
+ loggedValue = selenium.getText(msgContent);
+ assertEquals(loggedValue, logLevel.toString(), "Message content.");
}
}