Exemplo n.º 1
0
 @Test(expected = NotFoundException.class)
 @Transactional
 public void testSetTransientPropertyFieldNotManaged() {
   Person p = new Person("Michael", 35);
   p.setThought("food");
   p.getUnderlyingState().getProperty("Person.thought");
 }
Exemplo n.º 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());
 }
Exemplo n.º 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());
 }
Exemplo n.º 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"));
 }
Exemplo n.º 5
0
 @Test
 @Transactional
 public void testEntityIdField() {
   Person p = new Person("Michael", 35);
   assertEquals("Wrong ID.", p.getUnderlyingState().getId(), p.getId());
 }