Project

General

Profile

Revision c1a7896b

IDc1a7896b0ff9afef5e65f230dba679e1e77a6757
Parent 138c6c40
Child f7b8f0c0

Added by Andreas Müller almost 3 years ago

cleanup ClassificationServiceImplTest

View differences:

cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/ClassificationServiceImplTest.java
201 201

  
202 202
    }
203 203

  
204
    /**
205
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#loadTreeBranch(eu.etaxonomy.cdm.model.taxon.TaxonNode, eu.etaxonomy.cdm.model.name.Rank, java.util.List)}.
206
     */
207
//    @Test
208
    public final void testLoadTreeBranch() {
209
//		fail("Not yet implemented");
210
    }
211

  
212
    /**
213
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#loadTreeBranchToTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.Classification, eu.etaxonomy.cdm.model.name.Rank, java.util.List)}.
214
     */
215
//    @Test
216
    public final void testLoadTreeBranchToTaxon() {
217
//		fail("Not yet implemented");
218
    }
219

  
220
    /**
221
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#loadChildNodesOfTaxonNode(eu.etaxonomy.cdm.model.taxon.TaxonNode, java.util.List)}.
222
     */
223
//    @Test
224
    public final void testLoadChildNodesOfTaxonNode() {
225
//		fail("Not yet implemented");
226
    }
227

  
228
    /**
229
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#loadChildNodesOfTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.Classification, java.util.List)}.
230
     */
231
//    @Test
232
    public final void testLoadChildNodesOfTaxon() {
233
//		fail("Not yet implemented");
234
    }
235

  
236
    /**
237
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#getTaxonNodeByUuid(java.util.UUID)}.
238
     */
239
//    @Test
240
    public final void testGetTaxonNodeByUuid() {
241
//		fail("Not yet implemented");
242
    }
243

  
244
    /**
245
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#getTreeNodeByUuid(java.util.UUID)}.
246
     */
247
//    @Test
248
    public final void testGetTreeNodeByUuid() {
249
//		fail("Not yet implemented");
250
    }
251

  
252
    /**
253
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#listClassifications(java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)}.
254
     */
255
//    @Test
256
    public final void testListClassifications() {
257
//		fail("Not yet implemented");
258
    }
259

  
260
    /**
261
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#getClassificationByUuid(java.util.UUID)}.
262
     */
263
//    @Test
264
    public final void testGetClassificationByUuid() {
265
//		fail("Not yet implemented");
266
    }
267

  
268
    /**
269
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#removeTaxonNode(eu.etaxonomy.cdm.model.taxon.TaxonNode)}.
270
     */
271
//    @Test
272
    public final void testRemoveTaxonNode() {
273
//		fail("Not yet implemented");
274
    }
204
    @Test
205
    @DataSet
