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

Max Andersen (JIRA) jira-events at lists.jboss.org
Mon Oct 22 13:02:03 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBSEAM-2138?page=comments#action_12383754 ] 
            
Max Andersen commented on JBSEAM-2138:
--------------------------------------

At least for me it is unnatural for a test to pass without all my assertions have been executed.  

So yes, if we go back to the old behavior (fail if any exception occurred) and enable support for passing tests if only explicit listed exceptions are thrown then I think we got the best comprimise.

> 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