Revision 90046bc4
Added by Andreas Müller almost 8 years ago
cdmlib-model/src/test/java/eu/etaxonomy/cdm/test/function/TestModel.java | ||
---|---|---|
6 | 6 |
* |
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 |
*/
|
|
9 |
*/ |
|
10 | 10 |
|
11 | 11 |
package eu.etaxonomy.cdm.test.function; |
12 | 12 |
|
... | ... | |
34 | 34 |
public class TestModel { |
35 | 35 |
private static final UUID TEST_TAXON_UUID = UUID.fromString("b3084573-343d-4279-ba92-4ab01bb47db5"); |
36 | 36 |
static Logger logger = Logger.getLogger(TestModel.class); |
37 |
|
|
37 |
|
|
38 | 38 |
public void testSomething(){ |
39 |
|
|
39 |
|
|
40 | 40 |
logger.info("Create name objects..."); |
41 | 41 |
logger.info(NomenclaturalStatusType.NUDUM().getRepresentation(Language.LATIN()).getAbbreviatedLabel()); |
42 | 42 |
NonViralName<?> tn = NonViralName.NewInstance(Rank.SPECIES()); |
43 | 43 |
BotanicalName tn3 = BotanicalName.NewInstance(Rank.SUBSPECIES()); |
44 | 44 |
ZoologicalName parentName = ZoologicalName.NewInstance(Rank.FAMILY()); |
45 |
|
|
45 |
|
|
46 | 46 |
logger.info("Create reference objects..."); |
47 |
Reference<?> sec = ReferenceFactory.newJournal();
|
|
47 |
Reference sec = ReferenceFactory.newJournal(); |
|
48 | 48 |
sec.setTitleCache("TestJournal", true); |
49 |
|
|
49 |
|
|
50 | 50 |
logger.info("Create taxon objects..."); |
51 | 51 |
Taxon childTaxon = Taxon.NewInstance(tn, sec); |
52 | 52 |
Synonym syn = Synonym.NewInstance(tn3, sec); |
... | ... | |
54 | 54 |
Taxon parentTaxon = Taxon.NewInstance(parentName, sec); |
55 | 55 |
parentTaxon.setUuid(TEST_TAXON_UUID); |
56 | 56 |
parentTaxon.addTaxonomicChild(childTaxon, sec, null); |
57 |
|
|
57 |
|
|
58 | 58 |
// setup listeners |
59 | 59 |
PropertyChangeTest listener = new PropertyChangeTest(); |
60 | 60 |
tn.addPropertyChangeListener(listener); |
... | ... | |
64 | 64 |
tn.setGenusOrUninomial("tn1-Genus1"); |
65 | 65 |
tn3.setGenusOrUninomial("tn3-genus"); |
66 | 66 |
tn3.getGenusOrUninomial(); |
67 |
|
|
67 |
|
|
68 | 68 |
logger.info("Create new Author agent..."); |
69 | 69 |
Person team= Person.NewInstance(); |
70 | 70 |
team.addPropertyChangeListener(listener); |
71 | 71 |
team.setTitleCache("AuthorAgent1", true); |
72 | 72 |
tn.setCombinationAuthorship(team); |
73 | 73 |
} |
74 |
|
|
74 |
|
|
75 | 75 |
public void testParentRelation(){ |
76 | 76 |
TaxonNameBase<?,?> taxonName = BotanicalName.NewInstance(Rank.SPECIES()); |
77 |
Reference<?> ref = ReferenceFactory.newJournal();
|
|
77 |
Reference ref = ReferenceFactory.newJournal(); |
|
78 | 78 |
Taxon parent = Taxon.NewInstance(taxonName, ref); |
79 | 79 |
Taxon child = Taxon.NewInstance(taxonName, null); |
80 | 80 |
parent.addTaxonomicChild(child, null, null); |
... | ... | |
82 | 82 |
logger.warn("Error"); |
83 | 83 |
} |
84 | 84 |
} |
85 |
|
|
85 |
|
|
86 | 86 |
public void testDescription(){ |
87 |
Reference<?> ref = ReferenceFactory.newJournal();
|
|
87 |
Reference ref = ReferenceFactory.newJournal(); |
|
88 | 88 |
Taxon taxon = Taxon.NewInstance(null, ref); |
89 | 89 |
TaxonDescription desc = TaxonDescription.NewInstance(); |
90 | 90 |
taxon.addDescription(desc); |
... | ... | |
97 | 97 |
// System.out.println(tdwgArea.getLabel()); |
98 | 98 |
// System.out.println(tdwgArea2.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()); |
99 | 99 |
} |
100 |
|
|
100 |
|
|
101 | 101 |
private void test(){ |
102 | 102 |
System.out.println("Start ..."); |
103 | 103 |
TestModel sc = new TestModel(); |
... | ... | |
107 | 107 |
sc.testTDWG(); |
108 | 108 |
System.out.println("\nEnd ..."); |
109 | 109 |
} |
110 |
|
|
110 |
|
|
111 | 111 |
/** |
112 | 112 |
* @param args |
113 | 113 |
*/ |
Also available in: Unified diff
Remove generics from Reference in cdmlib-model #5830