Package org.apache.wicket.util.tester

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


    WicketTester tester = new WicketTester();
    tester.startPage(VelocityJavaScriptPage.class);
    System.out.println(tester.getLastResponseAsString());
    tester.assertContains("msg1: " + VelocityJavaScriptPage.MSG1);
    tester.dumpPage();
    tester.destroy();
  }
}
View Full Code Here


    formTester.submit();

    tester.assertRenderedPage(Home.class);
    tester.assertContains("Wicket Examples - library");
    tester.assertLabel("books:0:author", "Effective Java (Joshua Bloch)");
    tester.destroy();
  }
}
View Full Code Here

    label.setMetaData(MetaDataRoleAuthorizationStrategy.ACTION_PERMISSIONS,
      new ActionPermissions());
    MetaDataRoleAuthorizationStrategy.unauthorize(label, mambo, "johan");
    assertFalse(strategy.isActionAuthorized(label, mambo));
    tester.processRequestCycle();
    tester.destroy();
  }

  /**
   * Test consistency in behavior between authorizing a role for an action and then unauthorizing
   * it with {@link #testRemove2()}.
View Full Code Here

      new ActionPermissions());
    MetaDataRoleAuthorizationStrategy.authorize(label, mambo, "johan");
    MetaDataRoleAuthorizationStrategy.unauthorize(label, mambo, "johan");
    assertFalse(strategy.isActionAuthorized(label, mambo));
    tester.processRequestCycle();
    tester.destroy();
  }
}
View Full Code Here

// tester.getServletRequest()
// .setURL("?wicket:bookmarkablePage=:" + Page1.class.getName() + "");
// tester.processRequestCycle();
    tester.startPage(Page1.class);
    tester.assertRenderedPage(Page3.class);
    tester.destroy();
  }

  /** first page, redirects to page 2. */
  public static class Page1 extends WebPage<Void>
  {
View Full Code Here

    BookmarkablePageRequestTarget requestTarget = new BookmarkablePageRequestTarget(
        MockPage.class, params);
    app.setupRequestAndResponse();
    CharSequence cs = wrcs.encode(app.createRequestCycle(), requestTarget);
    assertEquals("?a=1&a=2", cs.toString());
    app.destroy();
  }

  /**
   * Dummy test method. This can be removed and
   * {@link #bugTestEncodeStringArray()} renamed to testX when WICKET-65 is
View Full Code Here

    application.getServletRequest().setRequestToComponent(link);
    application.processRequestCycle();
    document = application.getServletResponse().getDocument();
    DiffUtil.validatePage(document, this.getClass(), "PagedTableNavigatorExpectedResult_8.html", true);

    application.destroy();
  }
}
View Full Code Here

      headerResponse.renderJavaScriptReference("js-resource.js;jsessionid=1h402r54r4xuep32znicouftm", "some-id", false, null);
      String expected = "<script type=\"text/javascript\" id=\"some-id\" src=\"js-resource.js\"></script>\n";
      String actual = headerResponse.getResponse().toString();
      Assert.assertEquals(expected, actual);
    } finally {
      tester.destroy();
    }
  }
}
View Full Code Here

    {
      WicketTester mock = new WicketTester();
      mock.setupRequestAndResponse();
      container.login(ctx);
      mock.processRequestCycle();
      mock.destroy();

    }
    catch (LoginException e)
    {
      log.error(e.getMessage(), e);
View Full Code Here

    {
      WicketTester mock = new WicketTester();
      mock.setupRequestAndResponse();
      container.login(ctx);
      mock.processRequestCycle();
      mock.destroy();
    }
    catch (LoginException e)
    {
      log.error(e.getMessage(), e);
      fail(e.getMessage());
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.