Project

General

Profile

Download (1.85 KB) Statistics
| Branch: | Tag: | Revision:
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.util.UUID;
13

    
14
import org.apache.log4j.Level;
15
import org.apache.log4j.Logger;
16
import org.junit.Assert;
17
import org.junit.Ignore;
18
import org.junit.Test;
19
import org.unitils.database.annotations.Transactional;
20
import org.unitils.database.util.TransactionMode;
21
import org.unitils.dbunit.annotation.DataSet;
22
import org.unitils.dbunit.annotation.ExpectedDataSet;
23
import org.unitils.spring.annotation.SpringBeanByType;
24

    
25
import eu.etaxonomy.cdm.model.common.CdmBase;
26
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
27
import eu.etaxonomy.cdm.test.integration.CdmTransactionalIntegrationTest;
28

    
29
/**
30
 * @author a.mueller
31
 *
32
 */
33
@Transactional(TransactionMode.DISABLED)
34
public class IdentifiableServiceBaseTest extends CdmTransactionalIntegrationTest {
35
	@SuppressWarnings("unused")
36
	private static final Logger logger = Logger.getLogger(IdentifiableServiceBaseTest.class);
37
	
38
	
39
	@SpringBeanByType
40
	private INameService nameService;
41
	
42
/****************** TESTS *****************************/
43
	
44
	@Test
45
	public final void voidTestSeriveExists(){
46
		Assert.assertNotNull("Service shoulb be initialized", nameService);
47
	}
48

    
49
	
50
	@Test
51
	@DataSet
52
	@ExpectedDataSet	
53
	public final void testUpdateTitleCache() {
54
		Assert.assertEquals("There should be 5 TaxonNames in the data set", 5, nameService.count(TaxonNameBase.class));
55
		Class clazz = TaxonNameBase.class;
56
		int stepSize = 2;
57
		nameService.updateTitleCache(clazz, stepSize, null, null);
58
		commit();
59
//		commitAndStartNewTransaction(new String[]{"TaxonNameBase","TaxonNameBase_AUD"});	
60
	}
61

    
62

    
63
}
(8-8/27)