From 7c1c0944f7e0c6b5ce792747930c97372da64dfe Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Mon, 30 Nov 2009 22:06:32 +0000 Subject: [PATCH] CSPACE-620,CSPACE-379: Extended CollectionObjectServiceTest to test our provided example of a domain-specific schema extension. Renamed element in JAXB schema and label name in client tests from collection-object-naturalhistory to collectionobjects_naturalhistory to fix marshalling errors. --- .../test/CollectionObjectServiceTest.java | 20 +++++++++++++++---- .../collectionobjects_naturalhistory.xsd | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java b/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java index bfca1da89..d1d3df06c 100644 --- a/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java +++ b/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java @@ -28,7 +28,7 @@ import javax.ws.rs.core.Response; import org.collectionspace.services.client.CollectionObjectClient; import org.collectionspace.services.collectionobject.CollectionobjectsCommon; -import org.collectionspace.services.collectionobject.domain.naturalhistory.CollectionObjectNaturalhistory; +import org.collectionspace.services.collectionobject.domain.naturalhistory.CollectionobjectsNaturalhistory; import org.collectionspace.services.collectionobject.CollectionobjectsCommonList; import org.collectionspace.services.collectionobject.OtherNumberList; import org.jboss.resteasy.client.ClientResponse; @@ -239,10 +239,22 @@ public class CollectionObjectServiceTest extends AbstractServiceTest { Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); MultipartInput input = (MultipartInput) res.getEntity(); + + if (logger.isDebugEnabled()) { + logger.debug(testName + ": Reading Common part ..."); + } CollectionobjectsCommon collectionObject = (CollectionobjectsCommon) extractPart(input, client.getCommonPartName(), CollectionobjectsCommon.class); Assert.assertNotNull(collectionObject); + + if (logger.isDebugEnabled()) { + logger.debug(testName + ": Reading Natural History part ..."); + } + CollectionobjectsNaturalhistory conh = + (CollectionobjectsNaturalhistory) extractPart(input, + getNHPartName(), CollectionobjectsNaturalhistory.class); + Assert.assertNotNull(conh); } // Failure outcomes @@ -616,7 +628,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTest { CollectionobjectsCommon.class)); } - CollectionObjectNaturalhistory conh = new CollectionObjectNaturalhistory(); + CollectionobjectsNaturalhistory conh = new CollectionobjectsNaturalhistory(); conh.setNhString("test-string"); conh.setNhInt(999); conh.setNhLong(9999); @@ -626,13 +638,13 @@ public class CollectionObjectServiceTest extends AbstractServiceTest { if (logger.isDebugEnabled()) { logger.debug("to be created, collectionobject nhistory"); logger.debug(objectAsXmlString(conh, - CollectionObjectNaturalhistory.class)); + CollectionobjectsNaturalhistory.class)); } return multipart; } private String getNHPartName() { - return "collectionobjects-naturalhistory"; + return "collectionobjects_naturalhistory"; } } diff --git a/services/collectionobject/jaxb/src/main/resources/collectionobjects_naturalhistory.xsd b/services/collectionobject/jaxb/src/main/resources/collectionobjects_naturalhistory.xsd index ac39cb0e5..01c3b7d19 100644 --- a/services/collectionobject/jaxb/src/main/resources/collectionobjects_naturalhistory.xsd +++ b/services/collectionobject/jaxb/src/main/resources/collectionobjects_naturalhistory.xsd @@ -19,7 +19,7 @@ version="0.1" > - + -- 2.47.3