@@ -0,0 +1,1814 @@
+package beaform.dao;%0A%0Aimport javax.persistence.EntityManager;%0Aimport javax.persistence.NoResultException;%0Aimport javax.persistence.PersistenceException;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport beaform.debug.DebugUtils;%0Aimport beaform.entities.FormulaTag;%0Aimport junit.framework.TestCase;%0A%0A/**%0A * Test for the tag DAO.%0A *%0A * @author Steven Post%0A *%0A */%0Apublic class FormulaTagDAOTest extends TestCase %7B%0A%0A%09private static final Logger LOG = LoggerFactory.getLogger(FormulaTagDAOTest.class);%0A%0A%09/**%0A%09 * %7B@inheritDoc%7D%0A%09 */%0A%09@Override%0A%09@Before%0A%09public void setUp() %7B%0A%09%09GraphDbHandler.initInstance(%22test%22);%0A%09%09DebugUtils.clearDb();%0A%09%7D%0A%0A%09@Test%0A%09public void testFindTagByName() %7B%0A%09%09DebugUtils.fillDb();%0A%09%09final EntityManager entitymanager = GraphDbHandler.getInstance().getEntityManager();%0A%09%09entitymanager.getTransaction().begin();%0A%0A%09%09final FormulaTag tag = FormulaTagDAO.findByObject(new FormulaTag(%22First%22));%0A%0A%09%09entitymanager.getTransaction().commit();%0A%0A%09%09assertNotNull(%22The tag wasn't found%22, tag);%0A%09%09assertEquals(%22This isn't the expected formula%22, %22First%22, tag.getName());%0A%09%7D%0A%0A%09@Test(expected=NoResultException.class)%0A%09public void testFindTagByNameNoResult() %7B%0A%09%09DebugUtils.fillDb();%0A%09%09final EntityManager entitymanager = GraphDbHandler.getInstance().getEntityManager();%0A%09%09try %7B%0A%09%09entitymanager.getTransaction().begin();%0A%0A%09%09FormulaTagDAO.findByObject(new FormulaTag(%22Form1%22));%0A%0A%09%09entitymanager.getTransaction().commit();%0A%09%09%7D%0A%09%09catch (PersistenceException pe) %7B%0A%09%09%09if (entitymanager.getTransaction().isActive()) %7B%0A%09%09%09%09entitymanager.getTransaction().rollback();%0A%09%09%09%7D%0A%09%09%09LOG.debug(%22Something went wrong%22, pe);%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09@After%0A%09public void tearDown() %7B%0A%09%09DebugUtils.clearDb();%0A%09%09GraphDbHandler.clearInstance();%0A%09%7D%0A%0A%7D%0A

Add tests for FormulaTag