Project

General

Profile

« Previous | Next » 

Revision ba38e16d

Added by Andreas Kohlbecker over 6 years ago

ref #7114 fixing probelms of test in suite (relates also to ref #7138)

View differences:

cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/utility/DerivedUnitConverterIntegrationTest.java
12 12

  
13 13
import java.io.FileNotFoundException;
14 14

  
15
import org.junit.Ignore;
16 15
import org.junit.Test;
16
import org.unitils.dbunit.annotation.DataSet;
17 17
import org.unitils.spring.annotation.SpringBeanByType;
18 18

  
19 19
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
......
28 28
 * @since Jun 23, 2017
29 29
 *
30 30
 */
31
@Ignore
31
@DataSet // the dataset cleans up the DerivedUnits created in the tests
32 32
public class DerivedUnitConverterIntegrationTest extends CdmTransactionalIntegrationTest {
33 33

  
34 34
    @SpringBeanByType
......
37 37
    @Test
38 38
    public void toMediaSpecimen_issue7114() throws DerivedUnitConversionException {
39 39

  
40
        // NOTE:
41
        // normally we would run this test as CdmIntegrationTest, but due to bug #7138
42
        // this is not possible, so we use CdmTransactionalIntegrationTest as super class
43
        // and stop the transaction at the beginning of the test
44
        commit();
45

  
40 46
        assertEquals(0, service.list(null, null, null, null, null).size());
41 47

  
42 48
        DerivedUnit du = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
......
53 59
    @Test
54 60
    public void toDerivedUnit_issue7114() throws DerivedUnitConversionException {
55 61

  
62
        // NOTE:
63
        // normally we would run this test as CdmIntegrationTest, but due to bug #7138
64
        // this is not possible, so we use CdmTransactionalIntegrationTest as super class
65
        // and stop the transaction at the beginning of the test
66
        commit();
67

  
56 68
        assertEquals(0, service.list(null, null, null, null, null).size());
57 69

  
58 70
        MediaSpecimen du = MediaSpecimen.NewInstance(SpecimenOrObservationType.StillImage);
cdmlib-services/src/test/java/eu/etaxonomy/cdm/test/suite/TestsShouldNotFailInSuite_s5.java
1
/**
2
* Copyright (C) 2009 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

  
10
package eu.etaxonomy.cdm.test.suite;
11

  
12
import org.junit.runner.RunWith;
13
import org.junit.runners.Suite;
14

  
15

  
16

  
17
@RunWith(Suite.class)
18
@Suite.SuiteClasses(
19
		{
20
		    eu.etaxonomy.cdm.api.service.TransmissionEngineDistributionTest.class,
21
		    eu.etaxonomy.cdm.api.service.UserAndGroupServiceImplTest.class,
22
		    eu.etaxonomy.cdm.api.utility.DerivedUnitConverterIntegrationTest.class
23
		    /*
24
		     * all test in DerivedUnitConverterIntegrationTest where failing due to a
25
		     *
26
		     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27
		     * org.springframework.transaction.IllegalTransactionStateException:
28
		     * Pre-bound JDBC Connection found! HibernateTransactionManager does
29
		     * not support running within DataSourceTransactionManager if told to
30
		     * manage the DataSource itself. It is recommended to use a single
31
		     * HibernateTransactionManager for all transactions on a single
32
		     * DataSource, no matter whether Hibernate or JDBC access
33
             * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34
		     */
35
		}
36
	)
37
public class TestsShouldNotFailInSuite_s5 {
38

  
39
	// the class remains completely empty,
40
	// being used only as a holder for the above annotations
41

  
42
}
cdmlib-services/src/test/resources/eu/etaxonomy/cdm/api/utility/DerivedUnitConverterIntegrationTest.xml
1
<?xml version='1.0' encoding='UTF-8'?>
2
<dataset>
3
  <SPECIMENOROBSERVATIONBASE />
4
</dataset>

Also available in: Unified diff