cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TermServiceImplTest.java -text
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TransmissionEngineDistributionTest.java -text
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/UserAndGroupServiceImplTest.java -text
+cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/VocabularyServiceImplTest.java -text
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/lsid/LSIDAuthorityServiceTest.java -text
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/lsid/LSIDDataServiceTest.java -text
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/lsid/LSIDMetadataServiceTest.java -text
@Deprecated\r
public List<RelationshipBase> getAllRelationships(int limit, int start);\r
\r
- /**\r
- * Returns all Ranks\r
- * @return\r
- * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead,\r
- * this is not possible since VocabularyService#getVocabulary(VocabularyEnum)\r
- * is not returning a OrderedTermVocabulary !!! see also http://dev.e-taxonomy.eu/trac/ticket/3327\r
- */\r
- @Deprecated\r
- public OrderedTermVocabulary<Rank> getRankVocabulary();\r
+// /**\r
+// * Returns all Ranks\r
+// * @return\r
+// * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead,\r
+// * this is not possible since VocabularyService#getVocabulary(VocabularyEnum)\r
+// * is not returning a OrderedTermVocabulary !!! see also http://dev.e-taxonomy.eu/trac/ticket/3327\r
+// */\r
+// @Deprecated\r
+// public OrderedTermVocabulary<Rank> getRankVocabulary();\r
\r
/**\r
* Returns all NomenclaturalStatusTypes\r
*/\r
@Deprecated\r
public TermVocabulary<NomenclaturalStatusType> getStatusTypeVocabulary();\r
-\r
- /**\r
- * Returns TypeDesignationStatus vocabulary\r
- * @return\r
- * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead\r
- */\r
- @Deprecated\r
- public TermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationStatusVocabulary();\r
+//\r
+// /**\r
+// * Returns TypeDesignationStatus vocabulary\r
+// * @return\r
+// * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead\r
+// */\r
+// @Deprecated\r
+// public TermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationStatusVocabulary();\r
\r
/**\r
* Returns TypeDesignationStatus ordered vocabulary\r
return dao.getAllRelationships(limit, start);\r
}\r
\r
- /**\r
- * FIXME Candidate for harmonization\r
- * is this not the same as termService.getVocabulary(VocabularyEnum.Rank)\r
- * since this returns OrderedTermVocabulary\r
- *\r
- * (non-Javadoc)\r
- * @see eu.etaxonomy.cdm.api.service.INameService#getRankVocabulary()\r
- */\r
- @Override\r
- public OrderedTermVocabulary<Rank> getRankVocabulary() {\r
- String uuidString = "ef0d1ce1-26e3-4e83-b47b-ca74eed40b1b";\r
- UUID uuid = UUID.fromString(uuidString);\r
- OrderedTermVocabulary<Rank> rankVocabulary =\r
- (OrderedTermVocabulary)orderedVocabularyDao.findByUuid(uuid);\r
- return rankVocabulary;\r
- }\r
+// /**\r
+// * FIXME Candidate for harmonization\r
+// * is this not the same as termService.getVocabulary(VocabularyEnum.Rank)\r
+// * since this returns OrderedTermVocabulary\r
+// *\r
+// * (non-Javadoc)\r
+// * @see eu.etaxonomy.cdm.api.service.INameService#getRankVocabulary()\r
+// */\r
+// @Override\r
+// public OrderedTermVocabulary<Rank> getRankVocabulary() {\r
+// String uuidString = "ef0d1ce1-26e3-4e83-b47b-ca74eed40b1b";\r
+// UUID uuid = UUID.fromString(uuidString);\r
+// OrderedTermVocabulary<Rank> rankVocabulary =\r
+// (OrderedTermVocabulary)orderedVocabularyDao.findByUuid(uuid);\r
+// return rankVocabulary;\r
+// }\r
\r
/**\r
* FIXME Candidate for harmonization\r
/**\r
* FIXME Candidate for harmonization\r
* is this the same as termService.getVocabulary(VocabularyEnum.StatusType)\r
- * (non-Javadoc)\r
- * @see eu.etaxonomy.cdm.api.service.INameService#getStatusTypeVocabulary()\r
*/\r
@Override\r
public TermVocabulary<NomenclaturalStatusType> getStatusTypeVocabulary() {\r
return nomStatusTypeVocabulary;\r
}\r
\r
- /**\r
- * FIXME Candidate for harmonization\r
- * is this the same as termService.getVocabulary(VocabularyEnum.SpecimenTypeDesignationStatus)\r
- * (non-Javadoc)\r
- * @see eu.etaxonomy.cdm.api.service.INameService#getTypeDesignationStatusVocabulary()\r
- */\r
- @Override\r
- public TermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationStatusVocabulary() {\r
- String uuidString = "ab177bd7-d3c8-4e58-a388-226fff6ba3c2";\r
- UUID uuid = UUID.fromString(uuidString);\r
- TermVocabulary<SpecimenTypeDesignationStatus> typeDesigStatusVocabulary =\r
- vocabularyDao.findByUuid(uuid);\r
- return typeDesigStatusVocabulary;\r
- }\r
+// /**\r
+// * FIXME Candidate for harmonization\r
+// * is this the same as termService.getVocabulary(VocabularyEnum.SpecimenTypeDesignationStatus)\r
+// * (non-Javadoc)\r
+// * @see eu.etaxonomy.cdm.api.service.INameService#getTypeDesignationStatusVocabulary()\r
+// */\r
+// @Override\r
+// public TermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationStatusVocabulary() {\r
+// String uuidString = "ab177bd7-d3c8-4e58-a388-226fff6ba3c2";\r
+// UUID uuid = UUID.fromString(uuidString);\r
+// TermVocabulary<SpecimenTypeDesignationStatus> typeDesigStatusVocabulary =\r
+// vocabularyDao.findByUuid(uuid);\r
+// return typeDesigStatusVocabulary;\r
+// }\r
\r
/**\r
* FIXME Candidate for harmonization\r
logger.warn("Not yet implemented");\r
}\r
\r
- /**\r
- * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#getRankVocabulary()}.\r
- */\r
- @Test\r
- @Ignore //FIXME assertSame does not work yet\r
- public void testGetRankVocabulary() {\r
- //TODO move test to vocabulary service\r
- OrderedTermVocabulary<Rank> rankVocabulary = nameService.getRankVocabulary();\r
- assertNotNull(rankVocabulary);\r
- assertEquals(66, rankVocabulary.size());\r
- Rank highestRank = rankVocabulary.getHighestTerm();\r
- assertEquals(Rank.EMPIRE(), highestRank);\r
- assertEquals(Rank.DOMAIN(), rankVocabulary.getNextLowerTerm(highestRank));\r
- assertSame(Rank.EMPIRE(), highestRank);\r
- assertSame(Rank.DOMAIN(), rankVocabulary.getNextLowerTerm(highestRank));\r
- }\r
\r
- /**\r
- * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#getTypeDesignationVocabulary()}.\r
- */\r
- @Test\r
- @Ignore //not yet correctly implemented\r
- public void testGetTypeDesignationVocabulary() {\r
- //TODO move test to vocabulary service\r
- OrderedTermVocabulary<SpecimenTypeDesignationStatus> typeDesignationVocabulary =\r
- nameService.getSpecimenTypeDesignationVocabulary();\r
- assertNotNull(typeDesignationVocabulary);\r
- assertEquals(20, typeDesignationVocabulary.size());\r
- SpecimenTypeDesignationStatus highestType = typeDesignationVocabulary.getHighestTerm();\r
- assertEquals(SpecimenTypeDesignationStatus.EPITYPE(), highestType);\r
- assertEquals(SpecimenTypeDesignationStatus.HOLOTYPE(), typeDesignationVocabulary.getNextLowerTerm(highestType));\r
- assertSame(SpecimenTypeDesignationStatus.EPITYPE(), highestType);\r
- assertSame(SpecimenTypeDesignationStatus.HOLOTYPE(), typeDesignationVocabulary.getNextLowerTerm(highestType));\r
- }\r
\r
/**\r
* Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#generateTitleCache()}.\r
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.cdm.api.service;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.unitils.spring.annotation.SpringBeanByType;
+
+import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.cdm.model.name.Rank;
+import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
+import eu.etaxonomy.cdm.test.integration.CdmTransactionalIntegrationTest;
+
+/**
+ * @author a.mueller
+ * @created Aug 07, 2014
+ */
+//@SpringApplicationContext("file:./target/test-classes/eu/etaxonomy/cdm/applicationContext-test.xml")
+public class VocabularyServiceImplTest extends CdmTransactionalIntegrationTest{
+
+
+ @SpringBeanByType
+ private IVocabularyService vocabularyService;
+
+
+
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ }
+
+
+ /**
+ * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#getRankVocabulary()}.
+ */
+ @Test
+// @Ignore //FIXME assertSame does not work yet
+ public void testGetRankVocabulary() {
+ List<TermVocabulary<Rank>> rankVocabularyList = vocabularyService.findByTermType(TermType.Rank);
+ assertTrue(rankVocabularyList.size() == 1);
+ OrderedTermVocabulary<Rank> rankVocabulary = (OrderedTermVocabulary<Rank>)rankVocabularyList.get(0);
+ assertNotNull(rankVocabulary);
+ assertEquals(62, rankVocabulary.size());
+ Rank highestRank = rankVocabulary.getHighestTerm();
+ assertEquals(Rank.EMPIRE(), highestRank);
+ assertEquals(Rank.DOMAIN(), rankVocabulary.getNextLowerTerm(highestRank));
+// assertSame(Rank.EMPIRE(), highestRank); //as we do not use second level cache this is not required
+// assertSame(Rank.DOMAIN(), rankVocabulary.getNextLowerTerm(highestRank)); //as we do not use second level cache this is not required
+ }
+
+ /**
+ * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#getTypeDesignationVocabulary()}.
+ */
+ @Test
+// @Ignore //not yet correctly implemented
+ public void testGetTypeDesignationVocabulary() {
+ List<TermVocabulary<SpecimenTypeDesignationStatus>> typeDesignationVocabularyList =
+ vocabularyService.findByTermType(TermType.SpecimenTypeDesignationStatus);
+ assertTrue(typeDesignationVocabularyList.size() == 1);
+ OrderedTermVocabulary<SpecimenTypeDesignationStatus> typeDesignationVocabulary = (OrderedTermVocabulary<SpecimenTypeDesignationStatus>)typeDesignationVocabularyList.get(0);
+
+ assertNotNull(typeDesignationVocabulary);
+ assertEquals(16, typeDesignationVocabulary.size());
+ SpecimenTypeDesignationStatus highestType = typeDesignationVocabulary.getHighestTerm();
+ assertEquals(SpecimenTypeDesignationStatus.HOLOTYPE(), highestType);
+ assertEquals(SpecimenTypeDesignationStatus.LECTOTYPE(), typeDesignationVocabulary.getNextLowerTerm(highestType));
+// assertSame(SpecimenTypeDesignationStatus.EPITYPE(), highestType); //as we do not use second level cache this is not required
+// assertSame(SpecimenTypeDesignationStatus.HOLOTYPE(), typeDesignationVocabulary.getNextLowerTerm(highestType)); //as we do not use second level cache this is not required
+ }
+
+}