From ab3e65b9acfaa01cd6af74723424ae6e0a8585a2 Mon Sep 17 00:00:00 2001 From: Richard Millet Date: Tue, 15 Feb 2011 23:58:56 +0000 Subject: [PATCH] CSPACE-3574: Merging Plain Old XML payload work into trunk. --- services/PerformanceTests/.classpath | 324 +++++++++++++++++- services/PerformanceTests/.project | 19 +- .../PerformanceTests/test/I1591Multiple.java | 8 +- .../PerformanceTests/test/I1591OneInst.java | 8 +- .../test/I1591OneInstOneClose.java | 8 +- .../test/PerformanceTest.java | 12 +- 6 files changed, 349 insertions(+), 30 deletions(-) diff --git a/services/PerformanceTests/.classpath b/services/PerformanceTests/.classpath index 425cd1620..34f3c13d3 100644 --- a/services/PerformanceTests/.classpath +++ b/services/PerformanceTests/.classpath @@ -1,10 +1,318 @@ - - - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/services/PerformanceTests/.project b/services/PerformanceTests/.project index 0736bc15c..722093df2 100644 --- a/services/PerformanceTests/.project +++ b/services/PerformanceTests/.project @@ -1,31 +1,34 @@ - org.collectionspace.services.PerformanceTests - + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. - org.collectionspace.services.jaxb + org.collectionspace.services.3rdparty.nuxeo.quote-api org.collectionspace.services.client org.collectionspace.services.collectionobject.client org.collectionspace.services.collectionobject.jaxb org.collectionspace.services.common + org.collectionspace.services.contact.client + org.collectionspace.services.contact.jaxb + org.collectionspace.services.hyperjaxb org.collectionspace.services.intake.client org.collectionspace.services.intake.jaxb + org.collectionspace.services.jaxb + org.collectionspace.services.organization.client + org.collectionspace.services.organization.jaxb + org.collectionspace.services.person.client + org.collectionspace.services.person.jaxb org.collectionspace.services.relation.client org.eclipse.jdt.core.javabuilder - - org.maven.ide.eclipse.maven2Builder - - org.maven.ide.eclipse.maven2Nature org.eclipse.jdt.core.javanature - + \ No newline at end of file diff --git a/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/I1591Multiple.java b/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/I1591Multiple.java index 53c1bb064..d77d03b3d 100644 --- a/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/I1591Multiple.java +++ b/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/I1591Multiple.java @@ -37,6 +37,8 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; import org.jboss.resteasy.plugins.providers.multipart.OutputPart; import org.collectionspace.services.client.CollectionObjectClient; +import org.collectionspace.services.client.PayloadOutputPart; +import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.collectionobject.CollectionobjectsCommon; /** @@ -84,9 +86,9 @@ public class I1591Multiple extends CollectionSpacePerformanceTest { fillCollectionObject(co, Long.toString(identifier)); // Assign it to the Common part of a multipart payload. - MultipartOutput multipart = new MultipartOutput(); - OutputPart commonPart = multipart.addPart(co, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", COLLECTION_OBJECT_COMMON_PART_NAME); + PoxPayloadOut multipart = new PoxPayloadOut(CollectionObjectClient.SERVICE_PAYLOAD_NAME); + PayloadOutputPart commonPart = multipart.addPart(co, MediaType.APPLICATION_XML_TYPE); + commonPart.setLabel(collectionObjectClient.getCommonPartName()); // Make a create call with that payload and check the response. ClientResponse response = collectionObjectClient.create(multipart); diff --git a/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/I1591OneInst.java b/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/I1591OneInst.java index ea0623939..6dfb2d1b7 100644 --- a/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/I1591OneInst.java +++ b/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/I1591OneInst.java @@ -37,6 +37,8 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; import org.jboss.resteasy.plugins.providers.multipart.OutputPart; import org.collectionspace.services.client.CollectionObjectClient; +import org.collectionspace.services.client.PayloadOutputPart; +import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.collectionobject.CollectionobjectsCommon; /** @@ -85,9 +87,9 @@ public class I1591OneInst extends CollectionSpacePerformanceTest { fillCollectionObject(co, Long.toString(identifier)); // Assign it to the Common part of a multipart payload. - MultipartOutput multipart = new MultipartOutput(); - OutputPart commonPart = multipart.addPart(co, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", COLLECTION_OBJECT_COMMON_PART_NAME); + PoxPayloadOut multipart = new PoxPayloadOut(CollectionObjectClient.SERVICE_PAYLOAD_NAME); + PayloadOutputPart commonPart = multipart.addPart(co, MediaType.APPLICATION_XML_TYPE); + commonPart.setLabel(collectionObjectClient.getCommonPartName()); // Make a create call with that payload and check the response. ClientResponse response = collectionObjectClient.create(multipart); diff --git a/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/I1591OneInstOneClose.java b/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/I1591OneInstOneClose.java index a83c38565..1e7eccb08 100644 --- a/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/I1591OneInstOneClose.java +++ b/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/I1591OneInstOneClose.java @@ -37,6 +37,8 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; import org.jboss.resteasy.plugins.providers.multipart.OutputPart; import org.collectionspace.services.client.CollectionObjectClient; +import org.collectionspace.services.client.PayloadOutputPart; +import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.collectionobject.CollectionobjectsCommon; /** @@ -88,9 +90,9 @@ public class I1591OneInstOneClose extends CollectionSpacePerformanceTest { fillCollectionObject(co, Long.toString(identifier)); // Assign it to the Common part of a multipart payload. - MultipartOutput multipart = new MultipartOutput(); - OutputPart commonPart = multipart.addPart(co, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", COLLECTION_OBJECT_COMMON_PART_NAME); + PoxPayloadOut multipart = new PoxPayloadOut(CollectionObjectClient.SERVICE_PAYLOAD_NAME); + PayloadOutputPart commonPart = multipart.addPart(co, MediaType.APPLICATION_XML_TYPE); + commonPart.setLabel(collectionObjectClient.getCommonPartName()); // Make a create call with that payload and check the response. response = collectionObjectClient.create(multipart); diff --git a/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/PerformanceTest.java b/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/PerformanceTest.java index 96a52ca4a..100ba5263 100644 --- a/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/PerformanceTest.java +++ b/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/PerformanceTest.java @@ -43,6 +43,8 @@ import org.jboss.resteasy.util.HttpResponseCodes; import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.client.CollectionObjectClient; +import org.collectionspace.services.client.PayloadOutputPart; +import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.collectionobject.CollectionobjectsCommon; import org.collectionspace.services.collectionobject.CollectionobjectsCommonList; import org.collectionspace.services.collectionobject.CollectionobjectsCommonList.CollectionObjectListItem; @@ -175,7 +177,7 @@ public class PerformanceTest extends CollectionSpacePerformanceTest { * @return the string */ private String createCollectionObject(CollectionObjectClient collectionObjectClient, - MultipartOutput multipart) { + PoxPayloadOut multipart) { String result = null; // Make the create call and check the response ClientResponse response = collectionObjectClient.create(multipart); @@ -214,9 +216,9 @@ public class PerformanceTest extends CollectionSpacePerformanceTest { fillCollectionObject(co, Long.toString(System.currentTimeMillis())); // Next, create a part object - MultipartOutput multipart = new MultipartOutput(); - OutputPart commonPart = multipart.addPart(co, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", collectionObjectClient.getCommonPartName()); + PoxPayloadOut multipart = new PoxPayloadOut(CollectionObjectClient.SERVICE_PAYLOAD_NAME); + PayloadOutputPart commonPart = multipart.addPart(co, MediaType.APPLICATION_XML_TYPE); + commonPart.setLabel(collectionObjectClient.getCommonPartName()); int createdObjects = 0; try { @@ -255,7 +257,7 @@ public class PerformanceTest extends CollectionSpacePerformanceTest { */ private void readCollectionObject(CollectionObjectClient collectionObjectClient, String resourceId) { - ClientResponse res = collectionObjectClient.read(resourceId); + ClientResponse res = collectionObjectClient.read(resourceId); res.releaseConnection(); } -- 2.47.3