1) In your java code the link's wicket:id is "back" but in your test
you use "links"
2) You have a space in the Tester.assertLabel ( "links: linkLabel", "Access");
3) What is it you want to test with the Link? remember tester.clickLink

Frank


On Thu, Apr 17, 2008 at 2:36 PM, aynif <[EMAIL PROTECTED]> wrote:
>
>  Hello ev'ry body,
>  First, I apologize for my poor English.
>  I want to know how to perform a link test in JUnit. This is my code :
>
>  Final List <String> values = ....;
>  Link myButton = new Link ( "back") (
>  Private static final long serialVersionUID = 1L;
>  @ Override
>  Public void onClick () (
>  SetResponsePage (New Page (...));
>  )
>  );
>
>  Add (myButton);
>  If (values.isEmpty ())
>  MyButton.setVisible (false);
>
>  in the Test class, i add these lines :
>
>  ...
>  Tester.assertComponent ( "links", Link.class);
>  Tester.assertLabel ( "links: linkLabel", "Access");
>  ...
>
>  My test fails and i have a NullPointerException
>
>  Thanks for yoyr help
>  --
>  View this message in context: 
> http://www.nabble.com/testing-a-link-tp16743958p16743958.html
>  Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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

Reply via email to