Package net.sourceforge.pebble.web.view

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


    super.setUp();
  }

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

    assertTrue(view instanceof CategoriesView);
    assertEquals("/WEB-INF/jsp/manageCategories.jsp", ((CategoriesView)view).getUri());
  }
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 ErrorView);
  }
View Full Code Here

  /**
   * Tests what happens when the default home page is requested.
   * @throws Exception
   */
  public void testViewHomePage() throws Exception {
    View view = action.process(request, response);

    Model model = action.getModel();
    assertEquals(blog.getBlogForThisMonth(), model.get(Constants.MONTHLY_BLOG));
    assertEquals(blog.getRecentBlogEntries(), model.get(Constants.BLOG_ENTRIES));
    assertTrue(view instanceof BlogEntriesView);
View Full Code Here

    service.putBlogEntry(blogEntry);

    // now execute the action
    request.setParameter("entry", blogEntry.getId());
    request.setParameter("submit", "Publish");
    View view = action.process(request, response);

    assertTrue(blogEntry.isUnpublished());
    assertTrue(view instanceof PublishBlogEntryView);
  }
View Full Code Here

    service.putBlogEntry(blogEntry);

    // now execute the action
    request.setParameter("entry", blogEntry.getId());
    request.setParameter("submit", "Unpublish");
    View view = action.process(request, response);

    assertTrue(blogEntry.isPublished());
    assertTrue(view instanceof PublishBlogEntryView);
  }
View Full Code Here

    request.setParameter("name", "afile.txt");
    request.setParameter("type", FileMetaData.BLOG_FILE);
    request.setParameter("newName", "anewfile.txt");
    request.setParameter("submit", "copy");

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

    // check file now exists and the right view is returned
    assertTrue("File doesn't exist", destinationFile.exists());
    assertEquals(sourceFile.length(), destinationFile.length());
    assertTrue(view instanceof RedirectView);
View Full Code Here

    request.setParameter("name", "afile.txt");
    request.setParameter("type", FileMetaData.BLOG_FILE);
    request.setParameter("newName", "anewfile.txt");
    request.setParameter("submit", "rename");

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

    // check source doesn't exist, destination exists and
    // correct view is returned
    assertFalse("File still exists", sourceFile.exists());
    assertTrue("File doesn't exist", destinationFile.exists());
View Full Code Here

    request.setParameter("name", "../afile.txt");
    request.setParameter("type", FileMetaData.BLOG_FILE);
    request.setParameter("newName", "anewfile.txt");
    request.setParameter("submit", "copy");

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

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

    super.setUp();
  }

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

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