]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
DRYD-1042: Fix failing relation integration tests.
authorRay Lee <ray.lee@lyrasis.org>
Tue, 25 Apr 2023 19:51:00 +0000 (15:51 -0400)
committerRay Lee <ray.lee@lyrasis.org>
Tue, 25 Apr 2023 19:51:00 +0000 (15:51 -0400)
services/IntegrationTests/src/test/resources/test-data/xmlreplay/dev-all.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/relation.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml

index 6ee68ae021f13967ba0b0411fa4ede5d96f4012d..4f1e340c2bb1d716c71a696dbd8d5b9b9f9ab950 100644 (file)
@@ -1,73 +1,73 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xmlReplayMaster>
-    <!-- 
-    This file contains all possible tests, in various stages of readiness, 
+    <!--
+    This file contains all possible tests, in various stages of readiness,
        as noted below in comments.  Files not commented out should work.
-     
-     Important.  You can't run or source this file.  It is just for reference 
+
+     Important.  You can't run or source this file.  It is just for reference
         and a storage place to put these tests, so they can be copied into dev-master.xml
-        
+
      Keep this file updated with all possible tests, so that dev-master.xml can be clean.
-     
+
      Keep xml-replay-master.xml updated with all tests that should run on nightly.
    -->
    <!--
     <run controlFile="loanin/loanin.xml" testGroup="makeone" />
-    
-    <run controlFile="objectexit/object-exit.xml" testGroup="CRUDL" />   
+
+    <run controlFile="objectexit/object-exit.xml" testGroup="CRUDL" />
     <run controlFile="objectexit/object-exit.xml" testGroup="domwalk" />
     <run controlFile="objectexit/object-exit.xml" testGroup="repeat" />
     <run controlFile="objectexit/object-exit.xml" testGroup="domlist" />
     <run controlFile="objectexit/object-exit.xml" testGroup="authrefs" />
     <run controlFile="objectexit/object-exit.xml" testGroup="cleanup" />
     <run controlFile="objectexit/object-exit.xml" testGroup="makeone" />
-    
+
     <run controlFile="acquisitions/acquisitions.xml" testGroup="makeone" />
     <run controlFile="acquisitions/acquisitions.xml" testGroup="testList" />
-    
+
     <run controlFile="media/media.xml" testGroup="authrefs" />
-    
+
     <run controlFile="objectexit/object-exit.xml" testGroup="authrefs" />
     <run controlFile="objectexit/object-exit.xml" testGroup="authrefs" />
     <run controlFile="acquisitions/acquisitions.xml" testGroup="makeone" />
     -->
-    
-    
+
+
     <!--
       Used to verify CSPACE-3178
     <run controlFile="objectexit/object-exit-display.xml" testGroup="refNameDisplayNameOnly" />
     -->
-    
+
     <!--
       Used to measure timings of 1000 records for  CSPACE-3553
     <run controlFile="objectexit/object-exit-LOOP.xml" testGroup="LOOP" />
     -->
-     
+
     <!--
     <run controlFile="objectexit/object-exit.xml" testGroup="makeone" />
     <run controlFile="relation/relation.xml" testGroup="makeRelations" />
     <run controlFile="person/person.xml" testGroup="person" />
     <run controlFile="person/person.xml" testGroup="addOnePerson" />
-    
+
     <run controlFile="person/person.xml" testGroup="updatePerson" />
     <run controlFile="person/person.xml" testGroup="updatePerson" />
     <run controlFile="relation/relation.xml" testGroup="makeRelations" />
-   
+
     <run controlFile="person/person.xml" testGroup="updatePerson" autoDeletePOSTS="true"  />
     <run controlFile="person/person.xml" testGroup="updatePerson" autoDeletePOSTS="true"  />
-     
+
     <run controlFile="person/person.xml" testGroup="postPerson" />
     <run controlFile="relation/relation.xml" testGroup="makeRelationsNested" />
     -->
-    
+
     <!-- TODO: this almost works now:
     <run controlFile="security/security.xml" testGroup="security" />
-    --> 
-    
-    
+    -->
+
+
     <!-- TODO: make this an override: autoDeletePOSTS="true"-->
 
-    
+
     <!--  These all work with POX: -->
     <run controlFile="security/security.xml" testGroup="deleteBug" />
     <run controlFile="objectexit/object-exit.xml" testGroup="makeone" />
@@ -79,8 +79,9 @@
     <run controlFile="loanout/loanout.xml" testGroup="makeone" />
     <run controlFile="objectexit/object-exit.xml" testGroup="checkList" />
     <run controlFile="person/person.xml" testGroup="postPerson" />
-    
+
     <run controlFile="relation/relation.xml" testGroup="makeRelations" />
+    <run controlFile="relation/relation.xml" testGroup="makeCircularHierarchyRelations" />
     <run controlFile="relation/relation.xml" testGroup="r2only" />
     <run controlFile="person/person.xml" testGroup="postPerson" />
     <run controlFile="person/person.xml" testGroup="updatePerson" />
