Project

General

Profile

Revision b838ce03

IDb838ce0342e3c8b2c57eb1537e989f62ccb2742f
Parent eabaec9b
Child c423c274

Added by Andreas Kohlbecker over 7 years ago

removing old TODO

View differences:

cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/dao/hibernate/taxon/TaxonDaoHibernateImplTest.java
12 12
import static org.junit.Assert.assertEquals;
13 13
import static org.junit.Assert.assertFalse;
14 14
import static org.junit.Assert.assertNotNull;
15
import static org.junit.Assert.assertNull;
15 16
import static org.junit.Assert.assertSame;
16 17
import static org.junit.Assert.assertTrue;
17
import static org.junit.Assert.assertNull;
18 18
import static org.junit.Assert.fail;
19 19

  
20 20
import java.io.FileNotFoundException;
......
25 25
import java.util.Set;
26 26
import java.util.UUID;
27 27

  
28
import org.junit.Assert;
29 28
import org.apache.log4j.Level;
30 29
import org.hibernate.Hibernate;
31 30
import org.hibernate.envers.query.AuditEntity;
32 31
import org.hibernate.envers.query.criteria.AuditCriterion;
33 32
import org.junit.After;
33
import org.junit.Assert;
34 34
import org.junit.Before;
35 35
import org.junit.Ignore;
36 36
import org.junit.Test;
......
80 80
 * @author ben.clark
81 81
 *
82 82
 */
83
//@Ignore //FIXME running out of time, so I hope someone else can fix the testdata for this class (Andreas Kohlbecker)
84 83
public class TaxonDaoHibernateImplTest extends CdmTransactionalIntegrationTest {
85 84

  
86 85
    @SpringBeanByType
......
241 240

  
242 241
        logger.setLevel(Level.DEBUG); //FIXME #######################
243 242
        if (logger.isDebugEnabled()) {
244
        	for (int i = 0; i < results.size(); i++) {
245
        		String nameCache = "";
246
        		TaxonNameBase<?,?> taxonNameBase= ((TaxonBase)results.get(i)).getName();
247
        		nameCache = HibernateProxyHelper.deproxy(taxonNameBase, NonViralName.class).getNameCache();
248
        		logger.debug(results.get(i).getClass() + "(" + i +")" +
249
        				": Name Cache = " + nameCache + ", Title Cache = " + results.get(i).getTitleCache());
250
        	}
243
            for (int i = 0; i < results.size(); i++) {
244
                String nameCache = "";
245
                TaxonNameBase<?,?> taxonNameBase= results.get(i).getName();
246
                nameCache = HibernateProxyHelper.deproxy(taxonNameBase, NonViralName.class).getNameCache();
247
                logger.debug(results.get(i).getClass() + "(" + i +")" +
248
                        ": Name Cache = " + nameCache + ", Title Cache = " + results.get(i).getTitleCache());
249
            }
251 250
        }
252 251

  
253
		assertEquals(numberOfTaxaByName_A, results.size());
252
        assertEquals(numberOfTaxaByName_A, results.size());
254 253

  
255 254

  
256 255
        //System.err.println("Species group: " + Rank.SPECIESGROUP().getId() + "Species: " + Rank.SPECIES().getId() + "Section Botany: "+ Rank.SECTION_BOTANY());
......
484 483
        Synonym syn = (Synonym)taxonDao.findByUuid(this.atroposLeach);
485 484
        Taxon tax = (Taxon) taxonDao.findByUuid(rethera);
486 485
        tax.addSynonym(syn, SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF());
487
     
486

  
488 487
        taxonDao.save(tax);
489 488
        results = taxonDao.findByNameTitleCache(true, true, "A", null, MatchMode.BEGINNING, namedAreas,
490 489
            null, null, null);
......
741 740
            e.printStackTrace();
742 741
        }
743 742
    }
744
    
743

  
745 744
    @Test
746 745
    @DataSet
747 746
   // @ExpectedDataSet("TaxonDaoHibernateImplTest.testDelete-result.xml")
......
750 749
        taxon.addMarker(Marker.NewInstance(MarkerType.IS_DOUBTFUL(), true));
751 750
        taxonDao.save(taxon);
752 751
        assert taxon != null : "taxon must exist";
753
        
752

  
754 753
        taxonDao.delete(taxon);
755 754
        commitAndStartNewTransaction(null);
756 755
        taxon = (Taxon)taxonDao.findByUuid(acherontia);
......
1087 1086
//    @Test
1088 1087
//    public void testDeploy(){
1089 1088
//    	TaxonBase taxonBase = taxonDao.findByUuid(UUID.fromString("6bfedf25-6dbc-4d5c-9d56-84f9052f3b2a"));
1090
//    	
1089
//
1091 1090
//    	Synonym synonym = taxonBase.deproxy(taxonBase, Synonym.class);
1092 1091
//    }
1093 1092

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)