Skip to content
Snippets Groups Projects
Commit 000eee16 authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman :boom:
Browse files

Added an assertion to the unit test. Seems to actually be working.

parent 19df1c73
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ package com.syncleus.grail.graph.hibernate; ...@@ -2,6 +2,7 @@ package com.syncleus.grail.graph.hibernate;
import com.syncleus.grail.graph.hibernate.domain.Breed; import com.syncleus.grail.graph.hibernate.domain.Breed;
import com.syncleus.grail.graph.hibernate.domain.Dog; import com.syncleus.grail.graph.hibernate.domain.Dog;
import junit.framework.Assert;
import org.hibernate.ogm.util.impl.Log; import org.hibernate.ogm.util.impl.Log;
import org.hibernate.ogm.util.impl.LoggerFactory; import org.hibernate.ogm.util.impl.LoggerFactory;
import org.junit.Test; import org.junit.Test;
...@@ -28,7 +29,6 @@ public class DogBreedTest { ...@@ -28,7 +29,6 @@ public class DogBreedTest {
//Persist entities the way you are used to in plain JPA //Persist entities the way you are used to in plain JPA
try { try {
tm.begin(); tm.begin();
// logger.infof( "About to store dog and breed" );
EntityManager em = emf.createEntityManager(); EntityManager em = emf.createEntityManager();
Breed collie = new Breed(); Breed collie = new Breed();
collie.setName( "Collie" ); collie.setName( "Collie" );
...@@ -43,11 +43,11 @@ public class DogBreedTest { ...@@ -43,11 +43,11 @@ public class DogBreedTest {
tm.commit(); tm.commit();
//Retrieve your entities the way you are used to in plain JPA //Retrieve your entities the way you are used to in plain JPA
// logger.infof( "About to retrieve dog and breed" );
tm.begin(); tm.begin();
em = emf.createEntityManager(); em = emf.createEntityManager();
dina = em.find( Dog.class, dinaId ); dina = em.find( Dog.class, dinaId );
// logger.infof( "Found dog %s of breed %s", dina.getName(), dina.getBreed().getName() ); Assert.assertEquals("Dina", dina.getName());
Assert.assertEquals("Collie", dina.getBreed().getName());
em.flush(); em.flush();
em.close(); em.close();
tm.commit(); tm.commit();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment