Project

General

Profile

« Previous | Next » 

Revision ba787a05

Added by Andreas Müller about 16 years ago

View differences:

.gitattributes
255 255
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/DatabaseInitialiser.java -text
256 256
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/common/CdmBaseTest.java -text
257 257
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/common/TermLoaderTest.java -text
258
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/name/BotanicalNameTest.java -text
258 259
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/taxon/TaxonBaseTest.java -text
259 260
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/taxon/TaxonTest.java -text
260 261
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/TaxonNameParserBotanicalNameImplTest.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/BacterialName.java
11 11

  
12 12

  
13 13
import org.apache.log4j.Logger;
14
import org.hibernate.annotations.Cascade;
15
import org.hibernate.annotations.CascadeType;
16 14

  
17
import java.util.*;
18 15
import javax.persistence.*;
19 16

  
20 17
/**
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/BotanicalName.java
17 17
import eu.etaxonomy.cdm.model.agent.Agent;
18 18
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
19 19
import eu.etaxonomy.cdm.strategy.BotanicNameCacheStrategy;
20
import eu.etaxonomy.cdm.strategy.ZooNameCacheStrategy;
20
import eu.etaxonomy.cdm.strategy.TaxonNameParserBotanicalNameImpl;
21 21

  
22 22
import java.util.*;
23 23

  
24
import javax.naming.NameParser;
24 25
import javax.persistence.*;
25 26

  
26 27
/**
......
42 43
	private boolean isAnamorphic;
43 44
	private Set<HybridRelationship> hybridRelationships = new HashSet();
44 45

  
46
	public static BotanicalName PARSED_NAME(String fullName){
47
		if (nameParser == null){
48
			nameParser = new TaxonNameParserBotanicalNameImpl();
49
		}
50
		return (BotanicalName)nameParser.parseFullName(fullName);
51
	}
52
	
45 53
	//needed by hibernate
46 54
	protected BotanicalName(){
47 55
		super();
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonNameBase.java
24 24
import org.hibernate.annotations.CascadeType;
25 25

  
26 26
import eu.etaxonomy.cdm.strategy.INameCacheStrategy;
27
import eu.etaxonomy.cdm.strategy.ITaxonNameParser;
27 28

  
28 29
import java.util.*;
29 30

  
......
63 64

  
64 65
	protected INameCacheStrategy cacheStrategy;
65 66

  
67
	static protected ITaxonNameParser nameParser;
68
	
69
//	/**
70
//	 * Returns a TaxonNameBase instance 
71
//	 * @param fullName
72
//	 */
73
//	abstract public static TaxonNameBase PARSED_NAME(String fullName);
66 74
	
67 75
	// CONSTRUCTORS	
68 76
	public TaxonNameBase() {
......
278 286
		return "";
279 287
	}
280 288

  
281
	/**
282
	 * 
283
	 * @param fullname    fullname
284
	 */
285
	public boolean parseName(String fullname){
286
		return false;
287
	}	
288 289
	
289 290
	/**
290 291
	 * Return a set of taxa that use this name
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/name/BotanicalNameTest.java
1
package eu.etaxonomy.cdm.model.name;
2

  
3
import static org.junit.Assert.*;
4

  
5
import org.junit.After;
6
import org.junit.AfterClass;
7
import org.junit.Before;
8
import org.junit.BeforeClass;
9
import org.junit.Test;
10
import org.apache.log4j.Logger;
11

  
12
public class BotanicalNameTest {
13
	private static final Logger logger = Logger.getLogger(BotanicalNameTest.class);
14
	
15
	@BeforeClass
16
	public static void setUpBeforeClass() throws Exception {
17
	}
18

  
19
	@AfterClass
20
	public static void tearDownAfterClass() throws Exception {
21
	}
22

  
23
	@Before
24
	public void setUp() throws Exception {
25
	}
26

  
27
	@After
28
	public void tearDown() throws Exception {
29
	}
30
	
31
/****** TESTS *******************************/
32

  
33
	@Test
34
	public final void testPARSED_NAME() {
35
		String fullName = "Abies alba subsp. beta (L.) Mill.";
36
		BotanicalName name = BotanicalName.PARSED_NAME(fullName);
37
		assertFalse(name.getHasProblem());
38
		assertEquals("beta", name.getInfraSpecificEpithet());
39
	}
40

  
41
	@Test
42
	public final void testBotanicalName() {
43
		logger.warn("Not yet implemented"); // TODO
44
	}
45

  
46
	@Test
47
	public final void testBotanicalNameRank() {
48
		logger.warn("Not yet implemented"); // TODO
49
	}
50

  
51
	@Test
52
	public final void testBotanicalNameRankStringStringStringAgentINomenclaturalReferenceString() {
53
		logger.warn("Not yet implemented"); // TODO
54
	}
55

  
56
	@Test
57
	public final void testGetHybridRelationships() {
58
		logger.warn("Not yet implemented"); // TODO
59
	}
60

  
61
	@Test
62
	public final void testSetHybridRelationships() {
63
		logger.warn("Not yet implemented"); // TODO
64
	}
65

  
66
	@Test
67
	public final void testAddHybridRelationship() {
68
		logger.warn("Not yet implemented"); // TODO
69
	}
70

  
71
	@Test
72
	public final void testRemoveHybridRelationship() {
73
		logger.warn("Not yet implemented"); // TODO
74
	}
75

  
76
	@Test
77
	public final void testGetParentRelationships() {
78
		logger.warn("Not yet implemented"); // TODO
79
	}
80

  
81
	@Test
82
	public final void testGetChildRelationships() {
83
		logger.warn("Not yet implemented"); // TODO
84
	}
85

  
86
	@Test
87
	public final void testIsHybridFormula() {
88
		logger.warn("Not yet implemented"); // TODO
89
	}
90

  
91
	@Test
92
	public final void testSetHybridFormula() {
93
		logger.warn("Not yet implemented"); // TODO
94
	}
95

  
96
	@Test
97
	public final void testIsMonomHybrid() {
98
		logger.warn("Not yet implemented"); // TODO
99
	}
100

  
101
	@Test
102
	public final void testSetMonomHybrid() {
103
		logger.warn("Not yet implemented"); // TODO
104
	}
105

  
106
	@Test
107
	public final void testIsBinomHybrid() {
108
		logger.warn("Not yet implemented"); // TODO
109
	}
110

  
111
	@Test
112
	public final void testSetBinomHybrid() {
113
		logger.warn("Not yet implemented"); // TODO
114
	}
115

  
116
	@Test
117
	public final void testIsTrinomHybrid() {
118
		logger.warn("Not yet implemented"); // TODO
119
	}
120

  
121
	@Test
122
	public final void testSetTrinomHybrid() {
123
		logger.warn("Not yet implemented"); // TODO
124
	}
125

  
126
	@Test
127
	public final void testIsAnamorphic() {
128
		logger.warn("Not yet implemented"); // TODO
129
	}
130

  
131
	@Test
132
	public final void testSetAnamorphic() {
133
		logger.warn("Not yet implemented"); // TODO
134
	}
135

  
136
}

Also available in: Unified diff