Project

General

Profile

« Previous | Next » 

Revision 0eeb74cb

Added by Andreas Müller almost 2 years ago

ref #10067 update to hibernate 5.3 (cont.)

View differences:

cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/dao/hibernate/taxon/TaxonNodeDaoHibernateImplTest.java
22 22
import java.util.Set;
23 23
import java.util.UUID;
24 24

  
25
import org.hibernate.proxy.HibernateProxy;
25 26
import org.junit.After;
26 27
import org.junit.Assert;
27 28
import org.junit.Before;
......
51 52
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
52 53
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
53 54
import eu.etaxonomy.cdm.test.integration.CdmTransactionalIntegrationTest;
54
import javassist.util.proxy.Proxy;
55 55

  
56 56
public class TaxonNodeDaoHibernateImplTest extends CdmTransactionalIntegrationTest {
57 57

  
......
246 246
    }
247 247

  
248 248
    @Test
249
    @DataSet(value="TaxonNodeDaoHibernateImplTest.testSortindexForJavassist.xml")
250
    @ExpectedDataSet("TaxonNodeDaoHibernateImplTest.testSortindexForJavassist-result.xml")
249
    @DataSet(value="TaxonNodeDaoHibernateImplTest.testSortindexForHibernateProxy.xml")
250
    @ExpectedDataSet("TaxonNodeDaoHibernateImplTest.testSortindexForHibernateProxy-result.xml")
251 251
    //test if TaxonNode.remove(index) works correctly with proxies
252
    public void testSortindexForJavassist(){
252
    public void testSortindexForHibernateProxy(){
253 253
    	Taxon taxonWithLazyLoadedParentNodeOnTopLevel = (Taxon)taxonDao.findByUuid(UUID.fromString("bc09aca6-06fd-4905-b1e7-cbf7cc65d783"));
254 254
    	TaxonNode parent = taxonWithLazyLoadedParentNodeOnTopLevel.getTaxonNodes().iterator().next().getParent();
255
    	Assert.assertTrue("Parent node must be proxy, otherwise test does not work", parent instanceof Proxy);
255
    	Assert.assertTrue("Parent node must be proxy, otherwise test does not work", parent instanceof HibernateProxy);
256 256
    	Taxon firstTopLevelTaxon = (Taxon)taxonDao.findByUuid(UUID.fromString("7b8b5cb3-37ba-4dba-91ac-4c6ffd6ac331"));
257 257
    	Classification classification = classificationDao.findByUuid(ClassificationUuid);
258 258
    	TaxonNode childNode = classification.addParentChild(taxonWithLazyLoadedParentNodeOnTopLevel, firstTopLevelTaxon, null, null);
......
261 261
    }
262 262

  
263 263
    @Test
264
    @DataSet(value="TaxonNodeDaoHibernateImplTest.testSortindexForJavassist.xml")
265
    @ExpectedDataSet("TaxonNodeDaoHibernateImplTest.testSortindexForJavassist2-result.xml")
264
    @DataSet(value="TaxonNodeDaoHibernateImplTest.testSortindexForHibernateProxy.xml")
265
    @ExpectedDataSet("TaxonNodeDaoHibernateImplTest.testSortindexForHibernateProxy2-result.xml")
266 266
    //test if TaxonNode.addNode(node) works correctly with proxies
267
    public void testSortindexForJavassist2(){
267
    public void testSortindexForHibernateProxy2(){
268 268
    	Taxon taxonWithLazyLoadedParentNodeOnTopLevel = (Taxon)taxonDao.findByUuid(UUID.fromString("bc09aca6-06fd-4905-b1e7-cbf7cc65d783"));
269 269
    	TaxonNode parent = taxonWithLazyLoadedParentNodeOnTopLevel.getTaxonNodes().iterator().next().getParent();
270
    	Assert.assertTrue("Parent node must be proxy, otherwise test does not work", parent instanceof Proxy);
270
    	Assert.assertTrue("Parent node must be proxy, otherwise test does not work", parent instanceof HibernateProxy);
271 271
    	Taxon newTaxon = Taxon.NewInstance(null, null);
272 272
    	Classification classification = classificationDao.findByUuid(ClassificationUuid);
273 273
    	TaxonNode newNode = classification.addChildTaxon(newTaxon, 0, null, null);
cdmlib-test/src/main/java/eu/etaxonomy/cdm/test/unitils/DdlCreator.java
80 80
            //metadata
81 81
            ImplicitNamingStrategyComponentPathImpl namingStrategy = new ImplicitNamingStrategyComponentPathImpl();
82 82
            PhysicalNamingStrategy physicalNamingStrategy = new UpperCasePhysicalNamingStrategyStandardImpl();
83
            Metadata metadata = metadataSources.getMetadataBuilder(serviceRegistry)
83
            Metadata metadata = metadataSources.getMetadataBuilder()
84 84
                    .applyImplicitSchemaName("public")
85 85
                    .applyImplicitNamingStrategy(namingStrategy)
86 86
                    .applyPhysicalNamingStrategy(physicalNamingStrategy)

Also available in: Unified diff