@@ -91,6 +92,6 @@
     <run controlFile="location/location-mixed-hierarchy.xml" testGroup="HierarchicLocation" />
     <run controlFile="batch/batch.xml" />
     <run controlFile="vocabulary/vocabulary.xml" testGroup="TestOrder" />
-    
+
 </xmlReplayMaster>
 
index 934e534f8ce7ecca51710148135d68fd82ebab04..124d830d23b6d12900f0418490731d3e1abf559a 100644 (file)
@@ -4,7 +4,7 @@
         <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
         <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
     </auths>
-   
+
     <testGroup ID="makeRelations" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
          <test ID="oe1">
              <method>POST</method>
              <uri>/cspace-services/objectexit/</uri>
              <filename>relation/oe1.xml</filename>
          </test>
+         <test ID="oe3">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <filename>relation/oe1.xml</filename>
+         </test>
          <test ID="relate1">
              <method>POST</method>
              <uri>/cspace-services/relations/</uri>
@@ -33,9 +38,8 @@
              <uri>/cspace-services/relations/</uri>
              <filename>relation/r-1.xml</filename>
              <vars>
-                <!-- switched oe2 and oe1 on this -->
                 <var ID="subjectCsid">${oe2.CSID}</var>
-                <var ID="objectCsid">${oe1.CSID}</var>
+                <var ID="objectCsid">${oe3.CSID}</var>
                 <var ID="subjectDocumentType">objectexit</var>
                 <var ID="objectDocumentType">objectexit</var>
                 <var ID="relationshipType">hasBroader</var>
              <method>GET</method>
              <uri>/cspace-services/relations/</uri>
          </test>
-         
-         <!--
-         <test>
-            <method>GET</method>
-            <uri>/cspace-services/personauthorities/${OrgAuth1.CSID}/items/${Org1.CSID}</uri>
-        </test>
-        -->
     </testGroup>
-    
+
+    <testGroup ID="makeCircularHierarchyRelations" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+         <test ID="oe1">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <filename>relation/oe1.xml</filename>
+         </test>
+         <test ID="oe2">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <filename>relation/oe1.xml</filename>
+         </test>
+         <test ID="relate1">
+             <method>POST</method>
+             <uri>/cspace-services/relations/</uri>
+             <filename>relation/r-1.xml</filename>
+             <vars>
+                <var ID="subjectCsid">${oe1.CSID}</var>
+                <var ID="objectCsid">${oe2.CSID}</var>
+                <var ID="subjectDocumentType">objectexit</var>
+                <var ID="objectDocumentType">objectexit</var>
+                <var ID="relationshipType">hasBroader</var>
+             </vars>
+         </test>
+         <test ID="relate2">
+             <method>POST</method>
+             <uri>/cspace-services/relations/</uri>
+             <filename>relation/r-1.xml</filename>
+             <vars>
+                <var ID="subjectCsid">${oe2.CSID}</var>
+                <var ID="objectCsid">${oe1.CSID}</var>
+                <var ID="subjectDocumentType">objectexit</var>
+                <var ID="objectDocumentType">objectexit</var>
+                <var ID="relationshipType">hasBroader</var>
+             </vars>
+             <!-- This would create a circular hierarchy, so expect it to fail. -->
+             <expectedCodes>400</expectedCodes>
+         </test>
+    </testGroup>
+
     <testGroup ID="makeRelationsNested" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
          <test ID="oe1">
              <method>POST</method>
              <uri>/cspace-services/relations/</uri>
          </test>
     </testGroup>
-         
+
     <testGroup ID="r2only" autoDeletePOSTS="true">
          <test ID="relate">
              <method>POST</method>
              <uri>/cspace-services/relations/</uri>
          </test>
     </testGroup>
-    
+
     <!-- Test whether a relation is automatically soft deleted -->
-    <!-- when a subject of the relation is deleted --> 
+    <!-- when a subject of the relation is deleted -->
     <testGroup ID="cascadeDeleteRelationsOnSubjectDelete" autoDeletePOSTS="true">
          <test ID="createSubject">
              <method>POST</method>
              </response>
          </test>
     </testGroup>
-    
+
     <!-- Test whether multiple relations are automatically soft deleted -->
     <!-- when an object of the relation is soft deleted. -->
     <testGroup ID="cascadeDeleteMultipleRelationsOnObjectDelete" autoDeletePOSTS="true">
              </response>
          </test>
     </testGroup>
-         
+
 </xmlReplay>
-        
-        
+
+
index 2ad228c2c0913f257adbcf79670b52f69b0e72b8..83d598153799b26c41ab03be508cb6c357253ef2 100644 (file)
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xmlReplayMaster>
     <protoHostPort>http://localhost:8180</protoHostPort>
-    
+
     <!-- legal values for dumpServiceResult=[minimal,detailed,full,auto] -->
     <dump payloads="false" dumpServiceResult="auto" />
-    
+
     <!-- Auth = Base64Encode("username:password") See https://www.base64encode.org/
                 For example:
                     Username = "grover"
     <auths default="admin@core.collectionspace.org">
         <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
     </auths>
