public String payloadStrictness = "";\r
public long contentLength = 0;\r
public String failureReason = "";\r
+ public String expectedContentExpanded = "";\r
public Header[] responseHeaders = new Header[0];\r
public List<Integer> expectedCodes = new ArrayList<Integer>();\r
public Map<String,String> vars = new HashMap<String,String>();\r
String expectedPartContent = new String(b);\r
Map<String,String> vars = expectedResponseParts.varsList.get(0); //just one part, so just one varsList. Must be there, even if empty.\r
expectedPartContent = evalStruct.eval(expectedPartContent, serviceResultsMap, vars, evalStruct.jexl, evalStruct.jc);\r
+ serviceResult.expectedContentExpanded = expectedPartContent;\r
String label = "NOLABEL";\r
String leftID = "{from expected part, label:"+label+" filename: "+expectedResponseParts.responseFilename+"}";\r
String rightID = "{from server, label:"+label\r
String key = entry.getKey();\r
try {\r
value = parse(value, jexl, jc);\r
+ vars.put(key, value); //replace template value with actual value.\r
} catch (Exception e){\r
value = "ERROR: "+e;\r
}\r
appendPayload(fb, serviceResult.requestPayload, "REQUEST", "REQUEST" + tocID);
appendPayload(fb, serviceResult.requestPayloadsRaw, "REQUEST (RAW)", "REQUESTRAW" + tocID);
appendPayload(fb, serviceResult.result, "RESPONSE", "RESPONSE" + tocID);
+ appendPayload(fb, serviceResult.expectedContentExpanded, "EXPECTED", "EXPECTED" + tocID);
fb.append(BR);
return fb.toString();
<run controlFile="organization/organization-hierarchy.xml" testGroup="HierarchicOrganization" />\r
<run controlFile="location/location-hierarchy.xml" testGroup="HierarchicLocation" />\r
<run controlFile="person/person.xml" testGroup="PersonAddRelsDeleteRels" />\r
+ <run controlFile="location/location-2-authorities.xml" testGroup="HierarchicLocation" />\r
+ <run controlFile="location/location-mixed-hierarchy.xml" testGroup="HierarchicLocation" />\r
+ <run controlFile="batch/batch.xml" />\r
+ <run controlFile="vocabulary/vocabulary.xml" testGroup="TestOrder" />\r
\r
</xmlReplayMaster>\r
\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="vocabularies">
+ <ns3:vocabularies_common xmlns:ns3="http://collectionspace.org/services/vocabulary"
+ xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <displayName>TestOrder Vocabulary</displayName>
+ <shortIdentifier>TestOrderVocab</shortIdentifier>
+ <refName>
+ urn:cspace:org.collectionspace.demo:vocabulary:name(TestOrderVocab)'TestOrder Vocabulary'</refName>
+ <vocabType>enum</vocabType>
+ </ns3:vocabularies_common>
+</document>
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="vocabularyitems">
+ <ns3:vocabularyitems_common xmlns:ns3="http://collectionspace.org/services/vocabulary"
+ xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <displayName>${displayName}</displayName>
+ <shortIdentifier>${itemID}</shortIdentifier>
+ <refName>urn:cspace:org.collectionspace.demo:vocabulary:name(TestOrderVocab):item:name(${itemID})'${displayName}'</refName>
+ <order>${order}</order>
+ </ns3:vocabularyitems_common>
+</document>
+
--- /dev/null
+<ns3:vocabularyitems-common-list xmlns:ns3="http://collectionspace.org/services/vocabulary" xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <!-- This test result is dependent on test group vocabulary/vocabulary.xml::TestOrder
+ and the vars defined there.
+ Do not use this expected result with any other tests.
+ -->
+ <pageNum>0</pageNum>
+ <itemsInPage>3</itemsInPage>
+ <totalItems>3</totalItems>
+ <fieldsReturned>displayName|refName|shortIdentifier|order|uri|csid</fieldsReturned>
+ <vocabularyitem_list_item>
+ <displayName>${Item3DupeOrder.displayName}</displayName>
+ <shortIdentifier>${Item3DupeOrder.itemID}</shortIdentifier>
+ <order>${Item3DupeOrder.order}</order>
+ <uri>/vocabularies/${Vocabulary1.CSID}/items/${Item3DupeOrder.CSID}</uri>
+ <csid>${Item3DupeOrder.CSID}</csid>
+ </vocabularyitem_list_item>
+ <vocabularyitem_list_item>
+ <displayName>${Item2.displayName}</displayName>
+ <shortIdentifier>${Item2.itemID}</shortIdentifier>
+ <order>${Item2.order}</order>
+ <uri>/vocabularies/${Vocabulary1.CSID}/items/${Item2.CSID}</uri>
+ <csid>${Item2.CSID}</csid>
+ </vocabularyitem_list_item>
+ <vocabularyitem_list_item>
+ <displayName>${Item1.displayName}</displayName>
+ <shortIdentifier>${Item1.itemID}</shortIdentifier>
+ <order>${Item1.order}</order>
+ <uri>/vocabularies/${Vocabulary1.CSID}/items/${Item1.CSID}</uri>
+ <csid>${Item1.CSID}</csid>
+ </vocabularyitem_list_item>
+</ns3:vocabularyitems-common-list>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplay>
+ <auths>
+ <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
+ <auth ID="admin@collectionspace.org">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
+ <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
+ </auths>
+ <testGroup ID="TestOrder" autoDeletePOSTS="true">
+ <!-- The purpose of this testGroup is to test the new "order" field
+ that was added in http://issues.collectionspace.org/browse/CSPACE-573
+ and to ensure that this order field is returned in list results,
+ and that duplicate values for the order field is accepted.
+ -->
+ <test ID="Vocabulary1" auth="test">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/</uri>
+ <filename>vocabulary/1-vocab.xml</filename>
+ </test>
+ <test ID="Item1" auth="test">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/${Vocabulary1.CSID}/items/</uri>
+ <filename>vocabulary/2-item.xml</filename>
+ <vars>
+ <var ID="itemID">VocabItem1</var>
+ <var ID="order">1</var>
+ <var ID="displayName">TestOrder item ${itemID} order ${order}</var>
+ </vars>
+ </test>
+ <test ID="Item2" auth="test">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/${Vocabulary1.CSID}/items/</uri>
+ <filename>vocabulary/2-item.xml</filename>
+ <vars>
+ <var ID="itemID">VocabItem2</var>
+ <var ID="order">2</var>
+ <var ID="displayName">TestOrder item ${itemID} order ${order}</var>
+ </vars>
+ </test>
+ <test ID="Item3DupeOrder" auth="test">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/${Vocabulary1.CSID}/items/</uri>
+ <filename>vocabulary/2-item.xml</filename>
+ <vars>
+ <var ID="itemID">VocabItem3</var>
+ <var ID="order">1</var>
+ <var ID="displayName">TestOrder item ${itemID} order ${order}</var>
+ </vars>
+ </test>
+
+ <test ID="GetVocabularies" auth="admin@collectionspace.org">
+ <method>GET</method>
+ <uri>/cspace-services/vocabularies/</uri>
+ </test>
+
+ <test ID="GetVocabularyItems" auth="admin@collectionspace.org">
+ <method>GET</method>
+ <uri>/cspace-services/vocabularies/${Vocabulary1.CSID}/items/</uri>
+ <response>
+ <expected level="ADDOK" />
+ <filename>vocabulary/res/GetVocabularyItems.res.xml</filename>
+ <vars>
+ <var ID="I3displayName">${Item3DupeOrder.displayName}</var>
+ </vars>
+ <!--<startElement>//vocabulary-list-item[./exitNumber='checkList-1234']</startElement>-->
+ </response>
+ </test>
+
+ </testGroup>
+</xmlReplay>
+
<run controlFile="person/person.xml" testGroup="PersonAddRelsDeleteRels" />\r
<run controlFile="location/location-hierarchy.xml" testGroup="HierarchicLocation" />\r
<run controlFile="organization/organization-hierarchy.xml" testGroup="HierarchicOrganization" />\r
- <run controlFile="batch/batch.xml" />\r
- \r
+ <run controlFile="batch/batch.xml" />\r
+ <run controlFile="vocabulary/vocabulary.xml" testGroup="TestOrder" />\r
\r
\r
</xmlReplayMaster>\r