[jboss-user] [JBoss Seam] - Re: Validation fails in registration example

tvrtko do-not-reply at jboss.com
Wed Jan 17 17:02:59 EST 2007


Again, I get the error.

Also, I tried changing Test case like this (I only shortened the password to three characters, and commented the following assert):


  | public class RegisterTest extends SeamTest
  | {
  |    
  |    @Test
  |    public void testLogin() throws Exception
  |    {
  |             
  |       new FacesRequest("/register.jspx") {
  | 
  |          @Override
  |          protected void processValidations() throws Exception
  |          {
  |             validateValue("#{user.username}", "1ovthafew");
  |             validateValue("#{user.name}", "Gavin King");
  |             validateValue("#{user.password}", "sec");
  |             //assert !isValidationFailure();
  |          }
  | 

If I run ant testexample, it fails with:


  | FAILED: org.jboss.seam.example.registration.test.RegisterTest.testLogin()
  | java.lang.NullPointerException
  |     at org.jboss.seam.core.Validation.validate(Validation.java:70)
  |     at org.jboss.seam.mock.SeamTest$Request.validateValue(SeamTest.java:372)
  |     at org.jboss.seam.example.registration.test.RegisterTest$1.processValidations(RegisterTest.java:21)
  |     at org.jboss.seam.mock.SeamTest$Request.run(SeamTest.java:454)
  |     at org.jboss.seam.example.registration.test.RegisterTest.testLogin(RegisterTest.java:16)
  |     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:529)
  |     at org.testng.internal.Invoker.invokeMethod(Invoker.java:398)
  |     at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:625)
  |     at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:88)
  |     at org.testng.TestRunner.privateRun(TestRunner.java:614)
  |     at org.testng.TestRunner.run(TestRunner.java:505)
  |     at org.testng.SuiteRunner.privateRun(SuiteRunner.java:221)
  |     at org.testng.SuiteRunner.run(SuiteRunner.java:147)
  |     at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:576)
  |     at org.testng.TestNG.runSuitesLocally(TestNG.java:539)
  |     at org.testng.TestNG.run(TestNG.java:316)
  |     at org.testng.TestNG.privateMain(TestNG.java:666)
  |     at org.testng.TestNG.main(TestNG.java:608)
  | 

The offending line is:


  | ClassValidator validator = getValidator( model.getClass(), componentName );    
  | 

so I guess that model is null.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4003056#4003056

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4003056



More information about the jboss-user mailing list