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.api.service;
|
11
|
|
12
|
import java.io.FileNotFoundException;
|
13
|
import java.util.UUID;
|
14
|
|
15
|
import org.apache.log4j.Level;
|
16
|
import org.apache.log4j.Logger;
|
17
|
import org.junit.Assert;
|
18
|
import org.junit.Ignore;
|
19
|
import org.junit.Test;
|
20
|
import org.unitils.database.annotations.Transactional;
|
21
|
import org.unitils.database.util.TransactionMode;
|
22
|
import org.unitils.dbunit.annotation.DataSet;
|
23
|
import org.unitils.dbunit.annotation.ExpectedDataSet;
|
24
|
import org.unitils.spring.annotation.SpringBeanByType;
|
25
|
|
26
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
27
|
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
28
|
import eu.etaxonomy.cdm.test.integration.CdmTransactionalIntegrationTest;
|
29
|
|
30
|
/**
|
31
|
* @author a.mueller
|
32
|
*
|
33
|
*/
|
34
|
@Transactional(TransactionMode.DISABLED)
|
35
|
public class IdentifiableServiceBaseTest extends CdmTransactionalIntegrationTest {
|
36
|
@SuppressWarnings("unused")
|
37
|
private static final Logger logger = Logger.getLogger(IdentifiableServiceBaseTest.class);
|
38
|
|
39
|
|
40
|
@SpringBeanByType
|
41
|
private INameService nameService;
|
42
|
|
43
|
/****************** TESTS *****************************/
|
44
|
|
45
|
@Test
|
46
|
public final void voidTestSeriveExists(){
|
47
|
Assert.assertNotNull("Service shoulb be initialized", nameService);
|
48
|
}
|
49
|
|
50
|
|
51
|
@Test
|
52
|
@DataSet
|
53
|
@ExpectedDataSet
|
54
|
public final void testUpdateTitleCache() {
|
55
|
Assert.assertEquals("There should be 5 TaxonNames in the data set", 5, nameService.count(TaxonNameBase.class));
|
56
|
Class clazz = TaxonNameBase.class;
|
57
|
int stepSize = 2;
|
58
|
nameService.updateTitleCache(clazz, stepSize, null, null);
|
59
|
commit();
|
60
|
// commitAndStartNewTransaction(new String[]{"TaxonNameBase","TaxonNameBase_AUD"});
|
61
|
}
|
62
|
|
63
|
|
64
|
/* (non-Javadoc)
|
65
|
* @see eu.etaxonomy.cdm.test.integration.CdmIntegrationTest#createTestData()
|
66
|
*/
|
67
|
@Override
|
68
|
public void createTestDataSet() throws FileNotFoundException {
|
69
|
// TODO Auto-generated method stub
|
70
|
|
71
|
}
|
72
|
|
73
|
|
74
|
}
|