1 package org.kuali.student.enrollment.class2.acal.service.impl;
2
3 import org.kuali.student.enrollment.test.util.AttributeTester;
4 import edu.emory.mathcs.backport.java.util.Collections;
5 import java.util.ArrayList;
6 import static org.junit.Assert.*;
7
8 import java.util.Date;
9
10 import java.util.List;
11 import javax.annotation.Resource;
12 import org.junit.Before;
13 import org.junit.Test;
14 import org.junit.runner.RunWith;
15 import org.kuali.student.enrollment.acal.dto.AcademicCalendarInfo;
16 import org.kuali.student.enrollment.acal.dto.AcalEventInfo;
17 import org.kuali.student.enrollment.acal.dto.HolidayCalendarInfo;
18 import org.kuali.student.enrollment.acal.dto.HolidayInfo;
19 import org.kuali.student.enrollment.acal.dto.KeyDateInfo;
20 import org.kuali.student.enrollment.acal.dto.TermInfo;
21 import org.kuali.student.enrollment.acal.service.AcademicCalendarService;
22 import org.kuali.student.r2.common.class1.type.dto.TypeInfo;
23 import org.kuali.student.r2.common.dto.ContextInfo;
24 import org.kuali.student.r2.common.dto.StatusInfo;
25 import org.kuali.student.r2.common.exceptions.DoesNotExistException;
26 import org.kuali.student.r2.common.util.RichTextHelper;
27 import org.kuali.student.r2.core.constants.AtpServiceConstants;
28 import org.kuali.student.r2.core.class1.atp.service.impl.DateUtil;
29 import org.springframework.test.context.ContextConfiguration;
30 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
31
32 @RunWith(SpringJUnit4ClassRunner.class)
33 @ContextConfiguration(locations = {"classpath:acal-test-with-mocks-context.xml"})
34 public class TestAcademicCalendarServiceImplWithMocks {
35
36 @Resource(name = "acalService")
37 private AcademicCalendarService acalService;
38
39
40 public static String principalId = "123";
41 public ContextInfo callContext = null;
42
43 @Before
44 public void setUp() {
45 principalId = "123";
46 callContext = new ContextInfo();
47 callContext.setPrincipalId(principalId);
48
49
50
51
52
53 }
54
55
56
57
58
59
60
61 @Test
62 public void testCRUD() throws Exception {
63 this.testCRUDHolidayCalendar();
64 this.testCRUDAcademicCalendar();
65 this.testCRUDTerm();
66 }
67
68 private void testCRUDHolidayCalendar() throws Exception {
69
70 HolidayCalendarInfo orig = new HolidayCalendarInfo();
71 orig.setName("testHcal1 name");
72 orig.setDescr(new RichTextHelper().toRichTextInfo("description plain 1", "description formatted 1"));
73 orig.setTypeKey(AtpServiceConstants.ATP_HOLIDAY_CALENDAR_TYPE_KEY);
74 orig.setStateKey(AtpServiceConstants.ATP_DRAFT_STATE_KEY);
75 orig.setStartDate(new Date());
76 orig.setEndDate(new Date(new Date().getTime() + 100000));
77 orig.setAdminOrgId("testOrgId1");
78 orig.getCampusKeys().add("NorthCampus");
79 orig.getCampusKeys().add("SouthCampus");
80 orig.getAttributes().add(new AttributeTester().toAttribute("key1", "value1"));
81 orig.getAttributes().add(new AttributeTester().toAttribute("key2", "value2"));
82 HolidayCalendarInfo info = acalService.createHolidayCalendar(orig.getTypeKey(), orig, callContext);
83 assertNotNull(info);
84 assertNotNull(info.getId());
85 assertEquals(orig.getName(), info.getName());
86 assertNotNull(info.getDescr());
87 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
88 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
89 assertEquals(orig.getTypeKey(), info.getTypeKey());
90 assertEquals(orig.getStateKey(), info.getStateKey());
91 assertEquals(orig.getStartDate(), info.getStartDate());
92 assertEquals(orig.getEndDate(), info.getEndDate());
93 assertEquals(orig.getAdminOrgId(), info.getAdminOrgId());
94 compareStringList(orig.getCampusKeys(), info.getCampusKeys());
95 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
96 assertNotNull(info.getMeta());
97 assertNotNull(info.getMeta().getCreateId());
98 assertNotNull(info.getMeta().getCreateTime());
99
100
101 orig = info;
102 info = this.acalService.getHolidayCalendar(orig.getId(), callContext);
103 assertNotNull(info);
104 assertEquals(orig.getId(), info.getId());
105 assertEquals(orig.getName(), info.getName());
106 assertNotNull(info.getDescr());
107 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
108 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
109 assertEquals(orig.getTypeKey(), info.getTypeKey());
110 assertEquals(orig.getStateKey(), info.getStateKey());
111 assertEquals(orig.getStartDate(), info.getStartDate());
112 assertEquals(orig.getEndDate(), info.getEndDate());
113 assertEquals(orig.getAdminOrgId(), info.getAdminOrgId());
114 compareStringList(orig.getCampusKeys(), info.getCampusKeys());
115 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
116 assertNotNull(info.getMeta());
117 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
118 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
119
120
121 orig = info;
122 orig.setName("testHcal1 name updated");
123 orig.setDescr(new RichTextHelper().toRichTextInfo("description plain 1 updated", "description formatted 1 updated"));
124 orig.setStateKey(AtpServiceConstants.ATP_OFFICIAL_STATE_KEY);
125 orig.setStartDate(new Date(orig.getStartDate().getTime() - 10000));
126 orig.setEndDate(new Date(orig.getEndDate().getTime() + 10000));
127 orig.setAdminOrgId("testOrgId1Updated");
128 orig.getCampusKeys().remove(0);
129 orig.getCampusKeys().add("WestCampus");
130 new AttributeTester().findAttributes(orig.getAttributes(), "key1").get(0).setValue("value1Updated");
131 info = this.acalService.updateHolidayCalendar(orig.getId(), orig, callContext);
132 assertNotNull(info);
133 assertEquals(orig.getId(), info.getId());
134 assertEquals(orig.getName(), info.getName());
135 assertNotNull(info.getDescr());
136 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
137 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
138 assertEquals(orig.getTypeKey(), info.getTypeKey());
139 assertEquals(orig.getStateKey(), info.getStateKey());
140 assertEquals(orig.getStartDate(), info.getStartDate());
141 assertEquals(orig.getEndDate(), info.getEndDate());
142 assertEquals(orig.getAdminOrgId(), info.getAdminOrgId());
143 compareStringList(orig.getCampusKeys(), info.getCampusKeys());
144 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
145 assertNotNull(info.getMeta());
146 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
147 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
148 assertNotNull(info.getMeta().getUpdateId());
149 assertNotNull(info.getMeta().getUpdateTime());
150
151
152 orig = info;
153 info = this.acalService.getHolidayCalendar(orig.getId(), callContext);
154 assertNotNull(info);
155 assertEquals(orig.getId(), info.getId());
156 assertEquals(orig.getName(), info.getName());
157 assertNotNull(info.getDescr());
158 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
159 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
160 assertEquals(orig.getTypeKey(), info.getTypeKey());
161 assertEquals(orig.getStateKey(), info.getStateKey());
162 assertEquals(orig.getStartDate(), info.getStartDate());
163 assertEquals(orig.getEndDate(), info.getEndDate());
164 assertEquals(orig.getAdminOrgId(), info.getAdminOrgId());
165 this.compareStringList(orig.getCampusKeys(), info.getCampusKeys());
166 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
167 assertNotNull(info.getMeta());
168 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
169 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
170 assertEquals(orig.getMeta().getUpdateId(), info.getMeta().getUpdateId());
171 assertEquals(orig.getMeta().getUpdateTime(), info.getMeta().getUpdateTime());
172
173 this.testCRUDHoliday(orig.getId());
174
175
176 orig = info;
177 StatusInfo status = this.acalService.deleteHolidayCalendar(orig.getId(), callContext);
178 assertEquals(Boolean.TRUE, status.getIsSuccess());
179
180
181 try {
182 info = this.acalService.getHolidayCalendar(orig.getId(), callContext);
183 fail("should have thrown does not exist exception");
184 } catch (DoesNotExistException ex) {
185
186 }
187 }
188
189 private void testCRUDHoliday(String holidayCalendarId) throws Exception {
190
191 HolidayInfo orig = new HolidayInfo();
192 orig.setName("testHcal1 name");
193 orig.setDescr(new RichTextHelper().toRichTextInfo("description plain 1", "description formatted 1"));
194 orig.setTypeKey(AtpServiceConstants.MILESTONE_INDEPENDENCE_DAY_OBSERVED_TYPE_KEY);
195 orig.setStateKey(AtpServiceConstants.ATP_DRAFT_STATE_KEY);
196 orig.setStartDate(new Date());
197 orig.setEndDate(new Date(new Date().getTime() + 100000));
198 orig.setIsAllDay(Boolean.TRUE);
199 orig.setIsDateRange(Boolean.TRUE);
200 orig.setIsInstructionalDay(Boolean.TRUE);
201 orig.getAttributes().add(new AttributeTester().toAttribute("key1", "value1"));
202 orig.getAttributes().add(new AttributeTester().toAttribute("key2", "value2"));
203 HolidayInfo info = acalService.createHoliday(holidayCalendarId, orig.getTypeKey(), orig, callContext);
204 assertNotNull(info);
205 assertNotNull(info.getId());
206 assertEquals(orig.getName(), info.getName());
207 assertNotNull(info.getDescr());
208 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
209 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
210 assertEquals(orig.getTypeKey(), info.getTypeKey());
211 assertEquals(orig.getStateKey(), info.getStateKey());
212 assertEquals(DateUtil.startOfDay(orig.getStartDate()), info.getStartDate());
213 assertEquals(DateUtil.endOfDay(orig.getEndDate()), info.getEndDate());
214 assertEquals(orig.getIsAllDay(), info.getIsAllDay());
215 assertEquals(orig.getIsDateRange(), info.getIsDateRange());
216 assertEquals(orig.getIsInstructionalDay(), info.getIsInstructionalDay());
217 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
218 assertNotNull(info.getMeta());
219 assertNotNull(info.getMeta().getCreateId());
220 assertNotNull(info.getMeta().getCreateTime());
221
222
223 orig = info;
224 info = this.acalService.getHoliday(orig.getId(), callContext);
225 assertNotNull(info);
226 assertEquals(orig.getId(), info.getId());
227 assertEquals(orig.getName(), info.getName());
228 assertNotNull(info.getDescr());
229 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
230 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
231 assertEquals(orig.getTypeKey(), info.getTypeKey());
232 assertEquals(orig.getStateKey(), info.getStateKey());
233 assertEquals(orig.getStartDate(), info.getStartDate());
234 assertEquals(orig.getEndDate(), info.getEndDate());
235 assertEquals(orig.getIsAllDay(), info.getIsAllDay());
236 assertEquals(orig.getIsDateRange(), info.getIsDateRange());
237 assertEquals(orig.getIsInstructionalDay(), info.getIsInstructionalDay());
238 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
239 assertNotNull(info.getMeta());
240 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
241 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
242
243
244 orig = info;
245 orig.setName("testHcal1 name updated");
246 orig.setDescr(new RichTextHelper().toRichTextInfo("description plain 1 updated", "description formatted 1 updated"));
247 orig.setStateKey(AtpServiceConstants.ATP_OFFICIAL_STATE_KEY);
248 orig.setStartDate(new Date(orig.getStartDate().getTime() - 10000));
249 orig.setEndDate(new Date(orig.getEndDate().getTime() + 10000));
250 orig.setIsAllDay(Boolean.FALSE);
251 orig.setIsDateRange(Boolean.FALSE);
252 orig.setIsInstructionalDay(Boolean.FALSE);
253 new AttributeTester().findAttributes(orig.getAttributes(), "key1").get(0).setValue("value1Updated");
254 info = this.acalService.updateHoliday(orig.getId(), orig, callContext);
255 assertNotNull(info);
256 assertEquals(orig.getId(), info.getId());
257 assertEquals(orig.getName(), info.getName());
258 assertNotNull(info.getDescr());
259 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
260 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
261 assertEquals(orig.getTypeKey(), info.getTypeKey());
262 assertEquals(orig.getStateKey(), info.getStateKey());
263 assertEquals(orig.getStartDate(), info.getStartDate());
264 assertEquals(null, info.getEndDate());
265 assertEquals(orig.getIsAllDay(), info.getIsAllDay());
266 assertEquals(orig.getIsDateRange(), info.getIsDateRange());
267 assertEquals(orig.getIsInstructionalDay(), info.getIsInstructionalDay());
268 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
269 assertNotNull(info.getMeta());
270 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
271 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
272 assertNotNull(info.getMeta().getUpdateId());
273 assertNotNull(info.getMeta().getUpdateTime());
274
275
276 orig = info;
277 info = this.acalService.getHoliday(orig.getId(), callContext);
278 assertNotNull(info);
279 assertEquals(orig.getId(), info.getId());
280 assertEquals(orig.getName(), info.getName());
281 assertNotNull(info.getDescr());
282 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
283 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
284 assertEquals(orig.getTypeKey(), info.getTypeKey());
285 assertEquals(orig.getStateKey(), info.getStateKey());
286 assertEquals(orig.getStartDate(), info.getStartDate());
287 assertEquals(orig.getEndDate(), info.getEndDate());
288 assertEquals(orig.getIsAllDay(), info.getIsAllDay());
289 assertEquals(orig.getIsDateRange(), info.getIsDateRange());
290 assertEquals(orig.getIsInstructionalDay(), info.getIsInstructionalDay());
291 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
292 assertNotNull(info.getMeta());
293 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
294 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
295 assertEquals(orig.getMeta().getUpdateId(), info.getMeta().getUpdateId());
296 assertEquals(orig.getMeta().getUpdateTime(), info.getMeta().getUpdateTime());
297
298
299 orig = info;
300 StatusInfo status = this.acalService.deleteHoliday(orig.getId(), callContext);
301 assertEquals(Boolean.TRUE, status.getIsSuccess());
302
303
304 try {
305 info = this.acalService.getHoliday(orig.getId(), callContext);
306 fail("should have thrown does not exist exception");
307 } catch (DoesNotExistException ex) {
308
309 }
310 }
311
312 private void compareStringList(List<String> list1, List<String> list2) {
313 assertEquals(list1.size(), list2.size());
314 List lst1 = new ArrayList(list1);
315 Collections.sort(lst1);
316 List lst2 = new ArrayList(list2);
317 Collections.sort(lst2);
318 for (int i = 0; i < lst1.size(); i++) {
319 assertEquals(i + "", lst1.get(i), lst2.get(i));
320 }
321 }
322
323 private void testCRUDAcademicCalendar() throws Exception {
324 HolidayCalendarInfo hcal = new HolidayCalendarInfo();
325 hcal.setName("hcal1");
326 hcal.setDescr(new RichTextHelper().toRichTextInfo("description plain 1", "description formatted 1"));
327 hcal.setTypeKey(AtpServiceConstants.ATP_HOLIDAY_CALENDAR_TYPE_KEY);
328 hcal.setStateKey(AtpServiceConstants.ATP_DRAFT_STATE_KEY);
329 hcal.setStartDate(new Date());
330 hcal.setEndDate(new Date(new Date().getTime() + 100000));
331 hcal.setAdminOrgId("testOrgId1");
332 HolidayCalendarInfo hcal1 = acalService.createHolidayCalendar(hcal.getTypeKey(), hcal, callContext);
333
334 hcal = new HolidayCalendarInfo();
335 hcal.setName("hcal2");
336 hcal.setDescr(new RichTextHelper().toRichTextInfo("description plain 1", "description formatted 1"));
337 hcal.setTypeKey(AtpServiceConstants.ATP_HOLIDAY_CALENDAR_TYPE_KEY);
338 hcal.setStateKey(AtpServiceConstants.ATP_DRAFT_STATE_KEY);
339 hcal.setStartDate(new Date());
340 hcal.setEndDate(new Date(new Date().getTime() + 100000));
341 hcal.setAdminOrgId("testOrgId1");
342 HolidayCalendarInfo hcal2 = acalService.createHolidayCalendar(hcal.getTypeKey(), hcal, callContext);
343
344 hcal = new HolidayCalendarInfo();
345 hcal.setName("hcal3");
346 hcal.setDescr(new RichTextHelper().toRichTextInfo("description plain 1", "description formatted 1"));
347 hcal.setTypeKey(AtpServiceConstants.ATP_HOLIDAY_CALENDAR_TYPE_KEY);
348 hcal.setStateKey(AtpServiceConstants.ATP_DRAFT_STATE_KEY);
349 hcal.setStartDate(new Date());
350 hcal.setEndDate(new Date(new Date().getTime() + 100000));
351 hcal.setAdminOrgId("testOrgId1");
352 HolidayCalendarInfo hcal3 = acalService.createHolidayCalendar(hcal.getTypeKey(), hcal, callContext);
353
354 AcademicCalendarInfo orig = new AcademicCalendarInfo();
355 orig.setName("testAcal1 name");
356 orig.setDescr(new RichTextHelper().toRichTextInfo("description plain 1", "description formatted 1"));
357 orig.setTypeKey(AtpServiceConstants.ATP_ACADEMIC_CALENDAR_TYPE_KEY);
358 orig.setStateKey(AtpServiceConstants.ATP_DRAFT_STATE_KEY);
359 orig.setStartDate(new Date());
360 orig.setEndDate(new Date(new Date().getTime() + 100000));
361 orig.setAdminOrgId("testOrgId1");
362 orig.getHolidayCalendarIds().add(hcal1.getId());
363 orig.getHolidayCalendarIds().add(hcal2.getId());
364 orig.getAttributes().add(new AttributeTester().toAttribute("key1", "value1"));
365 orig.getAttributes().add(new AttributeTester().toAttribute("key2", "value2"));
366 AcademicCalendarInfo info = acalService.createAcademicCalendar(orig.getTypeKey(), orig, callContext);
367 assertNotNull(info);
368 assertNotNull(info.getId());
369 assertEquals(orig.getName(), info.getName());
370 assertNotNull(info.getDescr());
371 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
372 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
373 assertEquals(orig.getTypeKey(), info.getTypeKey());
374 assertEquals(orig.getStateKey(), info.getStateKey());
375 assertEquals(orig.getStartDate(), info.getStartDate());
376 assertEquals(orig.getEndDate(), info.getEndDate());
377 assertEquals(orig.getAdminOrgId(), info.getAdminOrgId());
378 compareStringList(orig.getHolidayCalendarIds(), info.getHolidayCalendarIds());
379 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
380 assertNotNull(info.getMeta());
381 assertNotNull(info.getMeta().getCreateId());
382 assertNotNull(info.getMeta().getCreateTime());
383
384
385 orig = info;
386 info = this.acalService.getAcademicCalendar(orig.getId(), callContext);
387 assertNotNull(info);
388 assertEquals(orig.getId(), info.getId());
389 assertEquals(orig.getName(), info.getName());
390 assertNotNull(info.getDescr());
391 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
392 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
393 assertEquals(orig.getTypeKey(), info.getTypeKey());
394 assertEquals(orig.getStateKey(), info.getStateKey());
395 assertEquals(orig.getStartDate(), info.getStartDate());
396 assertEquals(orig.getEndDate(), info.getEndDate());
397 assertEquals(orig.getAdminOrgId(), info.getAdminOrgId());
398 compareStringList(orig.getHolidayCalendarIds(), info.getHolidayCalendarIds());
399 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
400 assertNotNull(info.getMeta());
401 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
402 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
403
404
405 orig = info;
406 orig.setName("testAcal1 name updated");
407 orig.setDescr(new RichTextHelper().toRichTextInfo("description plain 1 updated", "description formatted 1 updated"));
408 orig.setStateKey(AtpServiceConstants.ATP_OFFICIAL_STATE_KEY);
409 orig.setStartDate(new Date(orig.getStartDate().getTime() - 10000));
410 orig.setEndDate(new Date(orig.getEndDate().getTime() + 10000));
411 orig.setAdminOrgId("testOrgId1Updated");
412 orig.getHolidayCalendarIds().remove(0);
413 orig.getHolidayCalendarIds().add(hcal3.getId());
414 new AttributeTester().findAttributes(orig.getAttributes(), "key1").get(0).setValue("value1Updated");
415 info = this.acalService.updateAcademicCalendar(orig.getId(), orig, callContext);
416 assertNotNull(info);
417 assertEquals(orig.getId(), info.getId());
418 assertEquals(orig.getName(), info.getName());
419 assertNotNull(info.getDescr());
420 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
421 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
422 assertEquals(orig.getTypeKey(), info.getTypeKey());
423 assertEquals(orig.getStateKey(), info.getStateKey());
424 assertEquals(orig.getStartDate(), info.getStartDate());
425 assertEquals(orig.getEndDate(), info.getEndDate());
426 assertEquals(orig.getAdminOrgId(), info.getAdminOrgId());
427 compareStringList(orig.getHolidayCalendarIds(), info.getHolidayCalendarIds());
428 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
429 assertNotNull(info.getMeta());
430 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
431 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
432 assertNotNull(info.getMeta().getUpdateId());
433 assertNotNull(info.getMeta().getUpdateTime());
434
435
436 orig = info;
437 info = this.acalService.getAcademicCalendar(orig.getId(), callContext);
438 assertNotNull(info);
439 assertEquals(orig.getId(), info.getId());
440 assertEquals(orig.getName(), info.getName());
441 assertNotNull(info.getDescr());
442 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
443 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
444 assertEquals(orig.getTypeKey(), info.getTypeKey());
445 assertEquals(orig.getStateKey(), info.getStateKey());
446 assertEquals(orig.getStartDate(), info.getStartDate());
447 assertEquals(orig.getEndDate(), info.getEndDate());
448 assertEquals(orig.getAdminOrgId(), info.getAdminOrgId());
449 compareStringList(orig.getHolidayCalendarIds(), info.getHolidayCalendarIds());
450 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
451 assertNotNull(info.getMeta());
452 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
453 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
454 assertEquals(orig.getMeta().getUpdateId(), info.getMeta().getUpdateId());
455 assertEquals(orig.getMeta().getUpdateTime(), info.getMeta().getUpdateTime());
456
457 this.testCRUDAcalEvent(info.getId());
458
459
460 orig = info;
461 StatusInfo status = this.acalService.deleteAcademicCalendar(orig.getId(), callContext);
462 assertEquals(Boolean.TRUE, status.getIsSuccess());
463
464
465 try {
466 info = this.acalService.getAcademicCalendar(orig.getId(), callContext);
467 fail("should have thrown does not exist exception");
468 } catch (DoesNotExistException ex) {
469
470 }
471
472 this.acalService.deleteHolidayCalendar(hcal1.getId(), callContext);
473 this.acalService.deleteHolidayCalendar(hcal2.getId(), callContext);
474 this.acalService.deleteHolidayCalendar(hcal3.getId(), callContext);
475 }
476
477 private void testCRUDAcalEvent(String academicCalendarId) throws Exception {
478
479 AcalEventInfo orig = new AcalEventInfo();
480 orig.setName("test name");
481 orig.setDescr(new RichTextHelper().toRichTextInfo("description plain 1", "description formatted 1"));
482 orig.setTypeKey(AtpServiceConstants.MILESTONE_HOMECOMING_TYPE_KEY);
483 orig.setStateKey(AtpServiceConstants.ATP_DRAFT_STATE_KEY);
484 orig.setStartDate(new Date());
485 orig.setEndDate(new Date(new Date().getTime() + 100000));
486 orig.setIsAllDay(Boolean.TRUE);
487 orig.setIsDateRange(Boolean.TRUE);
488 orig.getAttributes().add(new AttributeTester().toAttribute("key1", "value1"));
489 orig.getAttributes().add(new AttributeTester().toAttribute("key2", "value2"));
490 AcalEventInfo info = acalService.createAcalEvent(academicCalendarId, orig.getTypeKey(), orig, callContext);
491 assertNotNull(info);
492 assertNotNull(info.getId());
493 assertEquals(orig.getName(), info.getName());
494 assertNotNull(info.getDescr());
495 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
496 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
497 assertEquals(orig.getTypeKey(), info.getTypeKey());
498 assertEquals(orig.getStateKey(), info.getStateKey());
499 assertEquals(DateUtil.startOfDay(orig.getStartDate()), info.getStartDate());
500 assertEquals(DateUtil.endOfDay(orig.getEndDate()), info.getEndDate());
501 assertEquals(orig.getIsAllDay(), info.getIsAllDay());
502 assertEquals(orig.getIsDateRange(), info.getIsDateRange());
503 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
504 assertNotNull(info.getMeta());
505 assertNotNull(info.getMeta().getCreateId());
506 assertNotNull(info.getMeta().getCreateTime());
507
508
509 orig = info;
510 info = this.acalService.getAcalEvent(orig.getId(), callContext);
511 assertNotNull(info);
512 assertEquals(orig.getId(), info.getId());
513 assertEquals(orig.getName(), info.getName());
514 assertNotNull(info.getDescr());
515 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
516 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
517 assertEquals(orig.getTypeKey(), info.getTypeKey());
518 assertEquals(orig.getStateKey(), info.getStateKey());
519 assertEquals(orig.getStartDate(), info.getStartDate());
520 assertEquals(orig.getEndDate(), info.getEndDate());
521 assertEquals(orig.getIsAllDay(), info.getIsAllDay());
522 assertEquals(orig.getIsDateRange(), info.getIsDateRange());
523 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
524 assertNotNull(info.getMeta());
525 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
526 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
527
528
529 orig = info;
530 orig.setName("testHcal1 name updated");
531 orig.setDescr(new RichTextHelper().toRichTextInfo("description plain 1 updated", "description formatted 1 updated"));
532 orig.setStateKey(AtpServiceConstants.ATP_OFFICIAL_STATE_KEY);
533 orig.setStartDate(new Date(orig.getStartDate().getTime() - 10000));
534 orig.setEndDate(new Date(orig.getEndDate().getTime() + 10000));
535 orig.setIsAllDay(Boolean.FALSE);
536 orig.setIsDateRange(Boolean.FALSE);
537 new AttributeTester().findAttributes(orig.getAttributes(), "key1").get(0).setValue("value1Updated");
538 info = this.acalService.updateAcalEvent(orig.getId(), orig, callContext);
539 assertNotNull(info);
540 assertEquals(orig.getId(), info.getId());
541 assertEquals(orig.getName(), info.getName());
542 assertNotNull(info.getDescr());
543 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
544 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
545 assertEquals(orig.getTypeKey(), info.getTypeKey());
546 assertEquals(orig.getStateKey(), info.getStateKey());
547 assertEquals(orig.getStartDate(), info.getStartDate());
548 assertEquals(null, info.getEndDate());
549 assertEquals(orig.getIsAllDay(), info.getIsAllDay());
550 assertEquals(orig.getIsDateRange(), info.getIsDateRange());
551 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
552 assertNotNull(info.getMeta());
553 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
554 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
555 assertNotNull(info.getMeta().getUpdateId());
556 assertNotNull(info.getMeta().getUpdateTime());
557
558
559 orig = info;
560 info = this.acalService.getAcalEvent(orig.getId(), callContext);
561 assertNotNull(info);
562 assertEquals(orig.getId(), info.getId());
563 assertEquals(orig.getName(), info.getName());
564 assertNotNull(info.getDescr());
565 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
566 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
567 assertEquals(orig.getTypeKey(), info.getTypeKey());
568 assertEquals(orig.getStateKey(), info.getStateKey());
569 assertEquals(orig.getStartDate(), info.getStartDate());
570 assertEquals(orig.getEndDate(), info.getEndDate());
571 assertEquals(orig.getIsAllDay(), info.getIsAllDay());
572 assertEquals(orig.getIsDateRange(), info.getIsDateRange());
573 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
574 assertNotNull(info.getMeta());
575 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
576 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
577 assertEquals(orig.getMeta().getUpdateId(), info.getMeta().getUpdateId());
578 assertEquals(orig.getMeta().getUpdateTime(), info.getMeta().getUpdateTime());
579
580
581 orig = info;
582 StatusInfo status = this.acalService.deleteAcalEvent(orig.getId(), callContext);
583 assertEquals(Boolean.TRUE, status.getIsSuccess());
584
585
586 try {
587 info = this.acalService.getAcalEvent(orig.getId(), callContext);
588 fail("should have thrown does not exist exception");
589 } catch (DoesNotExistException ex) {
590
591 }
592 }
593
594 private void testCRUDTerm() throws Exception {
595
596 AcademicCalendarInfo acalInfo = new AcademicCalendarInfo();
597 acalInfo.setName("testAcal1 name");
598 acalInfo.setDescr(new RichTextHelper().toRichTextInfo("description plain 1", "description formatted 1"));
599 acalInfo.setTypeKey(AtpServiceConstants.ATP_ACADEMIC_CALENDAR_TYPE_KEY);
600 acalInfo.setStateKey(AtpServiceConstants.ATP_DRAFT_STATE_KEY);
601 acalInfo.setStartDate(new Date());
602 acalInfo.setEndDate(new Date(new Date().getTime() + 100000));
603 acalInfo.setAdminOrgId("testOrgId1");
604 acalInfo = acalService.createAcademicCalendar(acalInfo.getTypeKey(), acalInfo, callContext);
605
606 List<TypeInfo> termTypes = acalService.getTermTypes(callContext);
607 System.out.println(termTypes.size() + " term types found");
608 for (TypeInfo type : termTypes) {
609 System.out.println(type.getKey() + "\t" + type.getName());
610 }
611 if (termTypes.size() < 3) {
612 fail("too few term types");
613 }
614
615 TermInfo orig = new TermInfo();
616 orig.setName("testTerm1 name");
617 orig.setDescr(new RichTextHelper().toRichTextInfo("description plain 1", "description formatted 1"));
618 orig.setTypeKey(AtpServiceConstants.ATP_FALL_TYPE_KEY);
619 orig.setStateKey(AtpServiceConstants.ATP_DRAFT_STATE_KEY);
620 orig.setStartDate(new Date());
621 orig.setEndDate(new Date(new Date().getTime() + 100000));
622 orig.getAttributes().add(new AttributeTester().toAttribute("key1", "value1"));
623 orig.getAttributes().add(new AttributeTester().toAttribute("key2", "value2"));
624 TermInfo info = acalService.createTerm(orig.getTypeKey(), orig, callContext);
625 assertNotNull(info);
626 assertNotNull(info.getId());
627 assertEquals(orig.getName(), info.getName());
628 assertNotNull(info.getDescr());
629 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
630 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
631 assertEquals(orig.getTypeKey(), info.getTypeKey());
632 assertEquals(orig.getStateKey(), info.getStateKey());
633 assertEquals(orig.getStartDate(), info.getStartDate());
634 assertEquals(orig.getEndDate(), info.getEndDate());
635 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
636 assertNotNull(info.getMeta());
637 assertNotNull(info.getMeta().getCreateId());
638 assertNotNull(info.getMeta().getCreateTime());
639
640
641 orig = info;
642 orig.setName("testAcal1 name updated");
643 orig.setDescr(new RichTextHelper().toRichTextInfo("description plain 1 updated", "description formatted 1 updated"));
644 orig.setStateKey(AtpServiceConstants.ATP_OFFICIAL_STATE_KEY);
645 orig.setStartDate(new Date(orig.getStartDate().getTime() - 10000));
646 orig.setEndDate(new Date(orig.getEndDate().getTime() + 10000));
647 new AttributeTester().findAttributes(orig.getAttributes(), "key1").get(0).setValue("value1Updated");
648 info = this.acalService.updateTerm(orig.getId(), orig, callContext);
649 assertNotNull(info);
650 assertEquals(orig.getId(), info.getId());
651 assertEquals(orig.getName(), info.getName());
652 assertNotNull(info.getDescr());
653 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
654 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
655 assertEquals(orig.getTypeKey(), info.getTypeKey());
656 assertEquals(orig.getStateKey(), info.getStateKey());
657 assertEquals(orig.getStartDate(), info.getStartDate());
658 assertEquals(orig.getEndDate(), info.getEndDate());
659 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
660 assertNotNull(info.getMeta());
661 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
662 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
663 assertNotNull(info.getMeta().getUpdateId());
664 assertNotNull(info.getMeta().getUpdateTime());
665
666
667 orig = info;
668 info = this.acalService.getTerm(orig.getId(), callContext);
669 assertNotNull(info);
670 assertEquals(orig.getId(), info.getId());
671 assertEquals(orig.getName(), info.getName());
672 assertNotNull(info.getDescr());
673 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
674 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
675 assertEquals(orig.getTypeKey(), info.getTypeKey());
676 assertEquals(orig.getStateKey(), info.getStateKey());
677 assertEquals(orig.getStartDate(), info.getStartDate());
678 assertEquals(orig.getEndDate(), info.getEndDate());
679 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
680 assertNotNull(info.getMeta());
681 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
682 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
683 assertEquals(orig.getMeta().getUpdateId(), info.getMeta().getUpdateId());
684 assertEquals(orig.getMeta().getUpdateTime(), info.getMeta().getUpdateTime());
685
686 this.testCRUDKeyDate(orig.getId());
687
688
689 orig = info;
690 StatusInfo status = this.acalService.addTermToAcademicCalendar(acalInfo.getId(), info.getId(), callContext);
691 assertEquals(Boolean.TRUE, status.getIsSuccess());
692
693
694 List<TermInfo> terms = this.acalService.getTermsForAcademicCalendar(acalInfo.getId(), callContext);
695 assertEquals(1, terms.size());
696 info = terms.get(0);
697 assertEquals(orig.getId(), info.getId());
698 assertEquals(orig.getName(), info.getName());
699 assertNotNull(info.getDescr());
700 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
701 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
702 assertEquals(orig.getTypeKey(), info.getTypeKey());
703 assertEquals(orig.getStateKey(), info.getStateKey());
704 assertEquals(orig.getStartDate(), info.getStartDate());
705 assertEquals(orig.getEndDate(), info.getEndDate());
706 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
707 assertNotNull(info.getMeta());
708 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
709 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
710 assertEquals(orig.getMeta().getUpdateId(), info.getMeta().getUpdateId());
711 assertEquals(orig.getMeta().getUpdateTime(), info.getMeta().getUpdateTime());
712
713
714 status = this.acalService.removeTermFromAcademicCalendar(acalInfo.getId(), info.getId(), callContext);
715 assertEquals(Boolean.TRUE, status.getIsSuccess());
716 terms = this.acalService.getTermsForAcademicCalendar(acalInfo.getId(), callContext);
717 assertEquals(0, terms.size());
718
719
720 TermInfo subTerm = new TermInfo();
721 subTerm.setName("subterm name");
722 subTerm.setDescr(new RichTextHelper().toRichTextInfo("description plain 1", "description formatted 1"));
723 subTerm.setTypeKey(AtpServiceConstants.ATP_HALF_FALL_1_TYPE_KEY);
724 subTerm.setStateKey(AtpServiceConstants.ATP_DRAFT_STATE_KEY);
725 subTerm.setStartDate(new Date());
726 subTerm.setEndDate(new Date(new Date().getTime() + 100000));
727 subTerm.getAttributes().add(new AttributeTester().toAttribute("key1", "value1"));
728 subTerm.getAttributes().add(new AttributeTester().toAttribute("key2", "value2"));
729 subTerm = acalService.createTerm(orig.getTypeKey(), orig, callContext);
730
731 orig = info;
732 status = this.acalService.addTermToTerm(info.getId(), subTerm.getId(), callContext);
733 assertEquals(Boolean.TRUE, status.getIsSuccess());
734
735
736 terms = this.acalService.getIncludedTermsInTerm(info.getId(), callContext);
737 assertEquals(1, terms.size());
738 info = terms.get(0);
739 assertEquals(subTerm.getId(), info.getId());
740
741
742 terms = this.acalService.getContainingTerms(subTerm.getId(), callContext);
743 assertEquals(1, terms.size());
744 info = terms.get(0);
745 assertEquals(orig.getId(), info.getId());
746
747
748 status = this.acalService.removeTermFromTerm(info.getId(), subTerm.getId(), callContext);
749 assertEquals(Boolean.TRUE, status.getIsSuccess());
750 terms = this.acalService.getIncludedTermsInTerm(info.getId(), callContext);
751 assertEquals(0, terms.size());
752 terms = this.acalService.getContainingTerms(subTerm.getId(), callContext);
753 assertEquals(0, terms.size());
754
755
756 orig = info;
757 status = this.acalService.deleteTerm(orig.getId(), callContext);
758 assertEquals(Boolean.TRUE, status.getIsSuccess());
759
760
761 try {
762 info = this.acalService.getTerm(orig.getId(), callContext);
763 fail("should have thrown does not exist exception");
764 } catch (DoesNotExistException ex) {
765
766 }
767 }
768
769 private void testCRUDKeyDate(String termId) throws Exception {
770
771 KeyDateInfo orig = new KeyDateInfo();
772 orig.setName("test name");
773 orig.setDescr(new RichTextHelper().toRichTextInfo("description plain 1", "description formatted 1"));
774 orig.setTypeKey(AtpServiceConstants.MILESTONE_GRADES_DUE_TYPE_KEY);
775 orig.setStateKey(AtpServiceConstants.ATP_DRAFT_STATE_KEY);
776 orig.setStartDate(new Date());
777 orig.setEndDate(new Date(new Date().getTime() + 100000));
778 orig.setIsAllDay(Boolean.TRUE);
779 orig.setIsDateRange(Boolean.TRUE);
780 orig.getAttributes().add(new AttributeTester().toAttribute("key1", "value1"));
781 orig.getAttributes().add(new AttributeTester().toAttribute("key2", "value2"));
782 KeyDateInfo info = acalService.createKeyDate(termId, orig.getTypeKey(), orig, callContext);
783 assertNotNull(info);
784 assertNotNull(info.getId());
785 assertEquals(orig.getName(), info.getName());
786 assertNotNull(info.getDescr());
787 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
788 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
789 assertEquals(orig.getTypeKey(), info.getTypeKey());
790 assertEquals(orig.getStateKey(), info.getStateKey());
791 assertEquals(DateUtil.startOfDay(orig.getStartDate()), info.getStartDate());
792 assertEquals(DateUtil.endOfDay(orig.getEndDate()), info.getEndDate());
793 assertEquals(orig.getIsAllDay(), info.getIsAllDay());
794 assertEquals(orig.getIsDateRange(), info.getIsDateRange());
795 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
796 assertNotNull(info.getMeta());
797 assertNotNull(info.getMeta().getCreateId());
798 assertNotNull(info.getMeta().getCreateTime());
799
800
801 orig = info;
802 info = this.acalService.getKeyDate(orig.getId(), callContext);
803 assertNotNull(info);
804 assertEquals(orig.getId(), info.getId());
805 assertEquals(orig.getName(), info.getName());
806 assertNotNull(info.getDescr());
807 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
808 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
809 assertEquals(orig.getTypeKey(), info.getTypeKey());
810 assertEquals(orig.getStateKey(), info.getStateKey());
811 assertEquals(orig.getStartDate(), info.getStartDate());
812 assertEquals(orig.getEndDate(), info.getEndDate());
813 assertEquals(orig.getIsAllDay(), info.getIsAllDay());
814 assertEquals(orig.getIsDateRange(), info.getIsDateRange());
815 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
816 assertNotNull(info.getMeta());
817 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
818 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
819
820
821 orig = info;
822 orig.setName("testHcal1 name updated");
823 orig.setDescr(new RichTextHelper().toRichTextInfo("description plain 1 updated", "description formatted 1 updated"));
824 orig.setStateKey(AtpServiceConstants.ATP_OFFICIAL_STATE_KEY);
825 orig.setStartDate(new Date(orig.getStartDate().getTime() - 10000));
826 orig.setEndDate(new Date(orig.getEndDate().getTime() + 10000));
827 orig.setIsAllDay(Boolean.FALSE);
828 orig.setIsDateRange(Boolean.FALSE);
829 new AttributeTester().findAttributes(orig.getAttributes(), "key1").get(0).setValue("value1Updated");
830 info = this.acalService.updateKeyDate(orig.getId(), orig, callContext);
831 assertNotNull(info);
832 assertEquals(orig.getId(), info.getId());
833 assertEquals(orig.getName(), info.getName());
834 assertNotNull(info.getDescr());
835 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
836 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
837 assertEquals(orig.getTypeKey(), info.getTypeKey());
838 assertEquals(orig.getStateKey(), info.getStateKey());
839 assertEquals(orig.getStartDate(), info.getStartDate());
840 assertEquals(null, info.getEndDate());
841 assertEquals(orig.getIsAllDay(), info.getIsAllDay());
842 assertEquals(orig.getIsDateRange(), info.getIsDateRange());
843 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
844 assertNotNull(info.getMeta());
845 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
846 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
847 assertNotNull(info.getMeta().getUpdateId());
848 assertNotNull(info.getMeta().getUpdateTime());
849
850
851 orig = info;
852 info = this.acalService.getKeyDate(orig.getId(), callContext);
853 assertNotNull(info);
854 assertEquals(orig.getId(), info.getId());
855 assertEquals(orig.getName(), info.getName());
856 assertNotNull(info.getDescr());
857 assertEquals(orig.getDescr().getPlain(), info.getDescr().getPlain());
858 assertEquals(orig.getDescr().getFormatted(), info.getDescr().getFormatted());
859 assertEquals(orig.getTypeKey(), info.getTypeKey());
860 assertEquals(orig.getStateKey(), info.getStateKey());
861 assertEquals(orig.getStartDate(), info.getStartDate());
862 assertEquals(orig.getEndDate(), info.getEndDate());
863 assertEquals(orig.getIsAllDay(), info.getIsAllDay());
864 assertEquals(orig.getIsDateRange(), info.getIsDateRange());
865 new AttributeTester().check(orig.getAttributes(), info.getAttributes());
866 assertNotNull(info.getMeta());
867 assertEquals(orig.getMeta().getCreateId(), info.getMeta().getCreateId());
868 assertEquals(orig.getMeta().getCreateTime(), info.getMeta().getCreateTime());
869 assertEquals(orig.getMeta().getUpdateId(), info.getMeta().getUpdateId());
870 assertEquals(orig.getMeta().getUpdateTime(), info.getMeta().getUpdateTime());
871
872
873 orig = info;
874 StatusInfo status = this.acalService.deleteKeyDate(orig.getId(), callContext);
875 assertEquals(Boolean.TRUE, status.getIsSuccess());
876
877
878 try {
879 info = this.acalService.getKeyDate(orig.getId(), callContext);
880 fail("should have thrown does not exist exception");
881 } catch (DoesNotExistException ex) {
882
883 }
884 }
885 }