예제 #1
0
 @Test
 @Transactional
 public void testRelationshipGetPropertyDate() {
   Person p = new Person("Michael", 35);
   Person p2 = new Person("David", 25);
   Friendship f = p.knows(p2);
   f.getUnderlyingState().setProperty("Friendship.firstMeetingDate", "3");
   assertEquals("Date not deserialized properly.", new Date(3), f.getFirstMeetingDate());
 }
예제 #2
0
 @Test(expected = NotFoundException.class)
 @Transactional
 public void testRelationshipSetTransientPropertyFieldNotManaged() {
   Person p = new Person("Michael", 35);
   Person p2 = new Person("David", 25);
   Friendship f = p.knows(p2);
   f.setLatestLocation("Menlo Park");
   f.getUnderlyingState().getProperty("Friendship.latestLocation");
 }
예제 #3
0
 @Test
 @Transactional
 public void testRelationshipGetTransientPropertyFieldNotManaged() {
   Person p = new Person("Michael", 35);
   Person p2 = new Person("David", 25);
   Friendship f = p.knows(p2);
   f.setLatestLocation("Menlo Park");
   f.getUnderlyingState().setProperty("Friendship.latestLocation", "Palo Alto");
   assertEquals(
       "Should not have read transient value from graph.", "Menlo Park", f.getLatestLocation());
 }