Project

General

Profile

« Previous | Next » 

Revision 19617222

Added by Andreas Müller almost 3 years ago

ref #9638 remove trailing dots from ref caches (cont.)

View differences:

cdmlib-io/src/test/java/eu/etaxonomy/cdm/io/cdmLight/out/CdmLightExportTest.java
123 123
            String taxonStr = new String(taxon);
124 124
            String notExpected =  "\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\"";
125 125
            Assert.assertFalse("Result must not contain root taxon", taxonStr.startsWith(notExpected));
126
            String expected = "\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",\"4096df99-7274-421e-8843-211b603d832e\",\"CdmLightExportTest Classification\",\"3483cc5e-4c77-4c80-8cb0-73d43df31ee3\",\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\",\"4b6acca1-959b-4790-b76e-e474a0882990\",\"My sec ref.\"";
126
            String expected = "\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",\"4096df99-7274-421e-8843-211b603d832e\",\"CdmLightExportTest Classification\",\"3483cc5e-4c77-4c80-8cb0-73d43df31ee3\",\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\",\"4b6acca1-959b-4790-b76e-e474a0882990\",\"My sec ref\"";
127 127
            Assert.assertTrue(taxonStr.contains(expected));
128 128

  
129 129
            byte[] reference = data.get(CdmLightExportTable.REFERENCE.getTableName());
......
218 218
            String taxonStr = new String(taxon);
219 219
            String notExpected =  "\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\"";
220 220
            Assert.assertFalse("Result must not contain root taxon", taxonStr.startsWith(notExpected));
221
            String expected = "\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",\"4096df99-7274-421e-8843-211b603d832e\",\"CdmLightExportTest Classification\",\"3483cc5e-4c77-4c80-8cb0-73d43df31ee3\",\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\",\"4b6acca1-959b-4790-b76e-e474a0882990\",\"My sec ref.\"";
221
            String expected = "\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",\"4096df99-7274-421e-8843-211b603d832e\",\"CdmLightExportTest Classification\",\"3483cc5e-4c77-4c80-8cb0-73d43df31ee3\",\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\",\"4b6acca1-959b-4790-b76e-e474a0882990\",\"My sec ref\"";
222 222
            Assert.assertTrue(taxonStr.contains(expected));
223 223

  
224 224
            byte[] reference = data.get(CdmLightExportTable.REFERENCE.getTableName());
cdmlib-io/src/test/java/eu/etaxonomy/cdm/io/dwca/out/DwcaExportTest.java
179 179
//        System.out.println(coreStr);
180 180
        Assert.assertTrue(coreStr.contains(expected));
181 181

  
182
        expected = "\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",\"3483cc5e-4c77-4c80-8cb0-73d43df31ee3\",\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\",\"Genus species subsp. subspec Mill.\",\"Subspecies\",\"accepted\",,\"4b6acca1-959b-4790-b76e-e474a0882990\",\"b8dd7f4a-0c7f-4372-bc5d-3b676363bc0f\",\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",\"Genus species subsp. subspec Mill.\",\"Genus species Mill. sec. My sec ref\",,\"My sec ref.\",\"Mill. 1804: The book of botany 3.\",,\"Genus\",,\"species\",\"subspec\",\"subsp.\",,\"ICNAFP\",,,,,,,,,,\"DwcaExportTest Classification\",";
182
        expected = "\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",\"3483cc5e-4c77-4c80-8cb0-73d43df31ee3\",\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\",\"Genus species subsp. subspec Mill.\",\"Subspecies\",\"accepted\",,\"4b6acca1-959b-4790-b76e-e474a0882990\",\"b8dd7f4a-0c7f-4372-bc5d-3b676363bc0f\",\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",\"Genus species subsp. subspec Mill.\",\"Genus species Mill. sec. My sec ref\",,\"My sec ref\",\"Mill. 1804: The book of botany 3\",,\"Genus\",,\"species\",\"subspec\",\"subsp.\",,\"ICNAFP\",,,,,,,,,,\"DwcaExportTest Classification\",";
183 183
        Assert.assertTrue(coreStr.contains(expected));
184 184

  
185 185
        //distribution
......
191 191
        Assert.assertNotNull("Reference must not be null", ref);
