Package org.apache.wicket.util.tester

Examples of org.apache.wicket.util.tester.WicketTester.startPage()


     * Tests a missing context.
     */
    public void testMissingContext()
    {
        WicketTester tester = new WicketTester();
        tester.startPage(BeanMetaDataTestPage.class);
        Page page = tester.getLastRenderedPage();
       
        BeanMetaDataTestBean bean = new BeanMetaDataTestBean();
        try {
            BeanMetaData beanMetaData = new BeanMetaData(BeanMetaDataTestBean.class, "missingContext", page, null, false);
View Full Code Here


  public void testSignIn2()
  {
    WicketTester tester = new WicketTester(new SignIn2Application());
    try
    {
      tester.startPage(Home.class);

      tester.assertRenderedPage(SignIn2.class);

      FormTester formTester = tester.newFormTester("signInPanel:signInForm");
      formTester.setValue("username", "wicket");
View Full Code Here

        {
          assertEquals("wicket", cookie.getValue());
        }
      }

      tester.startPage(SignOut.class);
      tester.assertRenderedPage(SignOut.class);

      tester.startPage(Home.class);
      tester.assertRenderedPage(SignIn2.class);
    }
View Full Code Here

      }

      tester.startPage(SignOut.class);
      tester.assertRenderedPage(SignOut.class);

      tester.startPage(Home.class);
      tester.assertRenderedPage(SignIn2.class);
    }
    finally
    {
      tester.destroy();
View Full Code Here

        };
      }

    };

    wicketTester.startPage(TransparentWithAjaxUpdatePage.class);
    wicketTester.clickLink("link", true);
    wicketTester.destroy();
  }

  /** */
 
View Full Code Here

          ExceptionSettings.AjaxErrorStrategy.INVOKE_FAILURE_HANDLER);
      }

    });
    tester.setExposeExceptions(false);
    tester.startPage(InternalErrorCallsAjaxOnFailurePage.class);

    tester.clickLink("failure-link", true);

    MockHttpServletResponse errorPageResponse = tester.getLastResponse();
    assertEquals(500, errorPageResponse.getStatus());
View Full Code Here

  private void run(Class<? extends Page> pageClass)
  {
    WicketTester tester = new WicketTester(new MockApplication());
    try
    {
      tester.startPage(pageClass);
    }
    finally
    {
      tester.destroy();
    }
View Full Code Here

    };

    WicketTester tester = new WicketTester(application);
    try
    {
      tester.startPage(new CustomRequestPage());
    }
    finally
    {
      tester.destroy();
    }
View Full Code Here

    WicketTester tester = new WicketTester();
    tester.getApplication()
      .getSecuritySettings()
      .setAuthorizationStrategy(
        new RoleAuthorizationStrategy(new UserRolesAuthorizer("ADMIN")));
    tester.startPage(AdminPage.class);
    tester.assertRenderedPage(AdminPage.class);
  }

  /**
   * @throws Exception
View Full Code Here

      .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

TOP
Copyright © 2018 www.massapi.com. 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.