Пример #1
0
  /**
   * TestCase for isBookmarkReportlet method
   *
   * <p>Check if reportlet is from bookmark.
   */
  public void testIsBookmarkReportlet() {
    // Don't set anything
    assertFalse(ParameterAccessor.isBookmarkReportlet(request));

    // Only set bookmark
    request.addParameter(ParameterAccessor.PARAM_BOOKMARK, "bookmark"); // $NON-NLS-1$
    assertFalse(ParameterAccessor.isBookmarkReportlet(request));

    // Set isReportlet
    request.addParameter(ParameterAccessor.PARAM_ISREPORTLET, "wrong"); // $NON-NLS-1$
    assertFalse(ParameterAccessor.isBookmarkReportlet(request));
    request.addParameter(ParameterAccessor.PARAM_ISREPORTLET, "true"); // $NON-NLS-1$
    assertTrue(ParameterAccessor.isBookmarkReportlet(request));

    request.removeParameter(ParameterAccessor.PARAM_BOOKMARK);
    request.removeParameter(ParameterAccessor.PARAM_ISREPORTLET);
  }