public void testIncludedCollection() throws Exception { testHelper.getHomeCollection().setExcludeFreeBusyRollup(false); DavHomeCollection home = testHelper.initializeHomeResource(); FreeBusyReport report = makeReport("testdata/freebusy1.xml", DEPTH_1, home); report.runQuery(); }
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()); } }
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()); } }