Package org.apache.wicket.util.tester

Examples of org.apache.wicket.util.tester.WicketTester


   * @throws Exception
   */
  @Test
  public void testAuthorized() throws Exception
  {
    WicketTester tester = new WicketTester();
    tester.getApplication()
      .getSecuritySettings()
      .setAuthorizationStrategy(
        new RoleAuthorizationStrategy(new UserRolesAuthorizer("ADMIN")));
    tester.startPage(AdminPage.class);
    tester.assertRenderedPage(AdminPage.class);
  }
View Full Code Here


   * @throws Exception
   */
  @Test
  public void testNotAuthorized() throws Exception
  {
    WicketTester tester = new WicketTester();
    tester.getApplication()
      .getSecuritySettings()
      .setAuthorizationStrategy(
        new RoleAuthorizationStrategy(new UserRolesAuthorizer("USER")));
    final class Listener implements IUnauthorizedComponentInstantiationListener
    {
      private boolean eventReceived = false;

      @Override
      public void onUnauthorizedInstantiation(Component component)
      {
        eventReceived = true;
      }
    }
    Listener listener = new Listener();
    tester.getApplication()
      .getSecuritySettings()
      .setUnauthorizedComponentInstantiationListener(listener);

    try
    {
      tester.startPage(AdminPage.class);
      assertTrue("an authorization exception event should have been received",
        listener.eventReceived);
    }
    catch (Exception e)
    {
View Full Code Here

  private WicketTester tester;

  @Before
  public void setUp() throws Exception
  {
    tester = new WicketTester();
  }
View Full Code Here

  WicketTester tester;

  @Before
  public void before()
  {
    tester = new WicketTester();
  }
View Full Code Here

  WicketTester tester;

  @Before
  public void before()
  {
    tester = new WicketTester();
    WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(tester.getApplication());
    webSocketSettings.setSendPayloadExecutor(new WebSocketSettings.SameThreadExecutor() {
      @Override
      public void run(Runnable command)
      {
View Full Code Here

   */
  @Override
  @Before
  public void before() throws Exception
  {
    tester = new WicketTester();

    WebApplication application = tester.getApplication();
    application.mountPage(EXPECTED_URL.toString(), DummyHomePage.class);

    /**
 
View Full Code Here

  @Override
  protected void setUp() throws Exception
  {
    WebApplication app = new DummyApplication();
    tester = new WicketTester(app);
  }
View Full Code Here

  WicketTester tester;

  @Override
  protected void setUp() throws Exception
  {
    tester = new WicketTester(new MyTesterApplication());
  }
View Full Code Here

  private WicketTester tester;

  @Override
  public void setUp()
  {
    tester = new WicketTester();
    tester.startPage(HomePage.class);
    tester.assertRenderedPage(HomePage.class);
  }
View Full Code Here

  @Override
  protected void setUp() throws Exception
  {
    super.setUp();

    tester = new WicketTester(MockPage.class);
    tester.setupRequestAndResponse();

    final ISecuritySettings settings = tester.getApplication().getSecuritySettings();
    settings.setCryptFactory(new NoCryptFactory());
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.tester.WicketTester

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.