Should have said I'm using Shale!

-----Original Message-----
From: Ian.Priest [mailto:[EMAIL PROTECTED] 
Sent: 19 April 2006 15:59
To: user@struts.apache.org
Subject: setValue() and test-framework

Hi,
 
I think i may have found a bug in the test-framework:
 
I'm have a ViewController that calls setValue() as part of it's
set-up...
 
 
    public class SignupViewController extends AbstractViewController {
 
         private static final String DIALOG_DATA = "#{dialog.data}";

         public String setup() {
 
              ...
 
              // Register the dialogData object for this dialog, and
continue
              setValue(DIALOG_DATA, dialogData);
              return SUCCESS;
 
         }

However, in my test-class the setValue() call causes a
NullPointerException. Here's my test...
 
public class SignupViewControllerTest extends
AbstractViewControllerTestCase {
 
     public static Test suite() {
        return (new TestSuite(SignupViewControllerTest.class));
     }
 
     SignupViewController vc = null;
 
     public void setUp() {
          super.setUp();
  
          vc = new SignupViewController();
     }
 
     public SignupViewControllerTest(String arg0) {
          super(arg0);
     }
 
     public void testSetup() {
  
          vc.setDialogData(new SignupData());
          // run setup
          vc.setup();
          ...
     }

Here's the stack trace
 
java.lang.NullPointerException
 at
org.apache.shale.test.mock.MockPropertyResolver.setValue(MockPropertyRes
olver.java:98)
 at
org.apache.shale.test.mock.MockValueBinding.setValue(MockValueBinding.ja
va:159)
 at
org.apache.shale.view.AbstractFacesBean.setValue(AbstractFacesBean.java:
215)
 at
com.scn.web.dialog.signup.SignupViewController.setup(SignupViewControlle
r.java:65)
 at
com.scn.web.dialog.signup.SignupViewControllerTest.testSetup(SignupViewC
ontrollerTest.java:45)
...
 
Anyone else come across this?
 
Cheers,
Ian


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to