From cd1f735e5c492accc217116caa95c4cff21a4d3b Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Wed, 12 Oct 2011 01:28:45 +0000 Subject: [PATCH] CSPACE-3178: Quick hack to disable use of garbage refNames in location authority client tests, since refNames are now generated by the services. --- .../client/LocationAuthorityClientUtils.java | 8 ++++---- .../test/LocationAuthorityServiceTest.java | 17 ++++++++++------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClientUtils.java b/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClientUtils.java index d1ab2e8b1..7175c5bf5 100644 --- a/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClientUtils.java +++ b/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClientUtils.java @@ -39,8 +39,8 @@ public class LocationAuthorityClientUtils { LocationauthoritiesCommon locationAuthority = new LocationauthoritiesCommon(); locationAuthority.setDisplayName(displayName); locationAuthority.setShortIdentifier(shortIdentifier); - String refName = createLocationAuthRefName(shortIdentifier, displayName); - locationAuthority.setRefName(refName); + // String refName = createLocationAuthRefName(shortIdentifier, displayName); + // locationAuthority.setRefName(refName); locationAuthority.setVocabType("LocationAuthority"); //FIXME: REM - Should this really be hard-coded? PoxPayloadOut multipart = new PoxPayloadOut(LocationAuthorityClient.SERVICE_PAYLOAD_NAME); PayloadOutputPart commonPart = multipart.addPart(locationAuthority, MediaType.APPLICATION_XML_TYPE); @@ -68,8 +68,8 @@ public class LocationAuthorityClientUtils { String shortId = locationInfo.get(LocationJAXBSchema.SHORT_IDENTIFIER); String displayName = locationInfo.get(LocationJAXBSchema.DISPLAY_NAME); location.setShortIdentifier(shortId); - String locationRefName = createLocationRefName(locationAuthRefName, shortId, displayName); - location.setRefName(locationRefName); + // String locationRefName = createLocationRefName(locationAuthRefName, shortId, displayName); + // location.setRefName(locationRefName); String value = null; value = locationInfo.get(LocationJAXBSchema.DISPLAY_NAME_COMPUTED); boolean displayNameComputed = (value==null) || value.equalsIgnoreCase("true"); diff --git a/services/location/client/src/test/java/org/collectionspace/services/client/test/LocationAuthorityServiceTest.java b/services/location/client/src/test/java/org/collectionspace/services/client/test/LocationAuthorityServiceTest.java index c2e8b68b2..fb43bf132 100644 --- a/services/location/client/src/test/java/org/collectionspace/services/client/test/LocationAuthorityServiceTest.java +++ b/services/location/client/src/test/java/org/collectionspace/services/client/test/LocationAuthorityServiceTest.java @@ -147,8 +147,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { //FI LocationAuthorityClient client = new LocationAuthorityClient(); String shortId = identifier; String displayName = "displayName-" + shortId; - String baseRefName = - LocationAuthorityClientUtils.createLocationAuthRefName(shortId, null); + // String baseRefName = LocationAuthorityClientUtils.createLocationAuthRefName(shortId, null); PoxPayloadOut multipart = LocationAuthorityClientUtils.createLocationAuthorityInstance( displayName, shortId, client.getCommonPartName()); @@ -179,8 +178,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { //FI LocationAuthorityClient client = new LocationAuthorityClient(); String shortId = createIdentifier(); String displayName = "displayName-" + shortId; - String baseRefName = - LocationAuthorityClientUtils.createLocationAuthRefName(shortId, null); + // String baseRefName = LocationAuthorityClientUtils.createLocationAuthRefName(shortId, null); PoxPayloadOut multipart = LocationAuthorityClientUtils.createLocationAuthorityInstance( @@ -209,8 +207,9 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { //FI } // Store the ID returned from the first resource created // for additional tests below. + final String NULL_REFNAME = null; if (knownResourceId == null){ - setKnownResource( newID, shortId, baseRefName ); + setKnownResource( newID, shortId, NULL_REFNAME ); if (logger.isDebugEnabled()) { logger.debug(testName + ": knownResourceId=" + knownResourceId); } @@ -1116,9 +1115,13 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { //FI nonexMap.put(LocationJAXBSchema.SHORT_IDENTIFIER, "nonEx"); nonexMap.put(LocationJAXBSchema.LOCATION_TYPE, TEST_LOCATION_TYPE); nonexMap.put(LocationJAXBSchema.TERM_STATUS, TEST_STATUS); + // PoxPayloadOut multipart = + // LocationAuthorityClientUtils.createLocationInstance( + // LocationAuthorityClientUtils.createLocationRefName(knownResourceRefName, "nonEx", "Non Existent"), + // nonexMap, client.getItemCommonPartName() ); + final String NULL_REFNAME = null; PoxPayloadOut multipart = - LocationAuthorityClientUtils.createLocationInstance( - LocationAuthorityClientUtils.createLocationRefName(knownResourceRefName, "nonEx", "Non Existent"), + LocationAuthorityClientUtils.createLocationInstance(NULL_REFNAME, nonexMap, client.getItemCommonPartName() ); ClientResponse res = client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart); -- 2.47.3