Project

General

Profile

Revision 033fa0b2

ID033fa0b24f4049507df29558b07b3c50a913d1f5
Parent df5738fe
Child fe34a9eb

Added by Andreas Müller over 2 years ago

ref #6365 use TaxonNameFactory for zoological names

View differences:

cdmlib-ext/src/main/java/eu/etaxonomy/cdm/ext/occurrence/gbif/GbifJsonOccurrenceParser.java
248 248
                            string = record.getString(NOMENCLATURALCODE);
249 249

  
250 250
                            if (string.equals(NomenclaturalCode.ICZN.getTitleCache())){
251
                                name = TaxonNameBase.NewZoologicalInstance(rank);
251
                                name = TaxonNameFactory.NewZoologicalInstance(rank);
252 252
                            } else if (string.equals(NomenclaturalCode.ICNAFP.getTitleCache())) {
253 253
                                name = TaxonNameBase.NewBotanicalInstance(rank);
254 254
                            } else if (string.equals(NomenclaturalCode.ICNB.getTitleCache())){
......
264 264
                                if (record.getString(KINGDOM).equals(PLANTAE)){
265 265
                                    name = TaxonNameBase.NewBotanicalInstance(rank);
266 266
                                } else if (record.getString(KINGDOM).equals(ANIMALIA)){
267
                                    name = TaxonNameBase.NewZoologicalInstance(rank);
267
                                    name = TaxonNameFactory.NewZoologicalInstance(rank);
268 268
                                } else if (record.getString(KINGDOM).equals(FUNGI)){
269 269
                                    name = TaxonNameBase.NewBotanicalInstance(rank);
270 270
                                } else if (record.getString(KINGDOM).equals(BACTERIA)){
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/excel/taxa/NormalExplicitImport.java
502 502
        NomenclaturalCode nc = state.getConfig().getNomenclaturalCode();
503 503
        ITaxonNameBase name = null;
504 504
        if (nc.isKindOf(NomenclaturalCode.ICZN)){
505
            name = TaxonNameBase.NewZoologicalInstance(taxonBase.getName().getRank());
505
            name = TaxonNameFactory.NewZoologicalInstance(taxonBase.getName().getRank());
506 506
        }else if (nc.isKindOf(NomenclaturalCode.ICNAFP)){
507 507
            name = TaxonNameBase.NewBotanicalInstance(taxonBase.getName().getRank());
508 508
        } else{
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/specimen/SpecimenImportBase.java
162 162
            if (state.getDataHolder().getNomenclatureCode().equals(NomenclaturalCode.ICNAFP)){
163 163
                taxonName = TaxonNameBase.NewBotanicalInstance(rank);
164 164
            }else if (state.getDataHolder().getNomenclatureCode().equals(NomenclaturalCode.ICZN)){
165
                taxonName = TaxonNameBase.NewZoologicalInstance(rank);
165
                taxonName = TaxonNameFactory.NewZoologicalInstance(rank);
166 166
            }else{
167 167
                taxonName = TaxonNameFactory.NewNonViralInstance(rank);
168 168
            }
......
283 283
	        }
284 284

  
285 285
	        if (state.getDataHolder().getNomenclatureCode().equals("Zoological") || state.getDataHolder().getNomenclatureCode().equals(NomenclaturalCode.ICZN.getUuid())) {
286
	            TaxonNameBase<?,?> taxonName = TaxonNameBase.NewZoologicalInstance(null);
286
	            TaxonNameBase<?,?> taxonName = TaxonNameFactory.NewZoologicalInstance(null);
287 287
	            taxonName.setFullTitleCache(fullName, true);
288 288
	            taxonName.setGenusOrUninomial(NB(getFromMap(atomisedMap, "Genus")));
289 289
	            taxonName.setInfraGenericEpithet(NB(getFromMap(atomisedMap, "SubGenus")));
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/NomenclaturalCode.java
141 141
			result = TaxonNameBase.NewBotanicalInstance(rank);
142 142
			break;
143 143
		case ICZN:
144
			result = TaxonNameBase.NewZoologicalInstance(rank);
144
			result = TaxonNameFactory.NewZoologicalInstance(rank);
145 145
			break;
146 146
		case ICNCP:
147 147
			result = TaxonNameFactory.NewCultivarInstance(rank);
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonNameBase.java
510 510
// *************** FACTORY METHODS ********************************/
511 511

  
512 512

  
513
    /**
514
     * Creates a new zoological taxon name instance
515
     * only containing its {@link Rank rank} and
516
     * the {@link eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy default cache strategy}.
517
     *
518
     * @param   rank    the rank to be assigned to <i>this</i> zoological taxon name
519
     * @see             #ZoologicalName(Rank, HomotypicalGroup)
520
     * @see             #NewInstance(Rank, HomotypicalGroup)
521
     * @see             #NewZoologicalInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
522
     * @see             eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy
523
     */
524
    public static ZoologicalName NewZoologicalInstance(Rank rank){
525
        return new ZoologicalName(rank, null);
526
    }
527

  
528
    /**
529
     * Creates a new zoological taxon name instance
530
     * only containing its {@link Rank rank},
531
     * its {@link HomotypicalGroup homotypical group} and
532
     * the {@link eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy default cache strategy}.
533
     * The new zoological taxon name instance will be also added to the set of
534
     * zoological taxon names belonging to the given homotypical group.
535
     *
536
     * @param  rank  the rank to be assigned to <i>this</i> zoological taxon name
537
     * @param  homotypicalGroup  the homotypical group to which <i>this</i> zoological taxon name belongs
538
     * @see    #NewInstance(Rank)
539
     * @see    #NewZoologicalInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
540
     * @see    #ZoologicalName(Rank, HomotypicalGroup)
541
     * @see    eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy
542
     */
543
    public static ZoologicalName NewZoologicalInstance(Rank rank, HomotypicalGroup homotypicalGroup){
544
        return new ZoologicalName(rank, homotypicalGroup);
545
    }
546
    /**
547
     * Creates a new zoological taxon name instance
548
     * containing its {@link Rank rank},
549
     * its {@link HomotypicalGroup homotypical group},
550
     * its scientific name components, its {@link eu.etaxonomy.cdm.agent.TeamOrPersonBase author(team)},
551
     * its {@link eu.etaxonomy.cdm.reference.INomenclaturalReference nomenclatural reference} and
552
     * the {@link eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy default cache strategy}.
553
     * The new zoological taxon name instance will be also added to the set of
554
     * zoological taxon names belonging to the given homotypical group.
555
     *
556
     * @param   rank  the rank to be assigned to <i>this</i> zoological taxon name
557
     * @param   genusOrUninomial the string for <i>this</i> zoological taxon name
558
     *          if its rank is genus or higher or for the genus part
559
     *          if its rank is lower than genus
560
     * @param   infraGenericEpithet  the string for the first epithet of
561
     *          <i>this</i> zoological taxon name if its rank is lower than genus
562
     *          and higher than species aggregate
563
     * @param   specificEpithet  the string for the first epithet of
564
     *          <i>this</i> zoological taxon name if its rank is species aggregate or lower
565
     * @param   infraSpecificEpithet  the string for the second epithet of
566
     *          <i>this</i> zoological taxon name if its rank is lower than species
567
     * @param   combinationAuthorship  the author or the team who published <i>this</i> zoological taxon name
568
     * @param   nomenclaturalReference  the nomenclatural reference where <i>this</i> zoological taxon name was published
569
     * @param   nomenclMicroRef  the string with the details for precise location within the nomenclatural reference
570
     * @param   homotypicalGroup  the homotypical group to which <i>this</i> zoological taxon name belongs
571
     * @see     #NewInstance(Rank)
572
     * @see     #NewInstance(Rank, HomotypicalGroup)
573
     * @see     #ZoologicalName(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
574
     * @see     eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy
575
     */
576
    public static ZoologicalName NewZoologicalInstance(Rank rank, String genusOrUninomial, String infraGenericEpithet, String specificEpithet, String infraSpecificEpithet, TeamOrPersonBase combinationAuthorship, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef, HomotypicalGroup homotypicalGroup) {
577
        return new ZoologicalName(rank, genusOrUninomial, infraGenericEpithet, specificEpithet, infraSpecificEpithet, combinationAuthorship, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
578
    }
579 513

  
580 514
    /**
581 515
     * Creates a new botanical taxon name instance
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImpl.java
103 103
					result = TaxonNameFactory.NewCultivarInstance(rank);
104 104
				}
105 105
			}else if ( isZoologicalName /*&& ! isBotanicalName*/ && !isBacteriologicalName && !isCultivatedPlantName){
106
				result = TaxonNameBase.NewZoologicalInstance(rank);
106
				result = TaxonNameFactory.NewZoologicalInstance(rank);
107 107
			}else if ( isZoologicalName && ! isBotanicalName && !isBacteriologicalName && !isCultivatedPlantName){
108 108
				result = TaxonNameFactory.NewBacterialInstance(rank);
109 109
			}else {
......
115 115
				result = TaxonNameBase.NewBotanicalInstance(rank);
116 116
				break;
117 117
			case ICZN:
118
				result = TaxonNameBase.NewZoologicalInstance(rank);
118
				result = TaxonNameFactory.NewZoologicalInstance(rank);
119 119
				break;
120 120
			case ICNCP:
121 121
				logger.warn("ICNCP parsing not yet implemented");
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/name/NonViralNameTest.java
326 326
		assertEquals(0, botanicalName1.getHybridChildRelations().size());
327 327
		BotanicalName femaleParent = TaxonNameBase.NewBotanicalInstance(null);
328 328
		NonViralName<?> maleParent = TaxonNameFactory.NewNonViralInstance(null);
329
		ZoologicalName child = TaxonNameBase.NewZoologicalInstance(null);
329
		ZoologicalName child = TaxonNameFactory.NewZoologicalInstance(null);
330 330

  
331 331
		botanicalName1.addHybridParent(femaleParent, HybridRelationshipType.FEMALE_PARENT(), null);
332 332
		botanicalName1.addHybridParent(maleParent, HybridRelationshipType.MALE_PARENT(), null);
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/name/ZoologicalNameTest.java
37 37
	 */
38 38
	@Before
39 39
	public void setUp() throws Exception {
40
		zooName1 = TaxonNameBase.NewZoologicalInstance(Rank.SPECIES(), "Aus", null, "bus", "infracus", null, null, null, null);
40
		zooName1 = TaxonNameFactory.NewZoologicalInstance(Rank.SPECIES(), "Aus", null, "bus", "infracus", null, null, null, null);
41 41
	}
42 42

  
43 43
//****************** TESTS ******************************************/
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/taxon/ClassificationTest.java
39 39
import eu.etaxonomy.cdm.model.name.BotanicalName;
40 40
import eu.etaxonomy.cdm.model.name.Rank;
41 41
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
42
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
42 43
//import eu.etaxonomy.cdm.model.reference.Book;
43 44
//import eu.etaxonomy.cdm.model.reference.Journal;
44 45
import eu.etaxonomy.cdm.model.reference.Reference;
......
101 102
		taxonName12 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
102 103
		taxonName121 = TaxonNameBase.NewBotanicalInstance(Rank.SUBSPECIES());
103 104
		taxonName1 = TaxonNameBase.NewBotanicalInstance(Rank.GENUS());
104
		taxonName2 = TaxonNameBase.NewZoologicalInstance(Rank.GENUS());
105
		taxonName2 = TaxonNameFactory.NewZoologicalInstance(Rank.GENUS());
105 106
		taxonName3 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
106 107
		ref1 = ReferenceFactory.newJournal();
107 108
		ref2 = ReferenceFactory.newJournal();
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/taxon/TaxonBaseTest.java
25 25
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
26 26
import eu.etaxonomy.cdm.model.name.Rank;
27 27
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
28
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
28 29
import eu.etaxonomy.cdm.model.name.ZoologicalName;
29 30
import eu.etaxonomy.cdm.model.reference.Reference;
30 31
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
......
59 60
	public void setUp() throws Exception {
60 61
		sec= ReferenceFactory.newBook();
61 62
		sec.setTitleCache("Schoenes saftiges Allg�u", true);
62
		name1 = TaxonNameBase.NewZoologicalInstance(Rank.SPECIES(),"Panthera",null,"onca",null,null,null,"p.1467", null);
63
		name1 = TaxonNameFactory.NewZoologicalInstance(Rank.SPECIES(),"Panthera",null,"onca",null,null,null,"p.1467", null);
63 64
		HomotypicalGroup homotypicalGroup = HomotypicalGroup.NewInstance();
64 65
		name2 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES(),"Abies",null,"alba",null,null,null,"p.317", homotypicalGroup);
65 66
		// taxa
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/taxon/TaxonComparatorTest.java
22 22
import eu.etaxonomy.cdm.model.common.TimePeriod;
23 23
import eu.etaxonomy.cdm.model.name.BotanicalName;
24 24
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
25
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
25 26
import eu.etaxonomy.cdm.model.name.ZoologicalName;
26 27
//import eu.etaxonomy.cdm.model.reference.Book;
27 28
import eu.etaxonomy.cdm.model.reference.Reference;
......
69 70
        BotanicalName botName1 =  TaxonNameBase.NewBotanicalInstance(null);
70 71
        BotanicalName botName2 =  TaxonNameBase.NewBotanicalInstance(null);
71 72
        BotanicalName botName3 =  TaxonNameBase.NewBotanicalInstance(null);
72
        ZoologicalName zooName1 = TaxonNameBase.NewZoologicalInstance(null);
73
        ZoologicalName zooName1 = TaxonNameFactory.NewZoologicalInstance(null);
73 74

  
74 75
        botName1.setNomenclaturalReference(ref1);
75 76
        botName2.setNomenclaturalReference(ref2);
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/taxon/TaxonTest.java
31 31
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
32 32
import eu.etaxonomy.cdm.model.name.Rank;
33 33
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
34
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
34 35
import eu.etaxonomy.cdm.model.name.ZoologicalName;
35 36
//import eu.etaxonomy.cdm.model.reference.Book;
36 37
import eu.etaxonomy.cdm.model.reference.Reference;
......
71 72
		misSec = ReferenceFactory.newBook();
72 73
		misSec.setTitleCache("Stupid book", true);
73 74

  
74
		name1 = TaxonNameBase.NewZoologicalInstance(Rank.SPECIES(),"Panthera",null,"onca",null,linne,null,"p.1467", null);
75
		name1 = TaxonNameFactory.NewZoologicalInstance(Rank.SPECIES(),"Panthera",null,"onca",null,linne,null,"p.1467", null);
75 76
		name2 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES(),"Abies",null,"alba",null,linne,null,"p.317", null);
76 77
		name3 = TaxonNameBase.NewBotanicalInstance(Rank.SUBSPECIES(),"Polygala",null,"vulgaris","alpina",linne,null,"p.191", null);
77 78
		name4 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES(),"Cichoria",null,"carminata",null,linne,null,"p.14", null);
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/name/NonViralNameDefaultCacheStrategyTest.java
193 193
        Assert.assertEquals("", "Genus subsect. Infragenus", botName.getNameCache());
194 194

  
195 195
        //zool. specific ranks (we don't have markers here therefore no problem should exist
196
        ZoologicalName zooName = TaxonNameBase.NewZoologicalInstance(Rank.SECTION_ZOOLOGY());
196
        ZoologicalName zooName = TaxonNameFactory.NewZoologicalInstance(Rank.SECTION_ZOOLOGY());
197 197
        zooName.setGenusOrUninomial("Genus");
198 198
        zooName.setInfraGenericEpithet("Infragenus");
199 199
        Assert.assertEquals("", "Genus", zooName.getNameCache());
......
426 426
        Assert.assertNotNull("TitleCache should not be null", subSpeciesName.getTitleCache());
427 427

  
428 428
        //year
429
        ZoologicalName zooName = TaxonNameBase.NewZoologicalInstance(Rank.SPECIES());
429
        ZoologicalName zooName = TaxonNameFactory.NewZoologicalInstance(Rank.SPECIES());
430 430
        zooName.setGenusOrUninomial("Homo");
431 431
        zooName.setSpecificEpithet("sapiens");
432 432
        zooName.setBasionymAuthorship(basAuthor);
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/name/ZooNameNoMarkerCacheStrategyTest.java
25 25
import eu.etaxonomy.cdm.model.name.NonViralName;
26 26
import eu.etaxonomy.cdm.model.name.Rank;
27 27
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
28
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
28 29
import eu.etaxonomy.cdm.model.name.ZoologicalName;
29 30

  
30 31
/**
......
80 81
		familyName = TaxonNameBase.PARSED_ZOOLOGICAL(familyNameString, Rank.FAMILY());
81 82
		genusName = TaxonNameBase.PARSED_ZOOLOGICAL(genusNameString, Rank.GENUS());
82 83

  
83
		subGenusName = TaxonNameBase.NewZoologicalInstance(Rank.SUBGENUS());
84
		subGenusName = TaxonNameFactory.NewZoologicalInstance(Rank.SUBGENUS());
84 85
		subGenusName.setGenusOrUninomial("Genus");
85 86
		subGenusName.setInfraGenericEpithet("InfraGenericPart");
86 87

  
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/name/ZoologicalNameCacheStrategyTest.java
27 27
import eu.etaxonomy.cdm.model.name.NonViralName;
28 28
import eu.etaxonomy.cdm.model.name.Rank;
29 29
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
30
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
30 31
import eu.etaxonomy.cdm.model.name.ZoologicalName;
31 32

  
32 33
/**
......
83 84
		familyName = TaxonNameBase.PARSED_ZOOLOGICAL(familyNameString, Rank.FAMILY());
84 85
		genusName = TaxonNameBase.PARSED_ZOOLOGICAL(genusNameString, Rank.GENUS());
85 86

  
86
		subGenusName = TaxonNameBase.NewZoologicalInstance(Rank.SUBGENUS());
87
		subGenusName = TaxonNameFactory.NewZoologicalInstance(Rank.SUBGENUS());
87 88
		subGenusName.setGenusOrUninomial("Genus");
88 89
		subGenusName.setInfraGenericEpithet("InfraGenericPart");
89 90

  
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplTest.java
43 43
import eu.etaxonomy.cdm.model.name.NonViralName;
44 44
import eu.etaxonomy.cdm.model.name.Rank;
45 45
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
46
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
46 47
import eu.etaxonomy.cdm.model.name.ZoologicalName;
47 48
import eu.etaxonomy.cdm.model.reference.IArticle;
48 49
import eu.etaxonomy.cdm.model.reference.IBook;
......
393 394
        assertTrue("Basionym author team should have more authors", ((Team)authorname.getCombinationAuthorship()).isHasMoreMembers()  );
394 395

  
395 396
        //et al.
396
        NonViralName<?> nvn = TaxonNameBase.NewZoologicalInstance(null);
397
        NonViralName<?> nvn = TaxonNameFactory.NewZoologicalInstance(null);
397 398
        parser.parseAuthors(nvn, "Eckweiler, Hand et al., 2003");
398 399
        Team team = (Team)nvn.getCombinationAuthorship();
399 400
        Assert.assertNotNull("Comb. author must not be null", team);
......
463 464
        assertEquals("Second team member should be Schwedt", "Schwedt", team.getTeamMembers().get(2).getTitleCache());
464 465

  
465 466
        //et al.
466
        NonViralName<?> nvn = TaxonNameBase.NewZoologicalInstance(null);
467
        NonViralName<?> nvn = TaxonNameFactory.NewZoologicalInstance(null);
467 468
        parser.parseReferencedName (nvn, "Marmota marmota Eckweiler, Hand et al., 2003", Rank.SPECIES(),true);
468 469
        assertTrue("Combination author should be a team", nvn.getCombinationAuthorship() instanceof Team);
469 470
        team = (Team)nvn.getCombinationAuthorship();
......
1579 1580
     */
1580 1581
    @Test
1581 1582
    public final void testParseAuthorsTaxonNameString() throws StringNotParsableException {
1582
        NonViralName<?> nvn = TaxonNameBase.NewZoologicalInstance(null);
1583
        NonViralName<?> nvn = TaxonNameFactory.NewZoologicalInstance(null);
1583 1584
        parser.parseAuthors(nvn, "Eckweiler & ten Hagen, 2003");
1584 1585
        Team team = (Team)nvn.getCombinationAuthorship();
1585 1586
        Assert.assertNotNull("Comb. author must not be null", team);
......
1587 1588
        Assert.assertEquals("Second member must be 'ten Hagen'", "ten Hagen", team.getTeamMembers().get(1).getTitleCache());
1588 1589

  
1589 1590
        //Crosson du Cormier, 1964
1590
        ZoologicalName zooName = TaxonNameBase.NewZoologicalInstance(null);
1591
        ZoologicalName zooName = TaxonNameFactory.NewZoologicalInstance(null);
1591 1592
        parser.parseAuthors(zooName, "Crosson du Cormier, 1964");
1592 1593
        Person person = (Person)zooName.getCombinationAuthorship();
1593 1594
        Assert.assertNotNull("Comb. author must not be null", person);
......
1595 1596
        Assert.assertEquals("Year must be 1964", Integer.valueOf(1964), zooName.getPublicationYear() );
1596 1597

  
1597 1598
        //(van der Hoeven, 1839)
1598
        zooName = TaxonNameBase.NewZoologicalInstance(null);
1599
        zooName = TaxonNameFactory.NewZoologicalInstance(null);
1599 1600
        parser.parseAuthors(zooName, "(van der Hoeven, 1839)");
1600 1601
        Assert.assertNull("Combination author must be null", zooName.getCombinationAuthorship());
1601 1602
        person = (Person)zooName.getBasionymAuthorship();
......
1604 1605
        Assert.assertEquals("Year must be 1839", Integer.valueOf(1839), zooName.getOriginalPublicationYear() );
1605 1606

  
1606 1607
        //le Doux, 1931
1607
        zooName = TaxonNameBase.NewZoologicalInstance(null);
1608
        zooName = TaxonNameFactory.NewZoologicalInstance(null);
1608 1609
        parser.parseAuthors(zooName, "le Doux, 1931");
1609 1610
        person = (Person)zooName.getCombinationAuthorship();
1610 1611
        Assert.assertNotNull("Comb. author must not be null", person);
cdmlib-model/src/test/java/eu/etaxonomy/cdm/test/function/strategy/TestTaxonNameParserBotanicalNameImpl.java
19 19

  
20 20
import eu.etaxonomy.cdm.model.name.BotanicalName;
21 21
import eu.etaxonomy.cdm.model.name.NonViralName;
22
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
22
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
23 23
import eu.etaxonomy.cdm.strategy.parser.INonViralNameParser;
24 24
import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
25 25

  
......
115 115

  
116 116

  
117 117
	private int  parseIt(String fullRef1){
118
		NonViralName<?> nvName = TaxonNameBase.NewZoologicalInstance(null);
118
		NonViralName<?> nvName = TaxonNameFactory.NewZoologicalInstance(null);
119 119
		NonViralNameParserImpl parser = new NonViralNameParserImpl();
120 120

  
121 121
		//parser.parseFullName(strNameAbiesBasionymAuthorUe, null);
cdmlib-model/src/test/java/eu/etaxonomy/cdm/validation/BasionymsMustShareEpithetsAndAuthorsTest.java
24 24
import eu.etaxonomy.cdm.model.name.NameRelationship;
25 25
import eu.etaxonomy.cdm.model.name.Rank;
26 26
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
27
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
27 28
import eu.etaxonomy.cdm.model.name.ZoologicalName;
28 29
import eu.etaxonomy.cdm.model.reference.Reference;
29 30
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
......
157 158
       Reference nomRef = ReferenceFactory.newBook();
158 159
       Reference nomRef2 = ReferenceFactory.newBook();
159 160

  
160
       ZoologicalName zooName = TaxonNameBase.NewZoologicalInstance(Rank.SPECIES());
161
       ZoologicalName zooName = TaxonNameFactory.NewZoologicalInstance(Rank.SPECIES());
161 162
       zooName.setGenusOrUninomial("Aus");
162 163
       zooName.setSpecificEpithet("aus");
163 164
       zooName.setBasionymAuthorship(author1);
164 165
       zooName.setNomenclaturalReference(nomRef);
165
       ZoologicalName originalCombination = TaxonNameBase.NewZoologicalInstance(Rank.SPECIES());
166
       ZoologicalName originalCombination = TaxonNameFactory.NewZoologicalInstance(Rank.SPECIES());
166 167
       originalCombination.setGenusOrUninomial("Aus");
167 168
       originalCombination.setSpecificEpithet("aus");
168 169
       originalCombination.setCombinationAuthorship(author1);
cdmlib-model/src/test/java/eu/etaxonomy/cdm/validation/ValidTaxonomicYearTest.java
17 17
import eu.etaxonomy.cdm.model.name.BotanicalName;
18 18
import eu.etaxonomy.cdm.model.name.Rank;
19 19
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
20
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
20 21
import eu.etaxonomy.cdm.model.name.ZoologicalName;
21 22
import eu.etaxonomy.cdm.model.reference.Reference;
22 23
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
......
92 93
    @Test
93 94
    public void testZooName() {
94 95

  
95
        ZoologicalName zooName = TaxonNameBase.NewZoologicalInstance(Rank.SPECIES());
96
        ZoologicalName zooName = TaxonNameFactory.NewZoologicalInstance(Rank.SPECIES());
96 97

  
97 98
        zooName.setNomenclaturalReference(null);
98 99
        zooName.setPublicationYear(1788);
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/data/FullCoverageDataGenerator.java
840 840
		hybridRel.setCitationMicroReference("p. 123");
841 841
		handleAnnotatableEntity(hybridRel);
842 842

  
843
		ZoologicalName zooName = TaxonNameBase.NewZoologicalInstance(Rank.GENUS());
843
		ZoologicalName zooName = TaxonNameFactory.NewZoologicalInstance(Rank.GENUS());
844 844
		zooName.setBreed("breed");
845 845
		zooName.setPublicationYear(1922);
846 846
		zooName.setOriginalPublicationYear(1987);
......
856 856
		handleIdentifiableEntity(zooName);
857 857

  
858 858
		//TypeDesignation
859
		ZoologicalName speciesZooName = TaxonNameBase.NewZoologicalInstance(Rank.SPECIES());
859
		ZoologicalName speciesZooName = TaxonNameFactory.NewZoologicalInstance(Rank.SPECIES());
860 860
		NameTypeDesignation nameDesig = zooName.addNameTypeDesignation(speciesZooName, getReference(), "111", "original name",
861 861
				NameTypeDesignationStatus.AUTOMATIC(), true, true, true, true);
862 862
		handleAnnotatableEntity(nameDesig);
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/CdmGenericDaoImplTest.java
130 130
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
131 131
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
132 132
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
133
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
133 134
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
134 135
import eu.etaxonomy.cdm.model.name.ViralName;
135 136
import eu.etaxonomy.cdm.model.name.ZoologicalName;
......
497 498
		BotanicalName name2 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
498 499
		name2.setTitleCache("BotanicalName2", true);
499 500

  
500
		ZoologicalName zooName1 = TaxonNameBase.NewZoologicalInstance(Rank.SPECIES());
501
		ZoologicalName zooName1 = TaxonNameFactory.NewZoologicalInstance(Rank.SPECIES());
501 502
		name1.setTitleCache("ZoologicalName1", true);
502 503

  
503 504
		Reference article1 = ReferenceFactory.newArticle();
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/dao/hibernate/name/ConfigurableNameCacheStrategyGeneratorsTest.java
21 21
import org.unitils.spring.annotation.SpringApplicationContext;
22 22
import org.unitils.spring.annotation.SpringBeanByType;
23 23

  
24
import eu.etaxonomy.cdm.model.name.BotanicalName;
25 24
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
25
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
26 26
import eu.etaxonomy.cdm.persistence.dao.name.ITaxonNameDao;
27 27
import eu.etaxonomy.cdm.persistence.dao.taxon.ITaxonDao;
28 28
import eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy;
......
76 76

  
77 77
	@Test
78 78
	public void testNewEntities() {
79
		TaxonNameBase acherontiaLachesis = TaxonNameBase.NewZoologicalInstance(null);
79
		TaxonNameBase acherontiaLachesis = TaxonNameFactory.NewZoologicalInstance(null);
80 80
		INameCacheStrategy zoologicalStrategy = (INameCacheStrategy)acherontiaLachesis.getCacheStrategy();
81 81
		assertEquals("ZoologicalName.cacheStrategy should be TestingZoologicalNameCacheStrategy",TestingZoologicalNameCacheStrategy.class,zoologicalStrategy.getClass());
82 82

  
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/dao/hibernate/name/TaxonNameDaoHibernateImplTest.java
34 34
import eu.etaxonomy.cdm.model.name.Rank;
35 35
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
36 36
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
37
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
37 38
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
38 39
import eu.etaxonomy.cdm.model.name.ZoologicalName;
39 40
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
......
182 183

  
183 184
    @Test
184 185
    public void testCountNamesByExample() {
185
        ZoologicalName zoologicalName = TaxonNameBase.NewZoologicalInstance(Rank.GENUS());
186
        ZoologicalName zoologicalName = TaxonNameFactory.NewZoologicalInstance(Rank.GENUS());
186 187
        zoologicalName.setGenusOrUninomial("Atropos");
187 188
        Set<String> includedProperties = new HashSet<String>();
188 189
        includedProperties.add("genusOrUninomial");
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/hibenate/permission/CdmPermissionClassTest.java
18 18
import eu.etaxonomy.cdm.model.description.SpecimenDescription;
19 19
import eu.etaxonomy.cdm.model.description.TaxonDescription;
20 20
import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
21
import eu.etaxonomy.cdm.model.name.BotanicalName;
22 21
import eu.etaxonomy.cdm.model.name.Rank;
23 22
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
23
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
24 24
import eu.etaxonomy.cdm.model.taxon.Synonym;
25 25
import eu.etaxonomy.cdm.model.taxon.Taxon;
26 26
import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmPermissionClass;
......
36 36
    public void testCdmPermissionClass(){
37 37
        Assert.assertEquals(
38 38
                CdmPermissionClass.TAXONNAMEBASE,
39
                CdmPermissionClass.getValueOf(TaxonNameBase.NewZoologicalInstance(Rank.GENUS()))
39
                CdmPermissionClass.getValueOf(TaxonNameFactory.NewZoologicalInstance(Rank.GENUS()))
40 40
                );
41 41
        Assert.assertEquals(
42 42
                CdmPermissionClass.TAXONNAMEBASE,
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java
98 98
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
99 99
import eu.etaxonomy.cdm.model.name.Rank;
100 100
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
101
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
101 102
import eu.etaxonomy.cdm.model.name.ZoologicalName;
102 103
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
103 104
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
......
2469 2470
        }*/
2470 2471

  
2471 2472
        //create potential combinations...
2472
        inferredSynName = TaxonNameBase.NewZoologicalInstance(syn.getName().getRank());
2473
        inferredSynName = TaxonNameFactory.NewZoologicalInstance(syn.getName().getRank());
2473 2474

  
2474 2475
        inferredSynName.setGenusOrUninomial(synParentGenus);
2475 2476
        if (zooSynName.isSpecies()){
......
2533 2534
            synonymsEpithet.add(synSpeciesEpithetName);
2534 2535
        }*/
2535 2536

  
2536
        inferredSynName = TaxonNameBase.NewZoologicalInstance(taxon.getName().getRank());
2537
        inferredSynName = TaxonNameFactory.NewZoologicalInstance(taxon.getName().getRank());
2537 2538
        //TODO:differ between parent is genus and taxon is species, parent is subgenus and taxon is species, parent is species and taxon is subspecies and parent is genus and taxon is subgenus...
2538 2539

  
2539 2540

  
......
2624 2625
            synonymsGenus.put(synGenusName, idInSource);
2625 2626
        }*/
2626 2627

  
2627
        inferredSynName = TaxonNameBase.NewZoologicalInstance(taxon.getName().getRank());
2628
        inferredSynName = TaxonNameFactory.NewZoologicalInstance(taxon.getName().getRank());
2628 2629

  
2629 2630
        // DEBUG TODO: for subgenus or subspecies the infrageneric or infraspecific epithet should be used!!!
2630 2631
        if (epithetOfTaxon == null && infragenericEpithetOfTaxon == null && infraspecificEpithetOfTaxon == null) {
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/SecurityTest.java
47 47
import eu.etaxonomy.cdm.model.description.Feature;
48 48
import eu.etaxonomy.cdm.model.description.TaxonDescription;
49 49
import eu.etaxonomy.cdm.model.description.TextData;
50
import eu.etaxonomy.cdm.model.name.BotanicalName;
51 50
import eu.etaxonomy.cdm.model.name.Rank;
52 51
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
52
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
53 53
import eu.etaxonomy.cdm.model.name.ZoologicalName;
54 54
import eu.etaxonomy.cdm.model.reference.Reference;
55 55
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
......
259 259
        SecurityContext context = SecurityContextHolder.getContext();
260 260
        context.setAuthentication(authentication);
261 261

  
262
        ZoologicalName newName = TaxonNameBase.NewZoologicalInstance(Rank.SPECIES());
262
        ZoologicalName newName = TaxonNameFactory.NewZoologicalInstance(Rank.SPECIES());
263 263
        newName.setTitleCache("Newby taxonEditor", true);
264 264
        UUID uuid = nameService.saveOrUpdate(newName);
265 265
        commitAndStartNewTransaction(null);
cdmlib-services/src/test/java/eu/etaxonomy/cdm/test/function/TestService.java
63 63
		NonViralName<?> nvn = TaxonNameFactory.NewNonViralInstance(Rank.SPECIES());
64 64

  
65 65
		BotanicalName bn = TaxonNameBase.NewBotanicalInstance(Rank.SUBSPECIES());
66
		ZoologicalName zn = TaxonNameBase.NewZoologicalInstance(Rank.FAMILY());
66
		ZoologicalName zn = TaxonNameFactory.NewZoologicalInstance(Rank.FAMILY());
67 67

  
68 68
		logger.info("Create reference objects...");
69 69

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)