-    
+
     <run controlFile="security/security-oauth.xml" />
     <run controlFile="security/security.xml" />
     <run controlFile="objectexit/object-exit.xml" testGroup="makeone" />
     <run controlFile="objectexit/object-exit.xml" testGroup="checkList" />
     <run controlFile="objectexit/object-exit-display.xml" testGroup="refNameDisplayNameOnly" />
+
     <run controlFile="collectionobject/collectionobject-adv-search.xml" testGroup="advSearchCommonSchema" />
     <run controlFile="collectionobject/collectionobject-adv-search.xml" testGroup="advSearchExtensionSchema" />
     <run controlFile="collectionobject/related/collectionobject-related.xml" />
-    
+
     <run controlFile="acquisitions/acquisitions.xml" testGroup="makeone" />
     <run controlFile="acquisitions/acquisitions.xml" testGroup="testList" />
     <run controlFile="relation/relation.xml" testGroup="makeRelations" />
+    <run controlFile="relation/relation.xml" testGroup="makeCircularHierarchyRelations" />
 
     <run controlFile="person/person.xml" testGroup="postPerson" />
     <run controlFile="person/person.xml" testGroup="updatePerson" />
@@ -36,7 +37,7 @@
 
     <run controlFile="location/location-hierarchy.xml" testGroup="HierarchicLocation" />
     <run controlFile="organization/organization-hierarchy.xml" testGroup="HierarchicOrganization" />
+
     <run controlFile="report/report.xml" />
     <run controlFile="authrefs/authrefs.xml" testGroup="AuthRefs" />
     <run controlFile="vocabulary/vocabulary.xml" />
     <run controlFile="authrefs/authrefsComplex.xml" testGroup="AuthRefsComplex" />
     <run controlFile="authority/authority.xml" testGroup="TestAuthoritiesMultiVocabSearch" />
        <run controlFile="authority/authority.xml" testGroup="TestAuthorityItemsWithContacts" />
-    
+
     <run controlFile="imports/imports.xml" testGroup="importsTestGroup" />
     <run controlFile="imports/imports.xml" testGroup="importsSeparateRepoTestGroup" />
 
     <run controlFile="collectionobject/collectionobject-hierarchy-csid.xml" testGroup="CreateUpdateReadStructuredObjects" />
     <run controlFile="collectionobject/collectionobject-hierarchy-refname.xml" testGroup="CreateUpdateReadStructuredObjects" />
     <run controlFile="collectionobject/collectionobject-displayname-update.xml" testGroup="DisplayNameChangesReflectedInRefNames" />
-    
+
     <run controlFile="versioning/versioning.xml" testGroup="VersionedRecordFiltering" />
-    
+
     <run controlFile="batch/batch.xml" testGroup="testSingle"/>
     <run controlFile="batch/batch.xml" testGroup="testPermissionsAndRoles"/>
-    
+
     <!-- Uncomment the following when needed to test the UpdateObjectLocationBatchJob -->
     <!-- which updates the computed current location values in CollectionObject records. -->
     <!-- For these tests to be meaningful, you will also first need to disable the event listener -->
     <run controlFile="batch/batch-update-object-loc.xml" testGroup="invocationModeGroup" />
     <run controlFile="batch/batch-update-object-loc.xml" testGroup="invocationModeSingleInVersioningEnabledTenant" />
     -->
-    
+
     <run controlFile="listener/listener-update-object-loc.xml" testGroup="updateObjectLocationOnMoveEventListener" />
-    <run controlFile="listener/listener-update-object-loc.xml" testGroup="updateObjectLocationOnMoveInVersioningEnabledTenant"/>    
+    <run controlFile="listener/listener-update-object-loc.xml" testGroup="updateObjectLocationOnMoveInVersioningEnabledTenant"/>
 
     <!-- Broken tests -->
-    
+
     <!-- FIXME: the following tests were commented out without any annotation as to why this was done. -->
     <!-- We might check whether any of these tests should be re-enabled - ADR 2012-09-07 -->
-    
+
     <!-- run controlFile="objectexit/object-exit.xml" testGroup="CRUDL" / -->
     <!-- run controlFile="objectexit/object-exit.xml" testGroup="domwalk" / -->
     <!-- run controlFile="media/media.xml" testGroup="authrefs" / -->
     <!-- run controlFile="./organization.xml" testGroup="organization" / -->
 
     <!-- Comments on broken tests, below, are historic, were written by various authors, and lack JIRA issue context. - ADR 2012-09-07 -->
-    
+
     <!-- No - this test is broken -->
     <!-- run controlFile="relation/relation.xml" testGroup="r2only" / -->
-    
+
     <!-- This used to work, but for check-in, I'm commenting it out as it currently breaks if things are left around in DB. -->
     <!-- run controlFile="security/security.xml" testGroup="security" / -->
 
@@ -98,6 +99,6 @@
     When the DB is cleaned with [ant create_db import] it runs OK.
     -->
     <!-- run controlFile="security/security.xml" testGroup="securityRemovingRoleperms" / -->
-    
+
 </xmlReplayMaster>