1
|
/**
|
2
|
* Copyright (C) 2007 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.taxeditor.store;
|
11
|
|
12
|
|
13
|
import org.junit.Assert;
|
14
|
import org.junit.Before;
|
15
|
import org.junit.Test;
|
16
|
|
17
|
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
|
18
|
import eu.etaxonomy.cdm.model.common.DefaultTermInitializer;
|
19
|
import eu.etaxonomy.cdm.model.name.INonViralName;
|
20
|
import eu.etaxonomy.cdm.model.name.Rank;
|
21
|
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
|
22
|
|
23
|
/**
|
24
|
* @author n.hoffmann
|
25
|
* @created 17.03.2009
|
26
|
*/
|
27
|
//@Transactional(TransactionMode.DISABLED)
|
28
|
public class NameProtectTitleCacheTest /*extends CdmIntegrationTest */{
|
29
|
|
30
|
// @SpringBeanByType
|
31
|
@SuppressWarnings("unused")
|
32
|
private CdmStore cdmStore;// = CdmStore.getDefault();
|
33
|
|
34
|
|
35
|
@SuppressWarnings("unused")
|
36
|
private ConversationHolder conversation;
|
37
|
|
38
|
private INonViralName name;
|
39
|
|
40
|
/**
|
41
|
* @throws java.lang.Exception
|
42
|
*/
|
43
|
@Before
|
44
|
public void setUp() throws Exception {
|
45
|
|
46
|
(new DefaultTermInitializer()).initialize();
|
47
|
|
48
|
name = TaxonNameFactory.NewNonViralInstance(Rank.SPECIES());
|
49
|
|
50
|
name.setGenusOrUninomial("Joe");
|
51
|
name.setSpecificEpithet("mama");
|
52
|
}
|
53
|
|
54
|
/**
|
55
|
*
|
56
|
*/
|
57
|
@Test
|
58
|
public void testProtectTitleCache(){
|
59
|
Assert.assertTrue(name.isProtectedTitleCache() == false);
|
60
|
name.setProtectedTitleCache(true);
|
61
|
Assert.assertTrue(name.isProtectedTitleCache() == true);
|
62
|
Assert.assertTrue(name.getGenusOrUninomial().equals("Joe"));
|
63
|
}
|
64
|
}
|