Package net.sourceforge.pebble.web.view

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


    fileManager.saveFile("/", "b.txt", "Some content");

    request.setParameter("path", "/");
    request.setParameter("type", FileMetaData.BLOG_FILE);

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

    // check file information available and the right view is returned
    assertEquals(FileMetaData.BLOG_FILE, action.getModel().get("type"));
    FileMetaData fileMetaData = (FileMetaData)action.getModel().get("directory");
    assertEquals("/", fileMetaData.getAbsolutePath());
View Full Code Here


   */
  public void testViewFilesReturnsForbiddenWhenOutsideOfRoot() throws Exception {
    request.setParameter("path", "../");
    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

   * @throws Exception
   */
  public void testViewMonth() throws Exception {
    request.setParameter("year", "2006");
    request.setParameter("month", "05");
    View view = action.process(request, response);

    Model model = action.getModel();
    assertEquals(blog.getBlogForMonth(2006, 5), model.get(Constants.MONTHLY_BLOG));
    assertNotNull(model.get(Constants.BLOG_ENTRIES));
    assertTrue(view instanceof BlogEntriesByMonthView);
View Full Code Here

    super.setUp();
  }

  public void testProcess() throws Exception {
    View view = action.process(request, response);

    BlogEntry blogEntry = (BlogEntry)action.getModel().get(Constants.BLOG_ENTRY_KEY);
    assertNotNull("No blog entry was created", blogEntry);
    assertFalse(blogEntry.isPersistent());
View Full Code Here

    super.setUp();
  }

  public void testBrowsingForbiddenByAnonymousUsers() {
    try {
      View view = action.process(request, response);
      assertTrue(view instanceof ForwardView);
      assertTrue(((ForwardView)view).getUri().startsWith("/viewFiles.secureaction"));
    } catch (ServletException e) {
      fail();
    }
View Full Code Here

  }

  public void testBrowsingForbiddenWhenRootRequestedByAnonymousUsers() {
    try {
      request.setParameter("name", "/");
      View view = action.process(request, response);
      assertTrue(view instanceof ForwardView);
      assertTrue(((ForwardView)view).getUri().startsWith("/viewFiles.secureaction"));
    } catch (ServletException e) {
      fail();
    }
View Full Code Here

  public void testAccessToParentDirectoriesIsDeniedToAnonymousUsers() {
    try {
      request.setParameter("name", "../");
      request.setParameter("type", FileMetaData.BLOG_FILE);
      View view = action.process(request, response);
      assertTrue(view instanceof ForwardView);
      assertTrue(((ForwardView)view).getUri().startsWith("/viewFiles.secureaction"));
    } catch (ServletException e) {
      fail();
    }
View Full Code Here

    super.setUp();
  }

  public void testProcess() throws Exception {
    View view = action.process(request, response);
    assertTrue(view instanceof BlogDetailsView);
  }
View Full Code Here

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

    super.setUp();
  }

  public void testViewBlogEntryWithNullId() throws Exception {
    View view = action.process(request, response);

    assertTrue(view instanceof NotFoundView);
  }
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.