Package net.sourceforge.pebble.web.view

Examples of net.sourceforge.pebble.web.view.View


    request.setParameter("path", "/");
    request.setParameter("name", new String[]{"afile.txt"});
    request.setParameter("type", FileMetaData.BLOG_FILE);

    View view = action.process(request, response);

    // check file now exists and the right view is returned
    assertFalse("File still exists", file.exists());
    assertTrue(view instanceof RedirectView);
  }
View Full Code Here


  public void testDeleteFileReturnsForbiddenWheOutsideOfRoot() throws Exception {
    request.setParameter("path", "/");
    request.setParameter("name", new String[]{"../afile.txt"});
    request.setParameter("type", FileMetaData.BLOG_FILE);

    View view = action.process(request, response);

    // check a forbidden response is returned
    assertTrue(view instanceof ForbiddenView);
  }
View Full Code Here

    request.setParameter("avatar", "http://www.somedomain.com/avatar");
    request.setParameter("submit", "Add Comment");

    SecurityUtils.runAsBlogContributor();

    View view = action.process(request, response);
    assertTrue(view instanceof CommentConfirmationView);

    blogEntry = service.getBlogEntry(blog, blogEntry.getId());
    assertEquals(1, blogEntry.getComments().size());
View Full Code Here

    request.setParameter("avatar", "http://www.somedomain.com/avatar");
    request.setParameter("submit", "Add Comment");

    SecurityUtils.runAsBlogContributor();

    View view = action.process(request, response);
    assertTrue(view instanceof CommentConfirmationView);

    blogEntry = service.getBlogEntry(blog, blogEntry.getId());
    assertEquals(2, blogEntry.getComments().size());
View Full Code Here

    request.setParameter("avatar", "http://www.somedomain.com/avatar");
    request.setParameter("submit", "Add Comment");

    SecurityUtils.runAsBlogContributor();

    View view = action.process(request, response);
    assertTrue(view instanceof CommentConfirmationView);

    blogEntry = service.getBlogEntry(blog, blogEntry.getId());
    assertEquals(1, blogEntry.getComments().size());
View Full Code Here

    request.setParameter("avatar", "http://www.somedomain.com/avatar");
    request.setParameter("submit", "Add Comment");

    SecurityUtils.runAsAnonymous();

    View view = action.process(request, response);
    assertTrue(view instanceof ConfirmCommentView);
    assertEquals(0, blogEntry.getComments().size());
  }
View Full Code Here

    request.setParameter("author", "Test Author");
    request.setParameter("website", "Test Website");
    request.setParameter("avatar", "http://www.somedomain.com/avatar");
    request.setParameter("submit", "Add Comment");

    View view = action.process(request, response);
    assertTrue(view instanceof CommentConfirmationView);
    assertEquals(0, blogEntry.getComments().size());
  }
View Full Code Here

    request.setParameter("path", "/");
    request.setParameter("name", "newdirectory");
    request.setParameter("type", FileMetaData.BLOG_IMAGE);

    View view = action.process(request, response);

    // check file now exists and the right view is returned
    file = new File(blog.getImagesDirectory(), "newdirectory");
    assertTrue("File doesn't exist", file.exists());
    assertTrue(view instanceof RedirectView);
View Full Code Here

  public void testCreateDirectoryReturnsForbiddenWheOutsideOfRoot() throws Exception {
    request.setParameter("path", "/");
    request.setParameter("name", "../newdirectory");
    request.setParameter("type", FileMetaData.BLOG_IMAGE);

    View view = action.process(request, response);

    // check a forbidden response is returned
    assertTrue(view instanceof ForbiddenView);
  }
View Full Code Here

  /**
   * Tests that the resulting view is of the correct type.
   */
  public void testViewFeeds() throws Exception {
    View view = action.process(request, response);
    assertTrue(view instanceof FourZeroThreeView);
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.pebble.web.view.View

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.