Package org.apache.wicket.mock

Examples of org.apache.wicket.mock.MockApplication


   *
   */
  @Test
  public void testDefaultStringResourceLoaderSetup()
  {
    ResourceSettings settings = new ResourceSettings(new MockApplication());
    List<IStringResourceLoader> loaders = settings.getStringResourceLoaders();
    Assert.assertEquals("There should be 5 default loaders", 5, loaders.size());
    Assert.assertTrue("First loader one should be the component one",
      loaders.get(0) instanceof ComponentStringResourceLoader);
    Assert.assertTrue("Second loader should be the package one",
View Full Code Here


   *
   */
  @Test
  public void testOverrideStringResourceLoaderSetup()
  {
    ResourceSettings settings = new ResourceSettings(new MockApplication());
    settings.getStringResourceLoaders().clear();
    settings.getStringResourceLoaders().add(
      new BundleStringResourceLoader("org.apache.wicket.resource.DummyResources"));
    settings.getStringResourceLoaders().add(new ComponentStringResourceLoader());
    List<IStringResourceLoader> loaders = settings.getStringResourceLoaders();
View Full Code Here

   *
   */
  @Test
  public void testLocalizer()
  {
    MockApplication dummy = new MockApplication();
    dummy.setName("test-app");
    dummy.setServletContext(new MockServletContext(dummy, ""));
    ThreadContext.setApplication(dummy);
    dummy.initApplication();
    Localizer localizer = dummy.getResourceSettings().getLocalizer();
    Assert.assertNotNull("Localizer should be available", localizer);
    dummy.internalDestroy();
  }
View Full Code Here

   * Creates <code>WicketTester</code> and automatically create a <code>WebApplication</code>, but
   * the tester will have no home page.
   */
  public BaseWicketTester()
  {
    this(new MockApplication());
  }
View Full Code Here

   * @param homePage
   *            a home page <code>Class</code>
   */
  public <C extends Page> BaseWicketTester(final Class<C> homePage)
  {
    this(new MockApplication()
    {
      @Override
      public Class<? extends Page> getHomePage()
      {
        return homePage;
View Full Code Here

  /**
   * @return the application that should be used for the test
   */
  protected WebApplication newApplication()
  {
    return new MockApplication();
  }
View Full Code Here

public class DefaultExceptionMapperTest extends WicketTestCase
{
  @Override
  protected WebApplication newApplication()
  {
    return new MockApplication()
    {
      @Override
      protected void init()
      {
        getExceptionSettings().setUnexpectedExceptionDisplay(
View Full Code Here

{

  @Override
  protected WebApplication newApplication()
  {
    return new MockApplication()
    {
      @Override
      protected void init()
      {
        super.init();
View Full Code Here

  }

  @Override
  protected WebApplication newApplication()
  {
    return new MockApplication() {
      @Override
      protected void init()
      {
        super.init();
        setResourceSettings(resSettings);
View Full Code Here

   * @throws Exception
   */
  @Test
  public void testRenderPage13() throws Exception
  {
    tester = new WicketTester(new MockApplication()
    {
      @Override
      protected void init()
      {
        super.init();
View Full Code Here

TOP

Related Classes of org.apache.wicket.mock.MockApplication

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.