Project

General

Profile

« Previous | Next » 

Revision 45356f85

Added by Andreas Müller almost 2 years ago

ref #10089 implement TypeDesignationSetContainer ordered by status not field unit

View differences:

cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/name/TypeDesignationSetFormatterTest.java
246 246
//                new TaggedText(TagEnum.name, "Prionus coriatius L."), taggedText.get(3)); //maybe in future the entityReference should be TypedEntityReference.fromEntity(ntd.getTypeName(), false)
247 247
//        Assert.assertEquals("there should be 4 tags only", 4, taggedText.size());
248 248
    }
249

  
250
    //#10089
251
    @Test
252
    public void testOrderedByStatusNotBaseEntity() throws TypeDesignationSetException {
253

  
254
        @SuppressWarnings("rawtypes")
255
        List<TypeDesignationBase> tds = new ArrayList<>();
256
        tds.add(std_HT);
257
        tds.add(std_IT_3);
258

  
259
        TaxonName typifiedName = TaxonNameFactory.NewBotanicalInstance(Rank.SPECIES());
260
        typifiedName.setTitleCache("Prionus coriatius L.", true);
261

  
262
        typifiedName.addTypeDesignation(std_HT, false);
263
        typifiedName.addTypeDesignation(std_IT_3, false);
264

  
265
        TypeDesignationSetContainer container = new TypeDesignationSetContainer(tds);
266
        TypeDesignationSetFormatter formatter = new TypeDesignationSetFormatter(false, false, false);
267
        String text = formatter.format(container);
268
        int holotypeIndex = text.indexOf("holotype");
269
        Assert.assertTrue("Holotype must be first, isotype second", holotypeIndex>0 && (holotypeIndex < text.indexOf("isotype")) );
270
    }
249 271
}

Also available in: Unified diff