references and microreferences for name relations
authorAndreas Müller <a.mueller@bgbm.org>
Wed, 20 May 2009 10:12:44 +0000 (10:12 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Wed, 20 May 2009 10:12:44 +0000 (10:12 +0000)
specimenTest fix

cdmlib-model/src/main/java/eu/etaxonomy/cdm/datagenerator/TaxonGenerator.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonNameBase.java
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/occurrence/SpecimenTest.java

index b33fc05e9c8ce6580d28310a4adab8502dfb2697..2de18aca76006c7d989bafc6944fdc79e723dd52 100644 (file)
@@ -45,7 +45,7 @@ public class TaxonGenerator {
         basionym.setTitleCache("Hieracilla DC."); 
         basionym.setGenusOrUninomial("Hieracilla"); 
         basionym.setCombinationAuthorTeam(deCandolle); 
-        botName.addBasionym(basionym, "216");
+        botName.addBasionym(basionym, null, null, "216");
         
         //species taxon that is the child of genus taxon
         BotanicalName botSpecies = BotanicalName.NewInstance(Rank.SPECIES()); 
index 94b8169b4b5839eede3d1af3bf98022e8ce90cc5..035707ebb385047d627a779e3e249ee86d02d486 100644 (file)
@@ -340,6 +340,11 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
        public void addRelationshipToName(TaxonNameBase toName, NameRelationshipType type, String ruleConsidered){
                NameRelationship rel = new NameRelationship(toName, this, type, ruleConsidered);
        }
+       
+       public void addRelationshipToName(TaxonNameBase toName, NameRelationshipType type, ReferenceBase citation, String microCitation, String ruleConsidered){
+               NameRelationship rel = new NameRelationship(toName, this, type, citation, microCitation, ruleConsidered);
+       }
+       
        /**
         * Creates a new {@link NameRelationship#NameRelationship(TaxonNameBase, TaxonNameBase, NameRelationshipType, String) name relationship} from another taxon name to <i>this</i> taxon name
         * and adds it both to the set of {@link #getRelationsToThisName() relations to <i>this</i> taxon name} and
@@ -356,6 +361,10 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
        public void addRelationshipFromName(TaxonNameBase fromName, NameRelationshipType type, String ruleConsidered){
                NameRelationship rel = new NameRelationship(this, fromName, type, ruleConsidered);
        }
+       public void addRelationshipFromName(TaxonNameBase fromName, NameRelationshipType type, ReferenceBase citation, String microCitation, String ruleConsidered){
+               NameRelationship rel = new NameRelationship(this, fromName, type, citation, microCitation, ruleConsidered);
+       }
+
        /**
         * Adds an existing {@link NameRelationship name relationship} either to the set of
         * {@link #getRelationsToThisName() relations to <i>this</i> taxon name} or to the set of
@@ -571,7 +580,7 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
         * @see                                 #addBasionym(TaxonNameBase, String)
         */
        public void addBasionym(T basionym){
-               addBasionym(basionym, null);
+               addBasionym(basionym, null, null, null);
        }
        /**
         * Assigns a taxon name as {@link NameRelationshipType#BASIONYM() basionym} of <i>this</i> taxon name
@@ -586,9 +595,9 @@ public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INam
         * @see                                         #getBasionym()
         * @see                                         #addBasionym(TaxonNameBase)
         */
-       public void addBasionym(T basionym, String ruleConsidered){
+       public void addBasionym(T basionym, ReferenceBase citation, String microcitation, String ruleConsidered){
                if (basionym != null){
-                       basionym.addRelationshipToName(this, NameRelationshipType.BASIONYM(), ruleConsidered);
+                       basionym.addRelationshipToName(this, NameRelationshipType.BASIONYM(), citation, microcitation, ruleConsidered);
                }
        }
        
index 841bef1a6caf1b7fbf2c87d21e55e5e371b5f369..a70560cddc0268d447a8575ad1454c1b35293f4c 100644 (file)
@@ -175,7 +175,11 @@ public class SpecimenTest {
                specimen.addRights(right);\r
                specimen.addSource(source);\r
 \r
-               \r
+               try {\r
+                       Thread.sleep(200);\r
+               } catch (InterruptedException e) {\r
+                       //ignore\r
+               }\r
                Specimen specimenClone = (Specimen)specimen.clone();\r
                \r
                assertFalse(id == specimenClone.getId());\r