From: Aron Roberts Date: Wed, 12 Oct 2011 01:40:13 +0000 (+0000) Subject: CSPACE-3178: Quick hack to disable use of garbage refNames in taxonomy authority... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=ef98a6b6bdd6c2cdafe728269d411beafc3e2323;p=tmp%2Fjakarta-migration.git CSPACE-3178: Quick hack to disable use of garbage refNames in taxonomy authority (taxon) client tests, since refNames are now generated by the services. --- diff --git a/services/taxonomy/client/src/main/java/org/collectionspace/services/client/TaxonomyAuthorityClientUtils.java b/services/taxonomy/client/src/main/java/org/collectionspace/services/client/TaxonomyAuthorityClientUtils.java index b2ec5d690..f9c92a457 100644 --- a/services/taxonomy/client/src/main/java/org/collectionspace/services/client/TaxonomyAuthorityClientUtils.java +++ b/services/taxonomy/client/src/main/java/org/collectionspace/services/client/TaxonomyAuthorityClientUtils.java @@ -40,8 +40,8 @@ public class TaxonomyAuthorityClientUtils { TaxonomyauthorityCommon Taxonomyauthority = new TaxonomyauthorityCommon(); Taxonomyauthority.setDisplayName(displayName); Taxonomyauthority.setShortIdentifier(shortIdentifier); - String refName = createTaxonomyAuthRefName(shortIdentifier, displayName); - Taxonomyauthority.setRefName(refName); + // String refName = createTaxonomyAuthRefName(shortIdentifier, displayName); + // Taxonomyauthority.setRefName(refName); Taxonomyauthority.setVocabType("Taxonomyauthority"); //FIXME: REM - Should this really be hard-coded? PoxPayloadOut multipart = new PoxPayloadOut(TaxonomyAuthorityClient.SERVICE_PAYLOAD_NAME); PayloadOutputPart commonPart = multipart.addPart(Taxonomyauthority, MediaType.APPLICATION_XML_TYPE); @@ -71,8 +71,8 @@ public class TaxonomyAuthorityClientUtils { String shortId = taxonInfo.get(TaxonJAXBSchema.SHORT_IDENTIFIER); String displayName = taxonInfo.get(TaxonJAXBSchema.DISPLAY_NAME); taxon.setShortIdentifier(shortId); - String taxonomyRefName = createTaxonomyRefName(taxonomyAuthRefName, shortId, displayName); - taxon.setRefName(taxonomyRefName); + // String taxonomyRefName = createTaxonomyRefName(taxonomyAuthRefName, shortId, displayName); + // taxon.setRefName(taxonomyRefName); String value = null; value = taxonInfo.get(TaxonJAXBSchema.DISPLAY_NAME_COMPUTED); boolean displayNameComputed = (value == null) || value.equalsIgnoreCase("true"); diff --git a/services/taxonomy/client/src/test/java/org/collectionspace/services/client/test/TaxonomyAuthorityServiceTest.java b/services/taxonomy/client/src/test/java/org/collectionspace/services/client/test/TaxonomyAuthorityServiceTest.java index 314e5f11a..f535c0901 100644 --- a/services/taxonomy/client/src/test/java/org/collectionspace/services/client/test/TaxonomyAuthorityServiceTest.java +++ b/services/taxonomy/client/src/test/java/org/collectionspace/services/client/test/TaxonomyAuthorityServiceTest.java @@ -169,9 +169,9 @@ public class TaxonomyAuthorityServiceTest extends AbstractServiceTestImpl { //FI TaxonomyAuthorityClient client = new TaxonomyAuthorityClient(); String shortId = createIdentifier(); String displayName = "displayName-" + shortId; - String baseRefName = - TaxonomyAuthorityClientUtils.createTaxonomyAuthRefName(shortId, null); - + // String baseRefName = + // TaxonomyAuthorityClientUtils.createTaxonomyAuthRefName(shortId, null); + final String EMPTY_REFNAME = ""; PoxPayloadOut multipart = TaxonomyAuthorityClientUtils.createTaxonomyAuthorityInstance( displayName, shortId, client.getCommonPartName()); @@ -200,7 +200,7 @@ public class TaxonomyAuthorityServiceTest extends AbstractServiceTestImpl { //FI // Store the ID returned from the first resource created // for additional tests below. if (knownResourceId == null) { - setKnownResource(newID, shortId, baseRefName); + setKnownResource(newID, shortId, EMPTY_REFNAME); if (logger.isDebugEnabled()) { logger.debug(testName + ": knownResourceId=" + knownResourceId); } @@ -1123,9 +1123,14 @@ public class TaxonomyAuthorityServiceTest extends AbstractServiceTestImpl { //FI nonexMap.put(TaxonJAXBSchema.NAME, TEST_TAXON_FULL_NAME); nonexMap.put(TaxonJAXBSchema.SHORT_IDENTIFIER, "nonEx"); nonexMap.put(TaxonJAXBSchema.TERM_STATUS, TEST_TERM_STATUS); + // PoxPayloadOut multipart = + // TaxonomyAuthorityClientUtils.createTaxonInstance( + // TaxonomyAuthorityClientUtils.createTaxonomyRefName(knownResourceRefName, "nonEx", "Non Existent"), + // nonexMap, NULL_TAXON_AUTHOR_GROUP_LIST, NULL_TAXON_CITATION_LIST, + // client.getItemCommonPartName()); + final String EMPTY_REFNAME = ""; PoxPayloadOut multipart = - TaxonomyAuthorityClientUtils.createTaxonInstance( - TaxonomyAuthorityClientUtils.createTaxonomyRefName(knownResourceRefName, "nonEx", "Non Existent"), + TaxonomyAuthorityClientUtils.createTaxonInstance(EMPTY_REFNAME, nonexMap, NULL_TAXON_AUTHOR_GROUP_LIST, NULL_TAXON_CITATION_LIST, client.getItemCommonPartName()); ClientResponse res =