[
http://jira.jboss.com/jira/browse/JBSEAM-2138?page=comments#action_12383766 ]
Norman Richards commented on JBSEAM-2138:
-----------------------------------------
Your assertion isn't being executed in 1.2 or 2.0. That hasn't changed - the
exception is thrown in both cases. What has changed is that SeamTest now correctly
processes seam filters, including the error handling code.
I don't believe it's critical to preserve backwards compatibility for incorrect
old behavior. And, I'll also point out that the exception isn't swallowed
silently. You would have to look at the test output to see it, but it's not
completely hidden. You could also remove your default exception handler in pages.xml to
expose these errors.
That being said, I go back to my original point, that even though it is clear the current
behavior is more correct, the test cases should be able to detect this as otherwise
writing robust tests for the common cases becomes messier. I'm still experimenting to
see what the best way to do this is.
SeamTest has changed it's exception handling behavior
-----------------------------------------------------
Key: JBSEAM-2138
URL:
http://jira.jboss.com/jira/browse/JBSEAM-2138
Project: JBoss Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.0.0.CR2
Reporter: Max Andersen
Assigned To: Norman Richards
Priority: Critical
Fix For: 2.0.0.GA
This passes with no errors in Seam 2:
public class PingTest extends SeamTest {
@Test
public void test() throws Exception {
new FacesRequest() {
@Override
protected void invokeApplication() {
//call action methods here
Object o = invokeMethod("#{ping.thisShouldDefinitlyNotPass}");
assertNotNull(o);
}
}.run();
System.out.println("We passed all tests!");
}
}
Seam 1 gives me:
javax.el.MethodNotFoundException: Method not found:
org.domain.s1.session.Plong(a)392814.plongsdff()
at com.sun.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:143)
at com.sun.el.parser.AstValue.invoke(AstValue.java:171)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:286)
at org.jboss.seam.util.UnifiedELMethodBinding.invoke(UnifiedELMethodBinding.java:36)
at
org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
at
org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
at
org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
at
org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
at org.jboss.seam.mock.SeamTest$Request.invokeMethod(SeamTest.java:401)
at org.domain.s1.test.PlongTest$1.invokeApplication(PlongTest.java:18)
at org.jboss.seam.mock.SeamTest$Request.run(SeamTest.java:489)
at org.domain.s1.test.PlongTest.test(PlongTest.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:604)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:470)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:564)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:830)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.runWorkers(TestRunner.java:678)
at org.testng.TestRunner.privateRun(TestRunner.java:624)
This change will make tests that has a buggy el expression light up green - that's
bad.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira