HHH-8688 EntityGraph should add AttributeNode's for basic NamedAttributeNode

This commit is contained in:
Scott Marlow 2013-11-08 09:51:31 -05:00
parent 7de7b7c235
commit 246ce294a8
1 changed files with 2 additions and 16 deletions

View File

@ -42,7 +42,7 @@ import static org.junit.Assert.assertTrue;
public class NamedEntityGraphsTest extends BaseEntityManagerFunctionalTestCase { public class NamedEntityGraphsTest extends BaseEntityManagerFunctionalTestCase {
@Override @Override
protected Class<?>[] getAnnotatedClasses() { protected Class<?>[] getAnnotatedClasses() {
return new Class[] { /*Person.class,*/ Employee.class }; return new Class[] { Person.class, Employee.class };
} }
@Test @Test
@ -54,16 +54,8 @@ public class NamedEntityGraphsTest extends BaseEntityManagerFunctionalTestCase
} }
@Test @Test
public void testGetData() { public void testAttributeNodesAreAvailable() {
EntityManager em = getOrCreateEntityManager(); EntityManager em = getOrCreateEntityManager();
// em.getTransaction().begin();
//
// Employee employee = new Employee();
// employee.setId(3l);
// employee.setName("Sharon");
// employee.setSalary(20000.0);
// em.persist(employee);
try {
EntityGraph graph = em.getEntityGraph( "name_salary_graph" ); EntityGraph graph = em.getEntityGraph( "name_salary_graph" );
assertNotNull( graph ); assertNotNull( graph );
@ -81,12 +73,6 @@ public class NamedEntityGraphsTest extends BaseEntityManagerFunctionalTestCase
assertTrue( "node2 attribute name is expected to be either 'name' or 'salary' but actually is "+attributeNode2.getAttributeName(), assertTrue( "node2 attribute name is expected to be either 'name' or 'salary' but actually is "+attributeNode2.getAttributeName(),
"name".equals(attributeNode2.getAttributeName()) || "salary".equals(attributeNode2.getAttributeName())); "name".equals(attributeNode2.getAttributeName()) || "salary".equals(attributeNode2.getAttributeName()));
}
finally {
// em.getTransaction().rollback();
em.close();
}
} }
} }