import org.collectionspace.services.acquisition.AcquisitionsCommon;
import org.collectionspace.services.acquisition.AcquisitionsCommonList;
+import org.collectionspace.services.acquisition.AcquisitionDateList;
import org.collectionspace.services.acquisition.AcquisitionSourceList;
import org.jboss.resteasy.client.ClientResponse;
if (logger.isDebugEnabled()) {
logger.debug(testBanner(testName, CLASS_NAME));
- };
+ }
// Perform setup, such as initializing the type of service request
// (e.g. CREATE, DELETE), its valid and expected status codes, and
if (logger.isDebugEnabled()) {
logger.debug(testBanner(testName, CLASS_NAME));
- };
+ }
// Perform setup.
setupRead();
client.getCommonPartName(), AcquisitionsCommon.class);
Assert.assertNotNull(acquisitionObject);
+ // Verify the number and contents of values in repeatable fields,
+ // as created in the instance record used for testing.
+ List<String> acqSources =
+ acquisitionObject.getAcquisitionSources().getAcquisitionSource();
+ Assert.assertTrue(acqSources.size() > 0);
+ Assert.assertNotNull(acqSources.get(0));
+
+ List<String> acqDates =
+ acquisitionObject.getAcquisitionDates().getAcquisitionDate();
+ Assert.assertTrue(acqDates.size() > 0);
+ Assert.assertNotNull(acqDates.get(0));
+
}
// Failure outcomes
if (logger.isDebugEnabled()) {
logger.debug(testBanner(testName, CLASS_NAME));
- };
+ }
// Perform setup.
setupReadNonExistent();
if (logger.isDebugEnabled()) {
logger.debug(testBanner(testName, CLASS_NAME));
- };
+ }
// Perform setup.
setupReadList();
if (logger.isDebugEnabled()) {
logger.debug(testBanner(testName, CLASS_NAME));
- };
+ }
// Perform setup.
setupUpdate();
if (logger.isDebugEnabled()) {
logger.debug(testBanner(testName, CLASS_NAME));
- };
+ }
// Perform setup.
setupUpdateNonExistent();
if (logger.isDebugEnabled()) {
logger.debug(testBanner(testName, CLASS_NAME));
- };
+ }
// Perform setup.
setupDeleteNonExistent();
AcquisitionsCommon acquisition = new AcquisitionsCommon();
acquisition.setAcquisitionReferenceNumber("acquisitionReferenceNumber-" + identifier);
AcquisitionSourceList acqSourcesList = new AcquisitionSourceList();
- List<String> sources = acqSourcesList.getAcquisitionSource();
- // @TODO Use properly formatted refNames for representative acquisition
+ List<String> acqSources = acqSourcesList.getAcquisitionSource();
+ // FIXME Use properly formatted refNames for representative acquisition
// sources in this example test record. The following are mere placeholders.
- sources.add("Donor Acquisition Source-" + identifier);
- sources.add("Museum Acquisition Source-" + identifier);
+ acqSources.add("Donor Acquisition Source-" + identifier);
+ acqSources.add("Museum Acquisition Source-" + identifier);
acquisition.setAcquisitionSources(acqSourcesList);
+ AcquisitionDateList acqDatesList = new AcquisitionDateList();
+ List<String> acqDates = acqDatesList.getAcquisitionDate();
+ // FIXME Use properly timestamps for representative acquisition
+ // dates in this example test record. The following are mere placeholders.
+ acqDates.add("First Acquisition Date -" + identifier);
+ acqDates.add("Second Acquisition Date-" + identifier);
+ acquisition.setAcquisitionDates(acqDatesList);
MultipartOutput multipart = new MultipartOutput();
OutputPart commonPart = multipart.addPart(acquisition,
MediaType.APPLICATION_XML_TYPE);
<xs:element name="accessionDate" type="xs:string"/>
<xs:element name="acquisitionAuthorizer" type="xs:string"/>
<xs:element name="acquisitionAuthorizerDate" type="xs:string"/>
- <xs:element name="acquisitionDate" type="xs:string"/>
+ <xs:element name="acquisitionDates" type="acquisitionDateList"/>
<xs:element name="acquisitionFundingCurrency" type="xs:string"/>
<xs:element name="acquisitionFundingValue" type="xs:string"/>
<xs:element name="acquisitionFundingSource" type="xs:string"/>
<xs:element name="acquisitionSource" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
+
+ <xs:complexType name="acquisitionDateList">
+ <xs:sequence>
+ <xs:element name="acquisitionDate" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
<!-- This is the base class for paginated lists -->
<xs:complexType name="abstractCommonList">