예제 #1
0
 @Test(expected = NotFoundException.class)
 @Transactional
 public void testSetTransientPropertyFieldNotManaged() {
   Person p = new Person("Michael", 35);
   p.setThought("food");
   p.getUnderlyingState().getProperty("Person.thought");
 }
예제 #2
0
 @Test
 @Transactional
 public void testGetTransientPropertyFieldNotManaged() {
   Person p = new Person("Michael", 35);
   p.setThought("food");
   p.getUnderlyingState().setProperty("Person.thought", "sleep");
   assertEquals("Should not have read transient value from graph.", "food", p.getThought());
 }
예제 #3
0
 @Test
 @Transactional
 public void testGetPropertyEnum() {
   Person p = new Person("Michael", 35);
   p.getUnderlyingState().setProperty("Person.personality", "EXTROVERT");
   assertEquals(
       "Did not deserialize property value properly.", Personality.EXTROVERT, p.getPersonality());
 }
예제 #4
0
 @Test
 @Transactional
 public void testSetPropertyEnum() {
   Person p = new Person("Michael", 35);
   p.setPersonality(Personality.EXTROVERT);
   assertEquals(
       "Wrong enum serialization.",
       "EXTROVERT",
       p.getUnderlyingState().getProperty("Person.personality"));
 }
예제 #5
0
 @Test
 @Transactional
 public void testEntityIdField() {
   Person p = new Person("Michael", 35);
   assertEquals("Wrong ID.", p.getUnderlyingState().getId(), p.getId());
 }