mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Tweak the calendar service test to track a couple more test nodes that always need to be deleted no matter what at the end
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30957 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -429,6 +429,7 @@ public class CalendarServiceImplTest
|
|||||||
entry.getTags().add(TAG_1);
|
entry.getTags().add(TAG_1);
|
||||||
entry.getTags().add(TAG_2);
|
entry.getTags().add(TAG_2);
|
||||||
entry = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), entry);
|
entry = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), entry);
|
||||||
|
testNodesToTidy.add(entry.getNodeRef());
|
||||||
|
|
||||||
// Check
|
// Check
|
||||||
entry = CALENDAR_SERVICE.getCalendarEntry(CALENDAR_SITE.getShortName(), entry.getSystemName());
|
entry = CALENDAR_SERVICE.getCalendarEntry(CALENDAR_SITE.getShortName(), entry.getSystemName());
|
||||||
@@ -468,12 +469,16 @@ public class CalendarServiceImplTest
|
|||||||
assertEquals(0, results.getPage().size());
|
assertEquals(0, results.getPage().size());
|
||||||
|
|
||||||
// Add a few
|
// Add a few
|
||||||
CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO(
|
CalendarEntry entryA = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO(
|
||||||
"TitleA", "Description", "Location", new Date(1302431400), new Date(1302435000)));
|
"TitleA", "Description", "Location", new Date(1302431400), new Date(1302435000)));
|
||||||
CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO(
|
CalendarEntry entryB = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO(
|
||||||
"TitleB", "Description", "Location", new Date(1302431400), new Date(1302442200)));
|
"TitleB", "Description", "Location", new Date(1302431400), new Date(1302442200)));
|
||||||
CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO(
|
CalendarEntry entryC = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO(
|
||||||
"TitleC", "Description", "Location", new Date(1302435000), new Date(1302442200)));
|
"TitleC", "Description", "Location", new Date(1302435000), new Date(1302442200)));
|
||||||
|
testNodesToTidy.add(entryA.getNodeRef());
|
||||||
|
testNodesToTidy.add(entryB.getNodeRef());
|
||||||
|
testNodesToTidy.add(entryC.getNodeRef());
|
||||||
|
|
||||||
|
|
||||||
// Check now
|
// Check now
|
||||||
results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging);
|
results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging);
|
||||||
@@ -483,8 +488,9 @@ public class CalendarServiceImplTest
|
|||||||
assertEquals("TitleC", results.getPage().get(2).getTitle());
|
assertEquals("TitleC", results.getPage().get(2).getTitle());
|
||||||
|
|
||||||
// Add one more, before those, and drop the page size
|
// Add one more, before those, and drop the page size
|
||||||
CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO(
|
CalendarEntry entryD = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO(
|
||||||
"TitleD", "Description", "Location", new Date(1302417000), new Date(1302420600)));
|
"TitleD", "Description", "Location", new Date(1302417000), new Date(1302420600)));
|
||||||
|
testNodesToTidy.add(entryD.getNodeRef());
|
||||||
|
|
||||||
paging = new PagingRequest(3);
|
paging = new PagingRequest(3);
|
||||||
results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging);
|
results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging);
|
||||||
@@ -497,15 +503,6 @@ public class CalendarServiceImplTest
|
|||||||
results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging);
|
results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging);
|
||||||
assertEquals(1, results.getPage().size());
|
assertEquals(1, results.getPage().size());
|
||||||
assertEquals("TitleC", results.getPage().get(0).getTitle());
|
assertEquals("TitleC", results.getPage().get(0).getTitle());
|
||||||
|
|
||||||
|
|
||||||
// Tidy
|
|
||||||
paging = new PagingRequest(10);
|
|
||||||
results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging);
|
|
||||||
for(CalendarEntry entry : results.getPage())
|
|
||||||
{
|
|
||||||
testNodesToTidy.add(entry.getNodeRef());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user