206
    public final void testListRankSpecificRootNodes_withSubtree(){
207
        Classification classification = service.find(UUID.fromString("6c2bc8d9-ee62-4222-be89-4a8e31770878"));
208
        // classification, see  createTestDataSet()
209
        // ClassificationRoot
210
        // |- Acacia N.Jacobsen, Bastm. & Yuji Sasaki                          [Genus]
211
        // |  |-- Acacia subg. Aculeiferum Pedley                              [Subgenus]
212
        // |  |-- Acacia subg. Phyllodineae N.Jacobsen, Bastm. & Yuji Sasaki   [Subgenus]
213
        // |  |  |-- Acacia sect. Botrycephalae Yuji Sasaki                    [Section (Botany)]
214
        // |  |------- Acacia cuspidifolia Maslin                              [Species]
215
        // |  |------- Acacia mearnsii Benth                                   [Species]
216
        // |---------- Acacia acicularis Willd.                                [Species]
217
        //             |-- ×Acacia acicularis Willd. subsp. acicularis         [Subspecies]
218
        //
219
        // for more historic Acacia taxonomy see http://lexikon.freenet.de/Akazien
275 220

  
276
    /**
277
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#removeTreeNode(eu.etaxonomy.cdm.model.taxon.ITreeNode)}.
278
     */
279
//    @Test
280
    public final void testRemoveTreeNode() {
281
//		fail("Not yet implemented");
282
    }
221
        TaxonNode subtree = taxonNodeService.find(UUID.fromString("bcdf945f-1f02-423e-883d-fe89e0af93e4"));
283 222

  
284
    /**
285
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#saveTaxonNode(eu.etaxonomy.cdm.model.taxon.TaxonNode)}.
286
     */
287
//    @Test
288
    public final void testSaveTaxonNode() {
289
//		fail("Not yet implemented");
290
    }
291 223

  
292
    /**
293
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#saveTaxonNodeAll(java.util.Collection)}.
294
     */
295
//    @Test
296
    public final void testSaveTaxonNodeAll() {
297
//		fail("Not yet implemented");
298
    }
224
        List<TaxonNode> taxonNodes = service.listRankSpecificRootNodes(null, subtree, null, includeUnpublished, null, null, NODE_INIT_STRATEGY);
225
        Assert.assertEquals(2, taxonNodes.size());
299 226

  
300
    /**
301
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#saveTreeNode(eu.etaxonomy.cdm.model.taxon.ITreeNode)}.
302
     */
303
//    @Test
304
    public final void testSaveTreeNode() {
305
//		fail("Not yet implemented");
306
    }
227
        taxonNodes = service.listRankSpecificRootNodes(classification, null, null, includeUnpublished, null, null, NODE_INIT_STRATEGY);
228
        Assert.assertEquals(2, taxonNodes.size());
307 229

  
308
    /**
309
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(eu.etaxonomy.cdm.model.taxon.Classification)}.
310
     */
311
//    @Test
312
    public final void testGetTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification() {
313
//		fail("Not yet implemented");
314
    }
230
        taxonNodes = service.listRankSpecificRootNodes(classification, null, Rank.SECTION_BOTANY(), includeUnpublished, null, null, NODE_INIT_STRATEGY);
231
        Assert.assertEquals(4, taxonNodes.size());
315 232

  
316
    /**
317
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#getUuidAndTitleCache()}.
318
     */
319
//    @Test
320
    public final void testGetUuidAndTitleCache() {
321
//		fail("Not yet implemented");
322
    }
233
        // also test if the pager works
234
        taxonNodes = service.listRankSpecificRootNodes(classification, null, Rank.SECTION_BOTANY(), includeUnpublished, 10, 0, NODE_INIT_STRATEGY);
235
        Assert.assertEquals(4, taxonNodes.size());
236
        taxonNodes = service.listRankSpecificRootNodes(classification, null, Rank.SECTION_BOTANY(), includeUnpublished, 2, 0, NODE_INIT_STRATEGY);
237
        Assert.assertEquals(2, taxonNodes.size());
238
        taxonNodes = service.listRankSpecificRootNodes(classification, null, Rank.SECTION_BOTANY(), includeUnpublished, 2, 1, NODE_INIT_STRATEGY);
239
        Assert.assertEquals(2, taxonNodes.size());
240
        taxonNodes = service.listRankSpecificRootNodes(classification, null, Rank.SECTION_BOTANY(), includeUnpublished, 2, 2, NODE_INIT_STRATEGY);
241
        Assert.assertEquals(0, taxonNodes.size());
323 242

  
324
    /**
325
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#getAllMediaForChildNodes(eu.etaxonomy.cdm.model.taxon.TaxonNode, java.util.List, int, int, int, java.lang.String[])}.
326
     */
327
//    @Test
328
    public final void testGetAllMediaForChildNodesTaxonNodeListOfStringIntIntIntStringArray() {
329
//		fail("Not yet implemented");
330
    }
243
        taxonNodes = service.listRankSpecificRootNodes(classification, null, Rank.SPECIES(), includeUnpublished, null, null, NODE_INIT_STRATEGY);
244
        Assert.assertEquals(3, taxonNodes.size());
331 245

  
332
    /**
333
     * Test method for {@link eu.etaxonomy.cdm.api.service.ClassificationServiceImpl#getAllMediaForChildNodes(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.Classification, java.util.List, int, int, int, java.lang.String[])}.
334
     */
335
//    @Test
336
    public final void testGetAllMediaForChildNodesTaxonClassificationListOfStringIntIntIntStringArray() {
337
//		fail("Not yet implemented");
246
        // also test if the pager works
247
        taxonNodes = service.listRankSpecificRootNodes(classification, null, Rank.SPECIES(), includeUnpublished, 10, 0, NODE_INIT_STRATEGY);
248
        Assert.assertEquals(3, taxonNodes.size());
249
        taxonNodes = service.listRankSpecificRootNodes(classification, null, Rank.SPECIES(), includeUnpublished, 2, 1, NODE_INIT_STRATEGY);
250
        Assert.assertEquals(1, taxonNodes.size());
338 251
    }
339 252

  
340 253
    /**

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)