Package org.apache.wicket.mock

Examples of org.apache.wicket.mock.MockApplication


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


  public void notModifiedResponseIncludesExpiresHeader() throws IOException, ServletException,
    ParseException
  {
    try
    {
      application = new MockApplication();
      WicketFilter filter = new WicketFilter();
      filter.init(new FilterTestingConfig());
      ThreadContext.setApplication(application);
      DynamicImageResource resource = new DynamicImageResource()
      {
View Full Code Here

   * @throws Exception
   */
  @Test
  public void ignorePaths() throws Exception
  {
    application = spy(new MockApplication());
    WicketFilter filter = new WicketFilter();
    filter.init(new FilterTestingConfig());

    HttpServletRequest request = mock(HttpServletRequest.class);
    when(request.getLocale()).thenReturn(new Locale("bg", "BG"));
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

   *
   */
  @Test
  public void testFrameworkVersion()
  {
    FrameworkSettings settings = new FrameworkSettings(new MockApplication());
    assertEquals("n/a", settings.getVersion());
  }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void testExceptionOnMissingResourceDefaultValue() throws Exception
  {
    ResourceSettings settings = new ResourceSettings(new MockApplication());
    Assert.assertTrue("exceptionOnMissingResource should default to true",
      settings.getThrowExceptionOnMissingResource());
  }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void testExceptionOnMissingResourceSetsCorrectly() throws Exception
  {
    ResourceSettings settings = new ResourceSettings(new MockApplication());
    settings.setThrowExceptionOnMissingResource(false);
    Assert.assertFalse("exceptionOnMissingResource should have been set to false",
      settings.getThrowExceptionOnMissingResource());
  }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void testUseDefaultOnMissingResourceDefaultValue() throws Exception
  {
    ResourceSettings settings = new ResourceSettings(new MockApplication());
    Assert.assertTrue("useDefaultOnMissingResource should default to true",
      settings.getUseDefaultOnMissingResource());
  }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void testUseDefaultOnMissingResourceSetsCorrectly() throws Exception
  {
    ResourceSettings settings = new ResourceSettings(new MockApplication());
    settings.setUseDefaultOnMissingResource(false);
    Assert.assertFalse("useDefaultOnMissingResource should have been set to false",
      settings.getUseDefaultOnMissingResource());
  }
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.