]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-6937-A: Getting all XMLReplay tests working again.
authorremillet <remillet@yahoo.com>
Thu, 28 Apr 2016 08:14:31 +0000 (01:14 -0700)
committerremillet <remillet@yahoo.com>
Thu, 28 Apr 2016 08:14:31 +0000 (01:14 -0700)
23 files changed:
services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/XmlReplay.java
services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/XmlReplayTransport.java
services/IntegrationTests/src/test/resources/test-data/xmlreplay/imports/import-locationitem-dollarsign.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/imports/import-locationitem-varexpansion.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/imports/res/import-locationitem-dollarsign.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/imports/res/import-locationitem-varexpansion.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/res/GetVocabularyItems.res.xml
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java
services/citation/client/src/test/java/org/collectionspace/services/client/test/CitationAuthorityServiceTest.java
services/client/src/main/java/org/collectionspace/services/client/AuthorityProxy.java
services/client/src/main/java/org/collectionspace/services/client/test/AbstractAuthorityServiceTest.java
services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java
services/concept/client/src/test/java/org/collectionspace/services/client/test/ConceptAuthorityServiceTest.java
services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java
services/location/client/src/test/java/org/collectionspace/services/client/test/LocationAuthorityServiceTest.java
services/material/client/src/test/java/org/collectionspace/services/client/test/MaterialAuthorityServiceTest.java
services/media/client/src/test/java/org/collectionspace/services/client/test/MediaAuthRefsTest.java
services/movement/client/src/test/java/org/collectionspace/services/client/test/MovementAuthRefsTest.java
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClientUtils.java
services/place/client/src/test/java/org/collectionspace/services/client/test/PlaceAuthorityServiceTest.java
services/taxonomy/client/src/test/java/org/collectionspace/services/client/test/TaxonomyAuthorityServiceTest.java
services/vocabulary/client/src/test/java/org/collectionspace/services/client/test/VocabularyServiceTest.java
services/work/client/src/test/java/org/collectionspace/services/client/test/WorkAuthorityServiceTest.java

