cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Thu, 10 Jun 2021 11:20:17 +0000 (13:20 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Fri, 25 Jun 2021 08:21:34 +0000 (10:21 +0200)
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/agent/INomenclaturalAuthorCacheStrategy.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/agent/TeamDefaultCacheStrategy.java
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/agent/PersonDefaultCacheStrategyTest.java
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/agent/TeamDefaultCacheStrategyTest.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/data/FullCoverageDataGenerator.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v30_40/SchemaUpdater_34_341.java

index cba9e78382f421ec9cbd3cf5c36a6983edbff922..beb6f300c1081dbd6423a2b37fac9cfc1a31ad70 100644 (file)
@@ -31,10 +31,10 @@ public interface INomenclaturalAuthorCacheStrategy<T extends TeamOrPersonBase>
      * NOTE: This is formatting used for {@link #getTitleCache(eu.etaxonomy.cdm.model.common.IIdentifiableEntity)}\r
      * prior to CDM version 4.7\r
      *\r
-     * @param object\r
+     * @param agent\r
      * @return\r
      */\r
-    public String getFullTitle(T object);\r
+    public String getFullTitle(T agent);\r
 \r
     public String getFamilyTitle(T agent);\r
 \r
index fed10f1406390adc854ca5942ae3e6c6183d2224..129581a8b34196bef44aa8e07c789a8d160dabbd 100644 (file)
@@ -22,6 +22,7 @@ import eu.etaxonomy.cdm.strategy.StrategyBase;
  * @author AM
  */
 public class TeamDefaultCacheStrategy extends StrategyBase implements INomenclaturalAuthorCacheStrategy<Team> {
+
     private static final long serialVersionUID = 8375295443642690479L;
     @SuppressWarnings("unused")
     private static final Logger logger = Logger.getLogger(TeamDefaultCacheStrategy.class);
@@ -212,4 +213,5 @@ public class TeamDefaultCacheStrategy extends StrategyBase implements INomenclat
     public static String addHasMoreMembers(String str) {
         return str + ET_AL_TEAM_CONCATINATION_ABBREV + "al.";
     }
+
 }
\ No newline at end of file
index a4577959794a38f10b68b2228a8ef510151349ef..e7a7f9302fd99fec75f0f2d4a94c3ca03f16b3d4 100644 (file)
@@ -35,15 +35,15 @@ public class PersonDefaultCacheStrategyTest {
        public void setUp() throws Exception {\r
                person1 = Person.NewInstance();\r
 \r
-               person1.setGivenName("P1FN");\r
-               person1.setFamilyName("P1LN");\r
+               person1.setGivenName("P1GN");\r
+               person1.setFamilyName("P1FN");\r
                person1.setPrefix("Dr1.");\r
                person1.setSuffix("Suff1");\r
 \r
                person2 = Person.NewInstance();\r
                person2.setNomenclaturalTitle("P2NomT");\r
-               person2.setFamilyName("P2LN");\r
-               person2.setGivenName("P2FN");\r
+               person2.setFamilyName("P2FN");\r
+               person2.setGivenName("P2GN");\r
                person2.setSuffix("P2Suff");\r
 \r
                person3 = Person.NewInstance(); //empty person\r
@@ -60,9 +60,9 @@ public class PersonDefaultCacheStrategyTest {
        @Test\r
        public final void testGetNomenclaturalTitleCache(){\r
                Assert.assertNotNull("person1 nomenclatural title must not to be null", person1.getNomenclaturalTitle());\r
-               Assert.assertEquals("Person1 nomenclatural title should be taken from titleCache", "P1LN, P.", person1.getNomenclaturalTitle());\r
+               Assert.assertEquals("Person1 nomenclatural title should be taken from titleCache", "P1FN, P.", person1.getNomenclaturalTitle());\r
                person1.setSuffix(null);\r
-               Assert.assertEquals("Person1 title should be taken from titleCache", "P1LN, P.", person1.getNomenclaturalTitle());\r
+               Assert.assertEquals("Person1 title should be taken from titleCache", "P1FN, P.", person1.getNomenclaturalTitle());\r
                //peson2\r
                Assert.assertEquals("Person2 title should be P2NomT", "P2NomT", person2.getNomenclaturalTitle());\r
                //person3\r
@@ -75,11 +75,11 @@ public class PersonDefaultCacheStrategyTest {
        @Test\r
        public final void testGetTitleCacheAdaptedFromOldVersion(){\r
            Assert.assertNotNull("person1 title cache must not to be null", person1.getTitleCache());\r
-               Assert.assertEquals("Person1 title cache should be created by familyname and computed initials", "P1LN, P.", person1.getTitleCache());\r
+               Assert.assertEquals("Person1 title cache should be created by familyname and computed initials", "P1FN, P.", person1.getTitleCache());\r
                person1.setSuffix(null);\r
-               Assert.assertEquals("Person1 title cache should be Dr1. P1FN P1LN", "P1LN, P.", person1.getTitleCache());\r
+               Assert.assertEquals("Person1 title cache should be Dr1. P1GN P1FN", "P1FN, P.", person1.getTitleCache());\r
                //peson2\r
-               Assert.assertEquals("Person2 title cache should be P2NomT", "P2LN, P.", person2.getTitleCache());\r
+               Assert.assertEquals("Person2 title cache should be P2NomT", "P2FN, P.", person2.getTitleCache());\r
                //person3\r
                Assert.assertNotNull("person3 title cache must not to be null", person3.getTitleCache());\r
                Assert.assertTrue("Person3 title cache must not be empty", StringUtils.isNotBlank(person3.getTitleCache()));\r
@@ -121,13 +121,13 @@ public class PersonDefaultCacheStrategyTest {
     public final void testGetFullTitle(){\r
         Assert.assertNotNull("person1 full titlemust not to be null", person1.getFullTitle());\r
         Assert.assertEquals("Person1 full title should be created by elements",\r
-                "Dr1. P1FN P1LN Suff1", person1.getFullTitle());\r
+                "Dr1. P1GN P1FN Suff1", person1.getFullTitle());\r
         person1.setSuffix(null);\r
-        Assert.assertEquals("Person1 full title should be Dr1. P1FN P1LN",\r
-                "Dr1. P1FN P1LN", person1.getFullTitle());\r
+        Assert.assertEquals("Person1 full title should be Dr1. P1GN P1FN",\r
+                "Dr1. P1GN P1FN", person1.getFullTitle());\r
         //peson2\r
         Assert.assertEquals("Person2 full title should be P2NomT",\r
-                "P2FN P2LN P2Suff", person2.getFullTitle());\r
+                "P2GN P2FN P2Suff", person2.getFullTitle());\r
         //person3\r
         Assert.assertNotNull("person3 full title must not to be null",\r
                 person3.getFullTitle());\r
index bfb92b570e755aac941097a30e2d91a5c1b4478b..db035dcee9b6e6272c40eb6f68d8dd636a2e4591 100644 (file)
@@ -45,15 +45,15 @@ public class TeamDefaultCacheStrategyTest {
 
                person1 = Person.NewInstance();
 
-               person1.setGivenName("P1FN");
-               person1.setFamilyName("P1LN");
+               person1.setGivenName("P1GN");
+               person1.setFamilyName("P1FN");
                person1.setPrefix("Dr1.");
                person1.setSuffix("Suff1");
 
                person2 = Person.NewInstance();
                person2.setNomenclaturalTitle("P2NomT");
-               person2.setFamilyName("P2LN");
-               person2.setGivenName("P2FN");
+               person2.setFamilyName("P2FN");
+               person2.setGivenName("P2GN");
                person2.setSuffix("P2Suff");
 
                person3 = Person.NewInstance();
@@ -61,7 +61,7 @@ public class TeamDefaultCacheStrategyTest {
 
            person4 = Person.NewInstance();
            person4.setNomenclaturalTitle("P4NomT");
-           person4.setFamilyName("P4LN");
+           person4.setFamilyName("P4FN");
 
                team1.addTeamMember(person1);
 
@@ -84,29 +84,29 @@ public class TeamDefaultCacheStrategyTest {
                Assert.assertNotNull("team1 nomenclatural title must not to be null",
                        team1.getNomenclaturalTitle());
                Assert.assertEquals("team1 nomenclatural title should be created by elements",
-                       "P1LN, P.", team1.getNomenclaturalTitle());
+                       "P1FN, P.", team1.getNomenclaturalTitle());
                person1.setSuffix(null);
-               Assert.assertEquals("team1 nomenclatural title should be P1LN, P.",
-                       "P1LN, P.", team1.getNomenclaturalTitle());
+               Assert.assertEquals("team1 nomenclatural title should be P1FN, P.",
+                       "P1FN, P.", team1.getNomenclaturalTitle());
 
                //team2
-               Assert.assertEquals("team2 nomenclatural title should be 'P2NomT, P1LN, P., P3NomT & P4NomT'",
-                       "P2NomT, P1LN, P., P3NomT & P4NomT", team2.getNomenclaturalTitle());
+               Assert.assertEquals("team2 nomenclatural title should be 'P2NomT, P1FN, P., P3NomT & P4NomT'",
+                       "P2NomT, P1FN, P., P3NomT & P4NomT", team2.getNomenclaturalTitle());
                //more
                team2.setHasMoreMembers(true);
-        Assert.assertEquals("team2 nomenclatural title should be 'P2NomT, P1LN, P., P3NomT, P4NomT & al.'",
-                "P2NomT, P1LN, P., P3NomT, P4NomT & al.", team2.getNomenclaturalTitle());
+        Assert.assertEquals("team2 nomenclatural title should be 'P2NomT, P1FN, P., P3NomT, P4NomT & al.'",
+                "P2NomT, P1FN, P., P3NomT, P4NomT & al.", team2.getNomenclaturalTitle());
         team2.setHasMoreMembers(false);
         //3 members
                team2.setCacheStrategy(TeamDefaultCacheStrategy.NewInstanceNomEtAl(3));
         team2.setTitleCache(null, false);
-        Assert.assertEquals("team2 nomenclatural title should still be 'P2NomT, P1LN, P. & al.' now.",
-                "P2NomT, P1LN, P. & al.", team2.getNomenclaturalTitle());
+        Assert.assertEquals("team2 nomenclatural title should still be 'P2NomT, P1FN, P. & al.' now.",
+                "P2NomT, P1FN, P. & al.", team2.getNomenclaturalTitle());
         //4 members
         team2.setCacheStrategy(TeamDefaultCacheStrategy.NewInstanceNomEtAl(4));
         team2.setTitleCache(null, false);
-        Assert.assertEquals("team2 nomenclatural title should still be 'P2NomT, P1LN, P., P3NomT & P4NomT' now.",
-                "P2NomT, P1LN, P., P3NomT & P4NomT", team2.getNomenclaturalTitle());
+        Assert.assertEquals("team2 nomenclatural title should still be 'P2NomT, P1FN, P., P3NomT & P4NomT' now.",
+                "P2NomT, P1FN, P., P3NomT & P4NomT", team2.getNomenclaturalTitle());
 
 
                //team3/empty team
@@ -124,32 +124,32 @@ public class TeamDefaultCacheStrategyTest {
                Assert.assertNotNull("team1 title cache must not to be null",
                        team1.getTitleCache());
                Assert.assertEquals("team1 title cache should be created by members titleCache",
-                       "P1LN, P.", team1.getTitleCache());
+                       "P1FN, P.", team1.getTitleCache());
                person1.setSuffix(null);
-               Assert.assertEquals("team1 title cache should be P1LN, P.",
-                       "P1LN, P.", team1.getTitleCache());
+               Assert.assertEquals("team1 title cache should be P1FN, P.",
+                       "P1FN, P.", team1.getTitleCache());
                //peson2
-               Assert.assertEquals("team2 title cache should be 'P2LN, P., P1LN, P., P3NomT & P4LN'",
-                       "P2LN, P., P1LN, P., P3NomT & P4LN", team2.getTitleCache());
+               Assert.assertEquals("team2 title cache should be 'P2FN, P., P1FN, P., P3NomT & P4FN'",
+                       "P2FN, P., P1FN, P., P3NomT & P4FN", team2.getTitleCache());
         team2.setHasMoreMembers(true);
 
-        Assert.assertEquals("team2 title cache should be 'P2LN, P., P1LN, P., P3NomT, P4LN & al.'",
-                "P2LN, P., P1LN, P., P3NomT, P4LN & al.", team2.getTitleCache());
+        Assert.assertEquals("team2 title cache should be 'P2FN, P., P1FN, P., P3NomT, P4FN & al.'",
+                "P2FN, P., P1FN, P., P3NomT, P4FN & al.", team2.getTitleCache());
         team2.setHasMoreMembers(false);
 
                team2.setCacheStrategy(TeamDefaultCacheStrategy.NewInstanceTitleEtAl(3));
                team2.setTitleCache(null, false);
-        Assert.assertEquals("team2 nomenclatural title should still be 'P2LN, P., P1LN, P. & al.' now.",
-                "P2LN, P., P1LN, P. & al.", team2.getTitleCache());
+        Assert.assertEquals("team2 nomenclatural title should still be 'P2FN, P., P1FN, P. & al.' now.",
+                "P2FN, P., P1FN, P. & al.", team2.getTitleCache());
 
         team2.setCacheStrategy(TeamDefaultCacheStrategy.NewInstanceTitleEtAl(4));
         team2.setTitleCache(null, false);
-        Assert.assertEquals("team2 nomenclatural title should still be 'P2LN, P., P1LN, P., P3NomT & P4LN' now.",
-                "P2LN, P., P1LN, P., P3NomT & P4LN", team2.getTitleCache());
+        Assert.assertEquals("team2 nomenclatural title should still be 'P2FN, P., P1FN, P., P3NomT & P4FN' now.",
+                "P2FN, P., P1FN, P., P3NomT & P4FN", team2.getTitleCache());
         team2.setHasMoreMembers(true);
         team2.setTitleCache(null, false);
-        Assert.assertEquals("team2 nomenclatural title should still be 'P2LN, P., P1LN, P., P3NomT & al.' now.",
-                "P2LN, P., P1LN, P., P3NomT & al.", team2.getTitleCache());
+        Assert.assertEquals("team2 nomenclatural title should still be 'P2FN, P., P1FN, P., P3NomT & al.' now.",
+                "P2FN, P., P1FN, P., P3NomT & al.", team2.getTitleCache());
 
 
                //person3
@@ -167,16 +167,16 @@ public class TeamDefaultCacheStrategyTest {
     public final void testFullTitle(){
         Assert.assertNotNull("team1 full title must not to be null", team1.getFullTitle());
         Assert.assertEquals("team1 full title should be created by elements",
-                "Dr1. P1FN P1LN Suff1", team1.getFullTitle());
+                "Dr1. P1GN P1FN Suff1", team1.getFullTitle());
         person1.setSuffix(null);
-        Assert.assertEquals("team1 full title should be Dr1. P1FN P1LN", "Dr1. P1FN P1LN",
+        Assert.assertEquals("team1 full title should be Dr1. P1GN P1FN", "Dr1. P1GN P1FN",
                 team1.getFullTitle());
         //team2
-        Assert.assertEquals("team2 full title should be 'P2FN P2LN P2Suff, Dr1. P1FN P1LN, P3NomT & P4LN'",
-                "P2FN P2LN P2Suff, Dr1. P1FN P1LN, P3NomT & P4LN", team2.getFullTitle());
+        Assert.assertEquals("team2 full title should be 'P2GN P2FN P2Suff, Dr1. P1GN P1FN, P3NomT & P4FN'",
+                "P2GN P2FN P2Suff, Dr1. P1GN P1FN, P3NomT & P4FN", team2.getFullTitle());
         team2.setHasMoreMembers(true);
-        Assert.assertEquals("team2 full title should be 'P2FN P2LN P2Suff, Dr1. P1FN P1LN, P3NomT, P4LN & al.'",
-                "P2FN P2LN P2Suff, Dr1. P1FN P1LN, P3NomT, P4LN & al.", team2.getFullTitle());
+        Assert.assertEquals("team2 full title should be 'P2GN P2FN P2Suff, Dr1. P1GN P1FN, P3NomT, P4FN & al.'",
+                "P2GN P2FN P2Suff, Dr1. P1GN P1FN, P3NomT, P4FN & al.", team2.getFullTitle());
 
         //team3
         Assert.assertNotNull("team3 full title must not to be null",
@@ -193,8 +193,8 @@ public class TeamDefaultCacheStrategyTest {
        public final void testListenersOnMembers(){
                Assert.assertNotNull("team1 title cache must not to be null", team1.getTitleCache());
                Assert.assertEquals("team1 title cache should be created by elements",
-                       "P1LN, P.", team1.getTitleCache());
+                       "P1FN, P.", team1.getTitleCache());
                person1.setGivenName("O.");
-               Assert.assertEquals("team1 title cache should be P1LN, O.", "P1LN, O.", team1.getTitleCache());
+               Assert.assertEquals("team1 title cache should be P1FN, O.", "P1FN, O.", team1.getTitleCache());
        }
 }
index 725d3bee826713bd1875633af9ee181c52d67783..8fed3f2a1033b046c9df6cafa780d248552fc5c5 100644 (file)
@@ -272,7 +272,6 @@ public class FullCoverageDataGenerator {
                team.addTeamMember(person);
                handleIdentifiableEntity(team);
 
-
                //Institution
                Institution institution = Institution.NewInstance();
                institution.setCode("institution code");
index 43a8a93d727fb2664669b9b091968eead8c052d5..96f67d0e659fdc5b3159921826b75e8729946c30 100644 (file)
@@ -217,7 +217,7 @@ public class SchemaUpdater_34_341 extends SchemaUpdaterBase {
                stepName ="Update AbsenceTerm vocabulary";
                tableName = "DefinedTermBase";
                query = " UPDATE @@DefinedTermBase@@ " +
-                " SET absenceterm = @@TRUE@@, "
+                " SET absenceterm = @TRUE@, "
                        + " vocabulary_id = "
                                        + "(SELECT id FROM @@TermVocabulary@@ "
                                        + " WHERE uuid = 'adbbbe15-c4d3-47b7-80a8-c7d104e53a05'),"