Revision 90046bc4
Added by Andreas Müller almost 8 years ago
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/name/TaxonNameBaseTest.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
18 | 18 |
import static org.junit.Assert.assertTrue; |
19 | 19 |
|
20 | 20 |
import java.util.Map; |
21 |
|
|
21 | 22 |
import org.apache.log4j.Logger; |
22 | 23 |
import org.junit.Before; |
23 | 24 |
import org.junit.BeforeClass; |
... | ... | |
46 | 47 |
|
47 | 48 |
private TaxonNameBaseTestClass nameBase1; |
48 | 49 |
private TaxonNameBaseTestClass nameBase2; |
49 |
|
|
50 |
|
|
50 | 51 |
@BeforeClass |
51 | 52 |
public static void setUpBeforeClass() { |
52 | 53 |
DefaultTermInitializer vocabularyStore = new DefaultTermInitializer(); |
... | ... | |
62 | 63 |
nameBase2 = new TaxonNameBaseTestClass(Rank.GENUS()); |
63 | 64 |
} |
64 | 65 |
|
65 |
|
|
66 |
|
|
66 | 67 |
private class TaxonNameBaseTestClass extends TaxonNameBase<TaxonNameBaseTestClass, INameCacheStrategy<TaxonNameBaseTestClass>>{ |
67 | 68 |
public TaxonNameBaseTestClass(){super();}; |
68 | 69 |
public TaxonNameBaseTestClass(Rank rank){super(rank);}; |
... | ... | |
86 | 87 |
protected Map<String, java.lang.reflect.Field> getAllFields() { |
87 | 88 |
return null; |
88 | 89 |
} |
89 |
|
|
90 |
|
|
90 | 91 |
} |
91 | 92 |
|
92 |
|
|
93 |
|
|
93 | 94 |
/** ************************* TESTS ******************************************************/ |
94 |
|
|
95 |
|
|
95 | 96 |
|
96 | 97 |
@Test |
97 | 98 |
public void testGenerateFullTitle() { |
98 | 99 |
//abstract |
99 | 100 |
} |
100 |
|
|
101 |
|
|
101 | 102 |
/** |
102 | 103 |
* Test method for {@link eu.etaxonomy.cdm.model.name.TaxonNameBase#TaxonNameBase()}. |
103 | 104 |
*/ |
... | ... | |
115 | 116 |
assertEquals(Rank.GENUS(), nameBase2.getRank()); |
116 | 117 |
Rank rank = null; |
117 | 118 |
TaxonNameBase testName = new TaxonNameBaseTestClass(rank); |
118 |
assertNull(testName.getRank());
|
|
119 |
assertNull(testName.getRank()); |
|
119 | 120 |
} |
120 | 121 |
|
121 | 122 |
/** |
... | ... | |
141 | 142 |
TaxonNameBase testHG = new TaxonNameBaseTestClass(rank, hg); |
142 | 143 |
assertSame(rank, testHG.getRank()); |
143 | 144 |
assertSame(hg, testHG.getHomotypicalGroup()); |
144 |
|
|
145 |
|
|
145 | 146 |
Rank rankNull = null; |
146 | 147 |
HomotypicalGroup hgNull = null; |
147 | 148 |
TaxonNameBase testHGNull = new TaxonNameBaseTestClass(rankNull, hgNull); |
... | ... | |
250 | 251 |
nameBase1.removeStatus(nomStatus2); |
251 | 252 |
assertEquals(0, nameBase1.getStatus().size()); |
252 | 253 |
assertFalse(nameBase1.getStatus().contains(nomStatus2)); |
253 |
|
|
254 |
|
|
254 |
|
|
255 |
|
|
255 | 256 |
} |
256 | 257 |
|
257 | 258 |
/** |
... | ... | |
270 | 271 |
TaxonNameBase name1 = BotanicalName.NewInstance(null); |
271 | 272 |
TaxonNameBase basionym1 = BotanicalName.NewInstance(null); |
272 | 273 |
TaxonNameBase basionym2 = BotanicalName.NewInstance(null); |
273 |
|
|
274 |
assertEquals(null, name1.getBasionym());
|
|
274 |
|
|
275 |
assertEquals(null, name1.getBasionym()); |
|
275 | 276 |
name1.addBasionym(basionym1); |
276 | 277 |
assertEquals(basionym1, name1.getBasionym()); |
277 | 278 |
name1.addBasionym(basionym2); |
278 | 279 |
TaxonNameBase oneOfThebasionyms = name1.getBasionym(); |
279 | 280 |
assertTrue(oneOfThebasionyms == basionym1 || oneOfThebasionyms == basionym2 ); |
280 | 281 |
name1.removeBasionyms(); |
281 |
assertEquals(null, name1.getBasionym());
|
|
282 |
assertEquals(null, name1.getBasionym()); |
|
282 | 283 |
} |
283 | 284 |
|
284 | 285 |
/** |
... | ... | |
330 | 331 |
assertNotNull("Rank shall not be null", name1.getRank()); |
331 | 332 |
name1.setRank(null); |
332 | 333 |
assertNull("Rank shall be null", name1.getRank()); |
333 |
|
|
334 |
|
|
334 | 335 |
} |
335 | 336 |
|
336 | 337 |
/** |
... | ... | |
338 | 339 |
*/ |
339 | 340 |
@Test |
340 | 341 |
public void testGetSetNomenclaturalReference() { |
341 |
INomenclaturalReference nr = (INomenclaturalReference) nameBase1.getNomenclaturalReference();
|
|
342 |
INomenclaturalReference nr = nameBase1.getNomenclaturalReference(); |
|
342 | 343 |
assertNull("Nomenclatural Reference shall be null", nr); |
343 | 344 |
nameBase1.setNomenclaturalReference(ReferenceFactory.newGeneric()); |
344 |
nr = (INomenclaturalReference) nameBase1.getNomenclaturalReference();
|
|
345 |
nr = nameBase1.getNomenclaturalReference(); |
|
345 | 346 |
assertNotNull("Nomenclatural Reference shall not be null", nr); |
346 | 347 |
} |
347 | 348 |
|
... | ... | |
520 | 521 |
*/ |
521 | 522 |
@Test |
522 | 523 |
public void testAddTaxonBase() { |
523 |
Taxon taxon = Taxon.NewInstance(null, null);
|
|
524 |
Taxon taxon = Taxon.NewInstance(null, null); |
|
524 | 525 |
nameBase2.addTaxonBase(taxon); //test if reflection method addTaxonBase() works |
525 | 526 |
assertTrue("The taxon has not properly been added to the taxonName", nameBase2.getTaxonBases().contains(taxon)); |
526 | 527 |
assertEquals("The taxon name has not properly been added to the taxon", nameBase2, taxon.getName()); |
... | ... | |
528 | 529 |
assertFalse("The taxon has not properly been removed from the taxon name", nameBase2.getTaxonBases().contains(taxon)); |
529 | 530 |
assertEquals("The taxon name has not properly been removed from the taxon", null, taxon.getName()); |
530 | 531 |
} |
531 |
|
|
532 |
|
|
532 |
|
|
533 |
|
|
533 | 534 |
@Test |
534 | 535 |
public void testAddAndRemoveDescriptionTaxonNameDescription() { |
535 | 536 |
TaxonNameDescription description = TaxonNameDescription.NewInstance(); |
... | ... | |
556 | 557 |
public void testGetSynonyms() { |
557 | 558 |
logger.warn("not yet implemented"); |
558 | 559 |
} |
559 |
|
|
560 |
|
|
560 | 561 |
@Test |
561 | 562 |
public void testMergeHomotypicGroups() { |
562 | 563 |
TaxonNameBase<?,?> name1 = BotanicalName.NewInstance(null); |
563 | 564 |
TaxonNameBase<?,?> name2 = BotanicalName.NewInstance(null); |
564 | 565 |
TaxonNameBase<?,?> name3 = BotanicalName.NewInstance(null); |
565 | 566 |
TaxonNameBase<?,?> name4 = BotanicalName.NewInstance(null); |
566 |
|
|
567 |
|
|
567 | 568 |
assertFalse(name1.getHomotypicalGroup().equals(name2.getHomotypicalGroup())); |
568 | 569 |
int numberOfTypifiedNames = name1.getHomotypicalGroup().getTypifiedNames().size(); |
569 | 570 |
assertEquals(1, numberOfTypifiedNames); |
570 |
|
|
571 |
|
|
571 | 572 |
name1.mergeHomotypicGroups(name2); |
572 | 573 |
assertEquals(name1.getHomotypicalGroup(), name2.getHomotypicalGroup()); |
573 | 574 |
assertSame(name1.getHomotypicalGroup(), name2.getHomotypicalGroup()); |
... | ... | |
594 | 595 |
assertTrue(name2.getHomotypicalGroup().getTypifiedNames().contains(name3)); |
595 | 596 |
assertTrue(name3.getHomotypicalGroup().getTypifiedNames().contains(name2)); |
596 | 597 |
|
597 |
|
|
598 |
|
|
598 | 599 |
} |
599 |
|
|
600 |
|
|
600 |
|
|
601 |
|
|
601 | 602 |
@Test |
602 | 603 |
public void testIsBasionymFor() { |
603 | 604 |
TaxonNameBase name1 = BotanicalName.NewInstance(null); |
604 | 605 |
TaxonNameBase name2 = BotanicalName.NewInstance(null); |
605 | 606 |
TaxonNameBase<?,?> name3 = BotanicalName.NewInstance(null); |
606 | 607 |
TaxonNameBase<?,?> name4 = BotanicalName.NewInstance(null); |
607 |
|
|
608 |
|
|
608 | 609 |
assertFalse(name2.isBasionymFor(name1)); |
609 | 610 |
assertFalse(name1.isBasionymFor(name2)); |
610 | 611 |
name1.addBasionym(name2); |
... | ... | |
623 | 624 |
TaxonNameBase<?,?> name4 = BotanicalName.NewInstance(null); |
624 | 625 |
name1.mergeHomotypicGroups(name2); |
625 | 626 |
name2.mergeHomotypicGroups(name4); |
626 |
|
|
627 |
|
|
627 | 628 |
assertTrue(name1.isHomotypic(name4)); |
628 | 629 |
assertTrue(name4.isHomotypic(name1)); |
629 | 630 |
assertFalse(name1.isHomotypic(name3)); |
630 | 631 |
assertFalse(name3.isHomotypic(name1)); |
631 | 632 |
assertTrue(name2.isHomotypic(name1)); |
632 |
|
|
633 |
|
|
633 | 634 |
} |
634 | 635 |
|
635 | 636 |
@Test |
... | ... | |
638 | 639 |
TaxonNameBase<?,?> name2 = BotanicalName.NewInstance(null); |
639 | 640 |
TaxonNameBase<?,?> name3 = BotanicalName.NewInstance(null); |
640 | 641 |
TaxonNameBase<?,?> name4 = BotanicalName.NewInstance(null); |
641 |
|
|
642 |
|
|
642 | 643 |
name1.mergeHomotypicGroups(name2); |
643 | 644 |
name1.mergeHomotypicGroups(name3); |
644 | 645 |
name2.mergeHomotypicGroups(name4); |
645 |
|
|
646 |
|
|
646 | 647 |
name1.makeGroupsBasionym(); |
647 |
|
|
648 |
|
|
648 | 649 |
assertEquals(1, name2.getBasionyms().size()); |
649 | 650 |
assertEquals(1, name3.getBasionyms().size()); |
650 | 651 |
assertEquals(1, name4.getBasionyms().size()); |
651 | 652 |
assertEquals(name1, name4.getBasionym()); |
652 |
|
|
653 |
|
|
653 | 654 |
} |
654 |
|
|
655 |
|
|
655 | 656 |
@Test |
656 | 657 |
public void testIsGroupsBasionym(){ |
657 | 658 |
TaxonNameBase<?,?> name1 = BotanicalName.NewInstance(null); |
658 | 659 |
TaxonNameBase<?,?> name2 = BotanicalName.NewInstance(null); |
659 | 660 |
TaxonNameBase<?,?> name3 = BotanicalName.NewInstance(null); |
660 | 661 |
TaxonNameBase<?,?> name4 = BotanicalName.NewInstance(null); |
661 |
|
|
662 |
|
|
662 | 663 |
assertFalse(name1.isGroupsBasionym()); |
663 |
|
|
664 |
|
|
664 | 665 |
name1.mergeHomotypicGroups(name2); |
665 | 666 |
name2.mergeHomotypicGroups(name4); |
666 |
|
|
667 |
|
|
667 | 668 |
name1.makeGroupsBasionym(); |
668 |
|
|
669 |
|
|
669 | 670 |
assertTrue(name1.isGroupsBasionym()); |
670 | 671 |
assertFalse(name2.isGroupsBasionym()); |
671 | 672 |
name1.mergeHomotypicGroups(name3); |
672 |
assertFalse(name1.isGroupsBasionym());
|
|
673 |
assertFalse(name1.isGroupsBasionym()); |
|
673 | 674 |
} |
674 |
|
|
675 |
|
|
676 |
|
|
675 |
|
|
676 |
|
|
677 |
|
|
677 | 678 |
@Test |
678 | 679 |
public void testRemoveBasionyms(){ |
679 | 680 |
TaxonNameBase name1 = BotanicalName.NewInstance(null); |
680 | 681 |
TaxonNameBase basionym = BotanicalName.NewInstance(null); |
681 | 682 |
TaxonNameBase name3 = BotanicalName.NewInstance(null); |
682 |
|
|
683 |
|
|
683 | 684 |
name1.addBasionym(basionym); |
684 | 685 |
assertEquals(1, name1.getBasionyms().size()); |
685 | 686 |
name1.addBasionym(name3); |
686 | 687 |
assertEquals(2, name1.getBasionyms().size()); |
687 | 688 |
name1.removeBasionyms(); |
688 |
assertEquals(0, name1.getBasionyms().size());
|
|
689 |
assertEquals(0, name1.getBasionyms().size()); |
|
689 | 690 |
} |
690 | 691 |
|
691 | 692 |
/** |
... | ... | |
702 | 703 |
nameBase1.setRank(null); |
703 | 704 |
assertFalse(nameBase1.isSupraGeneric()); |
704 | 705 |
} |
705 |
|
|
706 |
|
|
706 | 707 |
@Test |
707 | 708 |
public void testRemoveTaxonBases(){ |
708 |
|
|
709 |
|
|
709 | 710 |
Taxon newTaxon = new Taxon(nameBase1, null); |
710 | 711 |
assertEquals(1, nameBase1.getTaxonBases().size()); |
711 |
|
|
712 |
|
|
712 |
|
|
713 |
|
|
713 | 714 |
nameBase1.removeTaxonBase(newTaxon); |
714 | 715 |
assertEquals(0, nameBase1.getTaxonBases().size()); |
715 |
|
|
716 |
|
|
716 | 717 |
} |
717 | 718 |
/** |
718 | 719 |
* Test method for {@link eu.etaxonomy.cdm.model.name.TaxonNameBase#isGenus()}. |
... | ... | |
797 | 798 |
public void testGetNomenclaturalCode() { |
798 | 799 |
//is abstract |
799 | 800 |
} |
800 |
|
|
801 |
|
|
801 |
|
|
802 |
|
|
802 | 803 |
//descriptions, fullTitleCache, homotypicalGroup, |
803 | 804 |
|
804 |
//no changes to: appendedPharse, nomenclaturalReference,
|
|
805 |
//no changes to: appendedPharse, nomenclaturalReference, |
|
805 | 806 |
//nomenclaturalMicroReference, parsingProblem, problemEnds, problemStarts |
806 | 807 |
//protectedFullTitleCache |
807 |
|
|
808 |
|
|
808 | 809 |
@Test |
809 | 810 |
public void testClone(){ |
810 | 811 |
NonViralName taxonNameBase1 = NonViralName.NewInstance(Rank.SPECIES()); |
811 | 812 |
NonViralName<?> genusName = NonViralName.NewInstance(Rank.GENUS()); |
812 | 813 |
Taxon taxonBase = Taxon.NewInstance(taxonNameBase1, null); |
813 |
|
|
814 |
|
|
814 | 815 |
//basionym & homonym |
815 | 816 |
NonViralName<?> basionym = NonViralName.NewInstance(Rank.SPECIES()); |
816 | 817 |
NonViralName<?> earlierHomonym = NonViralName.NewInstance(Rank.SPECIES()); |
817 | 818 |
taxonNameBase1.addBasionym(basionym); |
818 | 819 |
taxonNameBase1.addRelationshipToName(earlierHomonym, NameRelationshipType.LATER_HOMONYM(), "later homonym rule"); |
819 | 820 |
//status |
820 |
Reference<?> statusReference = ReferenceFactory.newArticle();
|
|
821 |
Reference statusReference = ReferenceFactory.newArticle(); |
|
821 | 822 |
NomenclaturalStatus nomStatus = NomenclaturalStatus.NewInstance(NomenclaturalStatusType.CONSERVED(), statusReference, "55"); |
822 | 823 |
taxonNameBase1.addStatus(nomStatus); |
823 | 824 |
//typeDesignation |
824 | 825 |
DerivedUnit typeSpecimen = DerivedUnit.NewPreservedSpecimenInstance(); |
825 |
Reference<?> specimenTypeCitation = ReferenceFactory.newArticle();
|
|
826 |
Reference<?> nameTypeCitation = ReferenceFactory.newArticle();
|
|
826 |
Reference specimenTypeCitation = ReferenceFactory.newArticle(); |
|
827 |
Reference nameTypeCitation = ReferenceFactory.newArticle(); |
|
827 | 828 |
SpecimenTypeDesignation specimenTypeDesignationOriginal = taxonNameBase1.addSpecimenTypeDesignation(typeSpecimen, SpecimenTypeDesignationStatus.HOLOTYPE(), specimenTypeCitation, null, null, false, false); |
828 | 829 |
NameTypeDesignation nameTypeDesignationOriginal = genusName.addNameTypeDesignation(taxonNameBase1, nameTypeCitation, null, null, NameTypeDesignationStatus.LECTOTYPE(), true, false, false, false); |
829 | 830 |
|
... | ... | |
834 | 835 |
Media media = Media.NewInstance(); |
835 | 836 |
textData.addMedia(media); |
836 | 837 |
description.addElement(textData); |
837 |
|
|
838 |
|
|
838 | 839 |
//CLONE |
839 | 840 |
TaxonNameBase<?,?> clone = (TaxonNameBase)taxonNameBase1.clone(); |
840 | 841 |
TaxonNameBase<?,?> genusClone = (TaxonNameBase)genusName.clone(); |
... | ... | |
845 | 846 |
//TODO still needs to be discussed |
846 | 847 |
// assertSame("The clone must have the same homotypical group as the original", taxonNameBase1.getHomotypicalGroup(), clone.getHomotypicalGroup()); |
847 | 848 |
// assertSame("The genusClone must have the same homotypical group as the original genus", genusName.getHomotypicalGroup(), genusClone.getHomotypicalGroup()); |
848 |
|
|
849 |
|
|
849 | 850 |
//description |
850 | 851 |
assertEquals("There should be exactly 1 name description", 1, clone.getDescriptions().size()); |
851 |
TaxonNameDescription descriptionClone = (TaxonNameDescription)clone.getDescriptions().iterator().next();
|
|
852 |
TaxonNameDescription descriptionClone = clone.getDescriptions().iterator().next(); |
|
852 | 853 |
assertEquals("There should be exactly 1 description element", 1, descriptionClone.getElements().size()); |
853 | 854 |
TextData textDataClone = (TextData)descriptionClone.getElements().iterator().next(); |
854 | 855 |
String text = textDataClone.getText(Language.DEFAULT()); |
... | ... | |
856 | 857 |
assertEquals("There should be exactly 1 media attached", 1, textDataClone.getMedia().size()); |
857 | 858 |
Media mediaClone = textDataClone.getMedia().get(0); |
858 | 859 |
assertSame("Media must be the same", media, mediaClone); |
859 |
|
|
860 |
|
|
860 | 861 |
//type designation |
861 | 862 |
assertEquals("There should be exactly 1 specimen type designation", 1, clone.getTypeDesignations().size()); |
862 | 863 |
assertNotSame("type designation sets should not be the same", taxonNameBase1.getTypeDesignations(), clone.getTypeDesignations()); |
... | ... | |
867 | 868 |
assertEquals("The specimen type designation must have exactly 1 typified name which is 'clone'", 1, specimenTypeDesignationClone.getTypifiedNames().size()); |
868 | 869 |
assertTrue("The specimen type designation must have 'clone' as typified name", specimenTypeDesignationClone.getTypifiedNames().contains(clone)); |
869 | 870 |
// assertSame("The specimen type designation must have the same homotypical group as the typified name", specimenTypeDesignationClone.getHomotypicalGroup(), clone.getHomotypicalGroup()); |
870 |
|
|
871 |
|
|
871 | 872 |
assertEquals("There should be exactly 1 name type designation", 1, genusClone.getTypeDesignations().size()); |
872 | 873 |
assertNotSame("type designation sets should not be the same", genusName.getTypeDesignations(), genusClone.getTypeDesignations()); |
873 | 874 |
NameTypeDesignation nameTypeDesignationClone = (NameTypeDesignation)genusClone.getTypeDesignations().iterator().next(); |
... | ... | |
877 | 878 |
assertEquals("The name type designation must have exactly 1 typified name which is 'genusClone'", 1, nameTypeDesignationClone.getTypifiedNames().size()); |
878 | 879 |
assertTrue("The name type designation must have 'genusClone' as typified name", nameTypeDesignationClone.getTypifiedNames().contains(genusClone)); |
879 | 880 |
// assertSame("The name type designation must have the same homotypical group as the typified name", nameTypeDesignationClone.getHomotypicalGroup(), genusClone.getHomotypicalGroup()); |
880 |
|
|
881 |
|
|
881 | 882 |
//status |
882 | 883 |
assertEquals("There should be exactly 1 status", 1, clone.getStatus().size()); |
883 | 884 |
assertNotSame("Status sets should not be the same", taxonNameBase1.getStatus(), clone.getStatus()); |
884 |
NomenclaturalStatus cloneStatus = (NomenclaturalStatus)clone.getStatus().iterator().next();
|
|
885 |
NomenclaturalStatus cloneStatus = clone.getStatus().iterator().next(); |
|
885 | 886 |
assertSame("The type of the nomStatus needs to be the same", nomStatus.getType(), cloneStatus.getType()); |
886 | 887 |
assertSame("The citation of the nomStatus needs to be the same", nomStatus.getCitation(), cloneStatus.getCitation()); |
887 | 888 |
assertSame("The rule considered of the nomStatus needs to be the same", nomStatus.getRuleConsidered(), cloneStatus.getRuleConsidered()); |
888 | 889 |
//DISCUSS: do we want to reuse the status |
889 | 890 |
// assertSame("The nomStatus needs to be the same", nomStatus, cloneStatus); |
890 |
|
|
891 |
|
|
892 |
// //hybrid parents of clone
|
|
891 |
|
|
892 |
|
|
893 |
// //hybrid parents of clone |
|
893 | 894 |
// assertEquals("There should be exactly 2 hybrid relationships in which the clone takes the child role", 2, clone.getChildRelationships().size()); |
894 | 895 |
// Set<NonViralName> parentSet = new HashSet<NonViralName>(); |
895 | 896 |
// Set<NonViralName> childSet = new HashSet<NonViralName>(); |
... | ... | |
903 | 904 |
// assertTrue("Parent set should contain parent1", parentSet.contains(parent)); |
904 | 905 |
// assertTrue("Parent set should contain parent2", parentSet.contains(parent2)); |
905 | 906 |
// assertTrue("Child set should contain clone", childSet.contains(clone)); |
906 |
|
|
907 |
|
|
907 | 908 |
//basionym of clone |
908 | 909 |
assertEquals("There should be exactly 1 relationship in which the clone takes the to role", 1, clone.getRelationsToThisName().size()); |
909 |
NameRelationship nameRelation = (NameRelationship)clone.getRelationsToThisName().iterator().next();
|
|
910 |
NameRelationship nameRelation = clone.getRelationsToThisName().iterator().next(); |
|
910 | 911 |
assertSame("Basionym should be from-object in relationship", basionym, nameRelation.getRelatedFrom()); |
911 | 912 |
assertSame("Clone should be to-object in relationship", clone, nameRelation.getRelatedTo()); |
912 | 913 |
assertSame("Relationship type should be cloned correctly", NameRelationshipType.BASIONYM(), nameRelation.getType()); |
913 | 914 |
// assertEquals("Rule should be cloned correctly", "later homonym rule", nameRelation.getRuleConsidered()); |
914 | 915 |
|
915 |
|
|
916 |
|
|
916 | 917 |
//homonym of clone |
917 | 918 |
assertEquals("There should be exactly 1 relationship in which the clone takes the from role", 1, clone.getRelationsFromThisName().size()); |
918 |
nameRelation = (NameRelationship)clone.getRelationsFromThisName().iterator().next();
|
|
919 |
nameRelation = clone.getRelationsFromThisName().iterator().next(); |
|
919 | 920 |
assertSame("Clone should be from-object in relationship", clone, nameRelation.getRelatedFrom()); |
920 | 921 |
assertSame("Homonym should be to-object in relationship", earlierHomonym, nameRelation.getRelatedTo()); |
921 | 922 |
assertSame("Relationship type should be cloned correctly", NameRelationshipType.LATER_HOMONYM(), nameRelation.getType()); |
922 | 923 |
assertEquals("Rule should be cloned correctly", "later homonym rule", nameRelation.getRuleConsidered()); |
923 | 924 |
} |
924 |
|
|
925 |
|
|
925 | 926 |
} |
Also available in: Unified diff
Remove generics from Reference in cdmlib-model #5830