public void testUpdateTerm()
{
System.out.println("updateTerm");
assertTrue(instance.isOpen());
GradedEvent gradedEvent = instance.find(new Long(3L));
gradedEvent.setTerm("Fall 2010");
assertEquals(1, gradedEvent.getQuestions().size());
// Make sure the updated GradedEvent is returned from the method
GradedEvent result = instance.update(gradedEvent);
assertNotNull(result);
// Grab the updated GradedEvent from the Data source
GradedEvent requestQuery = instance.find(new Long(3L));
// Verify the data is maintained across the 3 versions (local, result from
// update, and query of the data source
// Id
assertEquals(new Long(3L), requestQuery.getId());
assertEquals(result.getId(), requestQuery.getId());
// Course
assertEquals("CS110", requestQuery.getCourse().getName());
assertEquals(result.getCourse(), requestQuery.getCourse());
// Assignment
assertEquals("PEX2", requestQuery.getAssignment());
assertEquals(result.getAssignment(), requestQuery.getAssignment());
// Term
assertEquals("Fall 2010", requestQuery.getTerm());
assertEquals(result.getTerm(), requestQuery.getTerm());
// Version
assertEquals("M2", requestQuery.getVersion());
assertEquals(result.getVersion(), requestQuery.getVersion());
// Due Date
assertEquals("29 Apr 2010", requestQuery.getDueDate());
assertEquals(result.getDueDate(), requestQuery.getDueDate());
// Partial Credit
assertEquals(true, requestQuery.getPartialCredit());
assertEquals(result.getPartialCredit(), requestQuery.getPartialCredit());
// Number of Questions
assertEquals(1, requestQuery.getQuestions().size());
assertEquals(result.getQuestions().size(), requestQuery.getQuestions().size());
assertTrue(instance.isOpen());
}