[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-2138) SeamTest has changed it's exception handling behavior

Norman Richards (JIRA) jira-events at lists.jboss.org
Mon Oct 22 17:20:03 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBSEAM-2138?page=comments#action_12383810 ] 
            
Norman Richards commented on JBSEAM-2138:
-----------------------------------------

Any uncaught exceptions are now passed to onException() to handle.  The default behavior is to wrap them in an AssertionError so that they will look like any test case assertion failure.   Tests that require Seam's exception handler processing can override onException() to not throw the error.  In that case, it will be transformed into a ServletException and handled normally.

> 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 at 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

        



More information about the seam-issues mailing list