index 45d8c875a170bdb5aab7b68ef3cdb3c2cd84e685..7c042acb2fbed460f3cc256ffba9dafcf0154ebc 100644 (file)
@@ -28,6 +28,8 @@ public class XmlReplay {
     public static final String DEFAULT_CONTROL = "xml-replay-control.xml";
     public static final String DEFAULT_MASTER_CONTROL = "xml-replay-master.xml";
     public static final String DEFAULT_DEV_MASTER_CONTROL = "dev-master.xml";
+       private static final int MAX_REATTEMPTS = 10;
+       private static final String REATTEMPT_KEY = "REATTEMPT_KEY";
 
     private String reportsDir = "";
     public String getReportsDir(){
@@ -228,7 +230,7 @@ public class XmlReplay {
     }
 
     public List<ServiceResult>  autoDelete(String logName){
-        return autoDelete(this.serviceResultsMap, logName);
+        return autoDelete(this.serviceResultsMap, logName, 0);
     }
 
     /** Use this method to clean up resources created on the server that returned CSIDs, if you have
@@ -236,12 +238,17 @@ public class XmlReplay {
      * @param serviceResultsMap a Map of ServiceResult objects, which will contain ServiceResult.deleteURL.
      * @return a List<String> of debug info about which URLs could not be deleted.
      */
-    public static List<ServiceResult> autoDelete(Map<String, ServiceResult> serviceResultsMap, String logName){
+    private static List<ServiceResult> autoDelete(Map<String, ServiceResult> serviceResultsMap, String logName, int reattempt) {
         List<ServiceResult> results = new ArrayList<ServiceResult>();
-        for (ServiceResult pr : serviceResultsMap.values()){
+        HashMap<String, ServiceResult> reattemptList = new HashMap<String, ServiceResult>();
+        int deleteFailures = 0;
+        for (ServiceResult pr : serviceResultsMap.values()) {
             try {
                 if (Tools.notEmpty(pr.deleteURL)){
                     ServiceResult deleteResult = XmlReplayTransport.doDELETE(pr.deleteURL, pr.auth, pr.testID, "[autodelete:"+logName+"]");
+                    if (deleteResult.gotExpectedResult() == false || deleteResult.responseCode != 200) {
+                       reattemptList.put(REATTEMPT_KEY + deleteFailures++, pr); // We need to try again after our dependents have been deleted. cow()
+                    }
                     results.add(deleteResult);
                 } else {
                     ServiceResult errorResult = new ServiceResult();
@@ -263,6 +270,15 @@ public class XmlReplay {
                 results.add(errorResult);
             }
         }
+        //
+        // If there were things we had trouble deleting, it might have been because they had dependents that
+        // needed to be deleted first.  Therefore, we're going to try again and again (recursively) up until we reach
+        // our MAX_REATTEMPTS limit.
+        //
+        if (reattemptList.size() > 0 && reattempt < MAX_REATTEMPTS) {
+               return autoDelete(reattemptList, logName, ++reattempt); // recursive call
+        }
+        
         return results;
     }
 
@@ -716,8 +732,8 @@ public class XmlReplay {
                     results.add(serviceResult);
                 }
             }
-            if (Tools.isTrue(autoDeletePOSTS)&&param_autoDeletePOSTS){
-                autoDelete(serviceResultsMap, "default");
+            if (Tools.isTrue(autoDeletePOSTS) && param_autoDeletePOSTS){
+                autoDelete(serviceResultsMap, "default", 0);
             }
         }
 
index 3d52e1793a7e71b50700163933f88111499a8a2c..0cf0cd4d363a35f6f48c9c17bad08968db4ef33c 100644 (file)
@@ -37,7 +37,6 @@ import java.io.OutputStreamWriter;
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
index 1f926ec709b481003dbcedce7b73ce0e3d80fd63..96f63e6c78aef7330aad8ea4fbd10ac1d189a73e 100644 (file)
@@ -9,7 +9,7 @@
                 </locTermGroup>
             </locTermGroupList>
             <shortIdentifier>${shortIdentifierValue}</shortIdentifier>
-            <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(${shortIdentifierValue})'${termDisplayNameValue}'</refName>
+                       <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(${importLocationAuthorityWithVarExpansion.shortIdentifierValue}):item:name(${shortIdentifierValue})'${termDisplayNameValue}'</refName>
             <inAuthority>${inAuthorityValue}</inAuthority>
         </schema>
     </import>
index 245260973e42c543a8119422291a3fbbb04f9b38..128ddbd7cc67f616b332a6ed9941215c66d8c07d 100644 (file)
@@ -16,7 +16,7 @@
                 </locTermGroup>
             </locTermGroupList>
             <shortIdentifier>${shortIdentifierValue}</shortIdentifier>
-            <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(${importLocationAuthorityWithVarExpansion.shortIdentifierValue})'Wattford &amp; Gump Outbuilding'</refName>
+                       <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(${importLocationAuthorityWithVarExpansion.shortIdentifierValue}):item:name(${shortIdentifierValue})'Wattford &amp; Gump Outbuilding'</refName>            
             <inAuthority>${inAuthorityValue}</inAuthority>
         </schema>
     </import>
index 5c5e75427ced96913c5d747476bf9635e7b7b9ed..4cf123d6963d63f93208b287bf6bf85da3985ea5 100644 (file)
@@ -15,7 +15,8 @@
         <!-- Note: This test may fail if the identifier for the core tenant changes. -->
         <tenantId>1</tenantId>
         <uri>${uriValue}</uri>
-        <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(${shortIdentifierValue})'${termDisplayNameValue}'</refName>
+               <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(${importLocationAuthorityWithVarExpansion.shortIdentifierValue}):item:name(${importLocationItemWithDollarSignInRefName.shortIdentifierValue})'${termDisplayNameValue}'</refName>          
+
     </ns2:collectionspace_core>
 </document>
 
index 3fd8879fe03481da5380cfb4085a0d401c796a41..98ad6b3e9a1e72a65443f3cdfc93950b61bf9251 100644 (file)
@@ -22,7 +22,7 @@
         <!-- Note: This test may fail if the identifier for the core tenant changes. -->
         <tenantId>1</tenantId>
         <uri>${uriValue}</uri>
-        <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(${importLocationAuthorityWithVarExpansion.shortIdentifierValue})'Wattford &amp; Gump Outbuilding'</refName>
+        <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(${importLocationAuthorityWithVarExpansion.shortIdentifierValue}):item:name(${importLocationItemWithVarExpansion.shortIdentifierValue})'Wattford &amp; Gump Outbuilding'</refName>                
     </ns2:collectionspace_core>
 </document>
 
index 6b20dc881c0496d8b2cea3bc4797b708703ed50a..5c2866b0674aa26ac8227893c4b684654de8b300 100644 (file)
@@ -6,7 +6,6 @@
        <pageNum>0</pageNum>
     <itemsInPage>3</itemsInPage>
     <totalItems>3</totalItems>
-    <fieldsReturned>csid|uri|refName|updatedAt|workflowState|rev|order|termStatus|displayName|shortIdentifier</fieldsReturned>
     <list-item>
         <displayName>${Item1.displayName}</displayName>
         <shortIdentifier>${Item1.itemID}</shortIdentifier>
index a50bc4f036750ba0ab1450251b37a67151e5fe56..9ed8ab2648cf977624730cfc00fc924e0b8c1a20 100644 (file)
@@ -1324,7 +1324,8 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
      * @param itemIdentifier
      * @throws Exception
      */
-    public void deleteAuthorityItem(ServiceContext existingCtx,
+    @SuppressWarnings("rawtypes")
+       public void deleteAuthorityItem(ServiceContext existingCtx,
             String parentIdentifier,
             String itemIdentifier,
             boolean shouldUpdateRevNumber
@@ -1337,7 +1338,13 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
                ctx.setProperties(existingCtx.getProperties());
         }
         
-        String parentcsid = lookupParentCSID(ctx, parentIdentifier, "deleteAuthorityItem(parent)", "DELETE_ITEM", null);
+        String parentcsid = null;
+        try {
+               parentcsid = lookupParentCSID(ctx, parentIdentifier, "deleteAuthorityItem(parent)", "DELETE_ITEM", null);
+        } catch (DocumentNotFoundException de) {
+               logger.warn(String.format("Could not find parent with ID='%s' when trying to delete item ID='%s'",
+                               parentIdentifier, itemIdentifier));
+        }
         String itemCsid = lookupItemCSID(ctx, itemIdentifier, parentcsid, "deleteAuthorityItem(item)", "DELETE_ITEM"); //use itemServiceCtx if it is not null
         
         DocumentHandler<?, AbstractCommonList, DocumentModel, DocumentModelList> handler = createDocumentHandler(ctx);
index d9b7c60e30b11c87f74fcd1589388cf0da389f77..656dde42436bc2971c5a903d06425edcb120a0cb 100644 (file)
@@ -68,7 +68,8 @@ public class CitationAuthorityServiceTest extends AbstractAuthorityServiceTest<C
     /**
      * Default constructor.  Used to set the short ID for all tests authority items
      */
-    CitationAuthorityServiceTest() {
+    public CitationAuthorityServiceTest() {
+       super();
        TEST_SHORTID = "citation1";
     }
 
index 2f1500e3385ef315a478973e5dbece9923a7cd56..77654dd541699944f8706682dd1cf39cc8cae402 100644 (file)
@@ -86,7 +86,7 @@ public interface AuthorityProxy extends CollectionSpaceCommonListPoxProxy {
     // Sync by name or CSID
     @GET
     @Path("/{identifier}/sync")
-    public Response sync(String identifier);
+    public Response sync(@PathParam("identifier") String identifier);
     
     /*
      * READ/GET Methods
index 0e6cb273caac4e0d00230118d0c8c702b24dabb3..83bb131b4d25615f90e5a44e0fb0c36f99da06e3 100644 (file)
@@ -36,7 +36,7 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
     private final Logger logger = LoggerFactory.getLogger(AbstractAuthorityServiceTest.class);
        
     protected String knownResourceShortIdentifer = null;
-       protected static final String READITEMS_SHORT_IDENTIFIER = "resourceWithItems"; 
+       protected static final String READITEMS_SHORT_IDENTIFIER = "resourceWithItems" + random.nextInt(1000)
        protected String knownAuthorityWithItems = null;
        
        protected static final String SAS_IDENTIFIER = "SAS"; 
@@ -113,7 +113,7 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
      */
        protected String getSASAuthorityIdentifier() {
                // TODO Auto-generated method stub
-               return this.getKnowResourceIdentifier() + this.SAS_IDENTIFIER;
+               return this.getKnowResourceIdentifier() + SAS_IDENTIFIER;
        }
     
        /**
@@ -297,10 +297,17 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
     @Test(dataProvider = "testName", dependsOnMethods = {"createSASItem", "CRUDTests"})
     public void syncWithSAS(String testName) {
         //
-        // First create an empty instance of the authority, so we can sync items with it.  We're
-       // using the short ID of the SAS authority.  The short ID of the local and the SAS will (must) be the same.
+        // First check to see if the authority supports synchronization.
         //
        AuthorityClient client = (AuthorityClient) this.getClientInstance();
+       if (client.supportsSync() == false) {
+               return; // Exit the test since this authority doesn't support synchronization
+       }
+       
+        //
+        // Create an empty instance of the authority, so we can sync items with it.  We're
+       // using the short ID of the SAS authority.  The short ID of the local and the SAS will (must) be the same.
+        //
        String localAuthorityId = null;
         try {
                        localAuthorityId = createResource(client, testName, getSASAuthorityIdentifier());
@@ -332,6 +339,14 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
      */    
     @Test(dataProvider = "testName", dependsOnMethods = {"createItem", "CRUDTests"})
     public void createSASAuthority(String testName) {
+        //
+        // First check to see if the authority supports synchronization.
+        //
+       AuthorityClient client = (AuthorityClient) this.getClientInstance();
+       if (client.supportsSync() == false) {
+               return; // Exit the test since this authority doesn't support synchronization
+       }
+       
         // Perform setup.
         setupCreate();
 
@@ -352,6 +367,14 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
      */
     @Test(dataProvider = "testName", dependsOnMethods = {"createSASAuthority", "CRUDTests"})
     public void createSASItem(String testName) {
+        //
+        // First check to see if the authority supports synchronization.
+        //
+       AuthorityClient client = (AuthorityClient) this.getClientInstance();
+       if (client.supportsSync() == false) {
+               return; // Exit the test since this authority doesn't support synchronization
+       }
+       
         // Perform setup.
         setupCreate();
 
index 8215c2a5239552c4936dff311c9613b8c9c155ed..3a64e357b8b39b5250cc7502306efdc4e96a2656 100644 (file)
@@ -1091,13 +1091,27 @@ public class RefNameServiceUtils {
                 + "='" + name + "'";
     }
 
-    public static String buildWhereForAuthItemByName(String authorityItemCommonSchemaName, String name, String parentcsid) {
-        return authorityItemCommonSchemaName
-                + ":" + AuthorityItemJAXBSchema.SHORT_IDENTIFIER
-                + "='" + name + "' AND "
-                + authorityItemCommonSchemaName + ":"
-                + AuthorityItemJAXBSchema.IN_AUTHORITY + "="   // parent value must be a CSID, not a URN short ID form
-                + "'" + parentcsid + "'";
+    /**
+     * Build an NXQL query for finding an item by its short ID
+     * 
+     * @param authorityItemCommonSchemaName
+     * @param shortId
+     * @param parentcsid
+     * @return
+     */
+    public static String buildWhereForAuthItemByName(String authorityItemCommonSchemaName, String shortId, String parentcsid) {
+       String result = null;
+       
+        result = String.format("%s:%s='%s'", authorityItemCommonSchemaName, AuthorityItemJAXBSchema.SHORT_IDENTIFIER, shortId);
+        //
+        // Technically, we don't need the parent CSID since the short ID is unique so it can be null
+        //
+        if (parentcsid != null) {
+               result = String.format("%s AND %s:%s='%s'",
+                               result, authorityItemCommonSchemaName, AuthorityItemJAXBSchema.IN_AUTHORITY, parentcsid);
+        }
+        
+        return result;
     }    
 
     /*
index 7b7052307797e4e9b97bee4d2fd722598bc8354e..a19d6546a2efe129e9b36b51d7c07848af50f13a 100644 (file)
@@ -62,7 +62,8 @@ public class ConceptAuthorityServiceTest extends AbstractAuthorityServiceTest<Co
     /**
      * Default constructor.  Used to set the short ID for all tests authority items
      */
-    ConceptAuthorityServiceTest() {
+    public ConceptAuthorityServiceTest() {
+       super();
         TEST_SHORTID = "concept1";
     }
     
index b0be8b37a4a55d216995b3c017cad2eb90b988d5..bd84c581a41b7fb45e2e1010387833ae655a75d2 100644 (file)
@@ -213,7 +213,7 @@ public class LoanoutAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         Map<String, String> personInfo = new HashMap<String,String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
-        personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
+        personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId + random.nextInt(1000)); // avoid short ID conflicts with pass test session records that never got cleaned up
         List<PersonTermGroup> personTerms = new ArrayList<PersonTermGroup>();
         PersonTermGroup term = new PersonTermGroup();
         String termName = firstName + " " + surName;
index 81a27275d42c497a889d7eff6f6bcfc90816119c..03df14293cf982f8a2dfbd4757dd51a569ebfb66 100644 (file)
@@ -66,7 +66,8 @@ public class LocationAuthorityServiceTest extends AbstractAuthorityServiceTest<L
     /**
      * Default constructor.  Used to set the short ID for all tests authority items
      */
-    LocationAuthorityServiceTest() {
+    public LocationAuthorityServiceTest() {
+       super();
         TEST_SHORTID = "shelf1";
     }
     
index e07f7b07663223464bcefdd79658b1135141bb7c..4ceb52ec338b0afd777300d14ca4aaadf07551f7 100644 (file)
@@ -63,7 +63,8 @@ public class MaterialAuthorityServiceTest extends AbstractAuthorityServiceTest<M
     /**
      * Default constructor.  Used to set the short ID for all tests authority items
      */
-    MaterialAuthorityServiceTest() {
+    public MaterialAuthorityServiceTest() {
+       super();
        TEST_SHORTID = "superglass";
     }
     
index d45cf71c8ac7339c967b077e569e18443b5f9d0b..47d00854cb84c6f0db6948a9616d1ed042933d3c 100644 (file)
@@ -158,7 +158,7 @@ public class MediaAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         Map<String, String> personInfo = new HashMap<String, String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
-        personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
+        personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId + random.nextInt(1000));
         List<PersonTermGroup> personTerms = new ArrayList<PersonTermGroup>();
         PersonTermGroup term = new PersonTermGroup();
         String termName = firstName + " " + surName;
index fa3e9a1a51616539ed6fc83e30624be93c88d4fd..5eb255909d2dce87fa85921f1a6fc0ce70b20a8a 100644 (file)
@@ -118,8 +118,7 @@ public class MovementAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         // references, and will refer to Person resources by their refNames.
         MovementClient movementClient = new MovementClient();
         PoxPayloadOut multipart = createMovementInstance(
-                "movementReferenceNumber-" + identifier,
-                GregorianCalendarDateTimeUtils.timestampUTC(),
+                "movementReferenceNumber-" + identifier, GregorianCalendarDateTimeUtils.timestampUTC(),
                 movementContactRefName);
         String newId = null;
         Response res = movementClient.create(multipart);
@@ -190,7 +189,7 @@ public class MovementAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         Map<String, String> personInfo = new HashMap<String,String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
-        personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
+        personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId + Math.abs(random.nextInt()));
         List<PersonTermGroup> personTerms = new ArrayList<PersonTermGroup>();
         PersonTermGroup term = new PersonTermGroup();
         String termName = firstName + " " + surName;
index a2b36d09431ab9dd6c13b6ceeba96c188374dcc7..61e9549bdeef5823ecc4ef02562891ded7c0cb6b 100644 (file)
@@ -139,7 +139,7 @@ public class PersonAuthorityClientUtils {
                String displayName, String shortIdentifier, String headerLabel ) {
         PersonauthoritiesCommon personAuthority = new PersonauthoritiesCommon();
         personAuthority.setDisplayName(displayName);
-        personAuthority.setShortIdentifier(shortIdentifier);
+        personAuthority.setShortIdentifier(shortIdentifier + random.nextInt(10000));
         //String refName = createPersonAuthRefName(shortIdentifier, displayName);
         //personAuthority.setRefName(refName);
         personAuthority.setVocabType("PersonAuthority");
index 42d9d4efa292ae93ffe37e386b6dc3ce50145235..c7d66a88ba0bacd5bcec5e1b09c4a8e5a0fcedd4 100644 (file)
@@ -65,7 +65,8 @@ public class PlaceAuthorityServiceTest extends AbstractAuthorityServiceTest<Plac
     /**
      * Default constructor.  Used to set the short ID for all tests authority items
      */
-    PlaceAuthorityServiceTest() {
+    public PlaceAuthorityServiceTest() {
+       super();
         TEST_SHORTID = "sanjose";
     }
     
index f08a1f2447512f290cbfb54004af7e16b4c999e2..ce5dd3616f4cd45cf492fd304f6073b44ce60411 100644 (file)
@@ -66,7 +66,8 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
     /**
      * Default constructor.  Used to set the short ID for all tests authority items
      */
-       TaxonomyAuthorityServiceTest() {
+       public TaxonomyAuthorityServiceTest() {
+               super();
            TEST_SHORTID = "CentauruspleurexanthemusGreen1832";         
        }
        
index 9cd44f9891542ac5aa066ee7a359d13a0733f167..4f2cf164932f39a9ee1d5ec79b43c16983ff230e 100644 (file)
@@ -62,7 +62,8 @@ public class VocabularyServiceTest extends AbstractAuthorityServiceTest<Vocabula
     /**
      * Default constructor.  Used to set the short ID for all tests authority items
      */
-    VocabularyServiceTest() {
+    public VocabularyServiceTest() {
+       super();
         TEST_SHORTID = "vocabTest";
     }
 
@@ -131,9 +132,10 @@ public class VocabularyServiceTest extends AbstractAuthorityServiceTest<Vocabula
         testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
 
         // Create a new vocabulary
+        String shortId = "nonunique" + random.nextInt(1000); // Prevent collisions with past test sessions that never cleaned up properly
         VocabularyClient client = new VocabularyClient();
         PoxPayloadOut multipart = VocabularyClientUtils.createEnumerationInstance(
-                "Vocab with non-unique Short Id", "nonunique", client.getCommonPartName());
+                "Vocab with non-unique Short Id", shortId, client.getCommonPartName());
         Response res = client.create(multipart);
         try {
                assertStatusCode(res, testName);
index d350031d31b34152b38046e5dfeb1943750a372a..1507dfd97fa303414a882bd32cc05c222af7060f 100644 (file)
@@ -63,7 +63,8 @@ public class WorkAuthorityServiceTest extends AbstractAuthorityServiceTest<Worka
     /**
      * Default constructor.  Used to set the short ID for all tests authority items
      */
-    WorkAuthorityServiceTest() {
+    public WorkAuthorityServiceTest() {
+       super();
         TEST_SHORTID = "muppetstakemanhattan";
     }