Example #1
0
  public void testIncludedCollection() throws Exception {
    testHelper.getHomeCollection().setExcludeFreeBusyRollup(false);
    DavHomeCollection home = testHelper.initializeHomeResource();

    FreeBusyReport report = makeReport("testdata/freebusy1.xml", DEPTH_1, home);

    report.runQuery();
  }
Example #2
0
  public void testWrongType() throws Exception {
    DavCalendarCollection dcc = testHelper.initializeDavCalendarCollection("freebusy");

    FreeBusyReport report = new FreeBusyReport();
    try {
      report.init(dcc, makeReportInfo("multiget1.xml", DEPTH_1));
      fail("Non-freebusy report info initalized");
    } catch (Exception e) {
    }
  }
Example #3
0
  public void testExcludedCollection() throws Exception {
    testHelper.getHomeCollection().setExcludeFreeBusyRollup(true);
    DavHomeCollection home = testHelper.initializeHomeResource();

    FreeBusyReport report = makeReport("testdata/freebusy1.xml", DEPTH_1, home);

    try {
      report.runQuery();
      fail("free-busy report targeted at excluded collection should not have succeeded but did");
    } catch (DavException e) {
      assertEquals(
          "free-busy report targeted at excluded collection did not return 403",
          403,
          e.getErrorCode());
    }
  }
Example #4
0
  public void testExcludedParentCollection() throws Exception {
    testHelper.getHomeCollection().setExcludeFreeBusyRollup(true);
    CollectionItem coll = testHelper.makeAndStoreDummyCollection(testHelper.getHomeCollection());
    coll.setExcludeFreeBusyRollup(false);

    DavHomeCollection home = testHelper.initializeHomeResource();
    DavCollection dc = (DavCollection) testHelper.findMember(home, coll.getName());

    FreeBusyReport report = makeReport("testdata/freebusy1.xml", DEPTH_1, dc);

    try {
      report.runQuery();
      fail(
          "free-busy report targeted at collection with excluded parent should not have succeeded but did");
    } catch (DavException e) {
      assertEquals(
          "free-busy report targeted at collection with excluded parent did not return 403",
          403,
          e.getErrorCode());
    }
  }