package com.hida.dao;

import org.dbunit.dataset.IDataSet;
import org.dbunit.dataset.xml.FlatXmlDataSet;
import org.testng.annotations.Test;
import org.testng.Assert;

/**
 *
 * @author lruffin
 */
public class PurlDaoImplTest extends EntityDaoImplTest{

    @Override
    protected IDataSet getDataSet() throws Exception {
        IDataSet dataSet = new FlatXmlDataSet(this.getClass().getClassLoader().
                getResourceAsStream("Purl.xml"));
        return dataSet;        
    }
    
    @Test
    public void testFindByPurl(){
        Assert.fail("unimplemented");
    }

    @Test
    public void testSavePurl(){
        Assert.fail("unimplemented");
    }

    @Test
    public void testDeletePurl(){
        Assert.fail("unimplemented");
    }
    
}

@@ -16,16 +16,44 @@
 a.dao;%0A%0A
+import com.hida.model.Purl;%0A
 import o
@@ -141,63 +141,226 @@
 org.
-testng.annotations.Test;%0Aimport org.testng.Assert;%0A%0A/**
+springframework.beans.factory.annotation.Autowired;%0Aimport org.testng.annotations.Test;%0Aimport org.testng.Assert;%0A%0A/**%0A * Tests the functionality of PurlDaoTest and ensures that it properly interacts%0A * with Hibernate.
 %0A *%0A
@@ -436,18 +436,197 @@
 ImplTest
+ 
 %7B%0A
+    %0A    @Autowired%0A    private PurlDao Dao;%0A%0A    /**%0A     * Retrieves data from an xml file sheet to mock Pids.%0A     *%0A     * @return a data set%0A     * @throws Exception%0A     */
 %0A    @Ov
@@ -844,27 +844,83 @@
 Set;
+%0A
     
+%7D%0A%0A
     
-%0A    %7D
+/**%0A     * Tests to see if a purl entity is retrievable
 %0A    
+ */
 %0A   
@@ -954,24 +954,25 @@
 FindByPurl()
+ 
 %7B%0A        As
@@ -973,37 +973,272 @@
     
-Assert.fail(%22unimplemented%22);
+Purl entity1 = Dao.findByPurl(%22abc123%22);%0A        Purl entity2 = Dao.findByPurl(%22xyz%22);%0A        Purl entity3 = Dao.findByPurl(%22null%22);%0A        %0A        Assert.assertNotNull(entity1);%0A        Assert.assertNotNull(entity2);%0A        Assert.assertNull(entity3);        
 %0A   
@@ -1277,24 +1277,25 @@
 stSavePurl()
+ 
 %7B%0A        As
@@ -1371,16 +1371,17 @@
 tePurl()
+ 
 %7B%0A      
@@ -1418,15 +1418,11 @@
 ;%0A    %7D%0A
-    
 %0A%7D%0A

Complete testFindByPurl