192 192
        String refStr = new String(ref);
193 193
//        System.out.println(refStr);
194
        expected = "\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",,,,,\"My sec ref.\",\"My sec ref\",,,,,,,,,";
194
        expected = "\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",,,,,\"My sec ref\",\"My sec ref\",,,,,,,,,";
195 195
        Assert.assertTrue(refStr.contains(expected));
196
        expected = "\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",,,,,\"Mill. 1804: The book of botany 3.\",,\"Mill.\",\"1804\",,,,,,,";
196
        expected = "\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",,,,,\"Mill. 1804: The book of botany 3\",,\"Mill.\",\"1804\",,,,,,,";
197 197
        Assert.assertTrue(refStr.contains(expected));
198 198
        //header
199 199
        expected = "coreid,identifier,identifier,identifier,identifier,bibliographicCitation,title,creator,date,source,description,subject,language,rights,taxonRemarks,type";
200 200
        Assert.assertTrue(refStr.contains(expected));
201

  
202 201
    }
203 202

  
204 203
    @Test
......
263 262
        Assert.assertNotNull("Reference must not be null", ref);
264 263
        String refStr = new String(ref);
265 264

  
266
        expected = "\"3162e136-f2e2-4f9a-9010-3f35908fbae1\",,,,,\"My sec ref.\",\"My sec ref\",,,,,,,,,";
265
        expected = "\"3162e136-f2e2-4f9a-9010-3f35908fbae1\",,,,,\"My sec ref\",\"My sec ref\",,,,,,,,,";
267 266
//        System.out.println(refStr);
268 267
        Assert.assertTrue(refStr.contains(expected));
269
        expected = "\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\",,,,,\"Mill. 1804: The book of botany 3.\",,\"Mill.\",\"1804\",,,,,,,";
268
        expected = "\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\",,,,,\"Mill. 1804: The book of botany 3\",,\"Mill.\",\"1804\",,,,,,,";
270 269
        Assert.assertTrue(refStr.contains(expected));
271 270

  
272 271
        //distribution
......
346 345
        byte[] ref = data.get(DwcaTaxExportFile.REFERENCE.getTableName());
347 346
        Assert.assertNotNull("Reference must not be null", ref);
348 347
        String refStr = new String(ref);
349
        expected = "\"3162e136-f2e2-4f9a-9010-3f35908fbae1\",,,,,\"My sec ref.\",\"My sec ref\",,,,,,,,,";
348
        expected = "\"3162e136-f2e2-4f9a-9010-3f35908fbae1\",,,,,\"My sec ref\",\"My sec ref\",,,,,,,,,";
350 349
//        System.out.println(refStr);
351 350
        Assert.assertTrue(refStr.contains(expected));
352 351
        expected = "coreid,identifier,identifier,identifier,identifier,bibliographicCitation,title,creator,date,source,description,subject,language,rights,taxonRemarks,type";
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/ReferenceServiceImplTest.java
70 70

  
71 71
        service.updateCaches();
72 72

  
73
        assertEquals("Expecting titleCache to be updated", "Species plantarum.", titleCacheField.get(ref1));
73
        assertEquals("Expecting titleCache to be updated", "Species plantarum", titleCacheField.get(ref1));
74 74
        assertEquals("Expecting nameCache to be updated", "Sp. Pl.", abbrevCacheField.get(ref1));
75 75

  
76 76
        assertEquals("Expecting titleCache to be updated", "Reference2", titleCacheField.get(ref2));
77
        assertEquals("Expecting nameCache to not be updated", "ref. 2.", abbrevCacheField.get(ref2));
77
        assertEquals("Expecting nameCache to not be updated", "ref. 2", abbrevCacheField.get(ref2));
78 78

  
79
        assertEquals("Expecting titleCache to be updated", "Reference three.", titleCacheField.get(ref3));
79
        assertEquals("Expecting titleCache to be updated", "Reference three", titleCacheField.get(ref3));
80 80
        assertEquals("Expecting nameCache to be updated", "Protec. ref.", abbrevCacheField.get(ref3));
81 81

  
82 82
        assertEquals("Expecting error message for self-referencing in-refererence", "-- invalid inreference (self-referencing) --", titleCacheField.get(ref4));

Also available in: Unified diff