From ea30daf91d999c017e7573bdea27842505626d44 Mon Sep 17 00:00:00 2001 From: Jesse Martinez Date: Wed, 6 Feb 2013 09:49:19 -0500 Subject: [PATCH] adding work authority code. all unit tests pass --- services/JaxRsServiceProvider/pom.xml | 5 + .../CollectionSpaceJaxRsApplication.java | 2 + services/build.xml | 3 + .../tenants/tenant-bindings-proto.xml | 164 ++++ services/pom.xml | 1 + services/relation/service/pom.xml | 5 + .../nuxeo/RelationDocumentModelHandler.java | 1 + services/work/3rdparty/build.xml | 131 +++ .../3rdparty/nuxeo-platform-cs-work/build.xml | 149 ++++ .../3rdparty/nuxeo-platform-cs-work/pom.xml | 43 + .../src/main/resources/META-INF/MANIFEST.MF | 22 + .../resources/OSGI-INF/core-types-contrib.xml | 30 + .../OSGI-INF/deployment-fragment.xml | 408 ++++++++++ .../resources/OSGI-INF/ecm-types-contrib.xml | 53 ++ .../resources/OSGI-INF/layouts-contrib.xml | 240 ++++++ .../resources/OSGI-INF/life-cycle-contrib.xml | 12 + .../schemas/workauthorities_common.xsd | 32 + .../main/resources/schemas/works_common.xsd | 144 ++++ services/work/3rdparty/pom.xml | 23 + services/work/build.xml | 131 +++ services/work/client/pom.xml | 91 +++ .../services/client/WorkAuthorityClient.java | 72 ++ .../client/WorkAuthorityClientUtils.java | 294 +++++++ .../services/client/WorkAuthorityProxy.java | 11 + .../client/test/WorkAuthorityServiceTest.java | 525 ++++++++++++ .../src/test/resources/log4j.properties | 23 + services/work/installer/build.xml | 61 ++ services/work/jaxb/pom.xml | 60 ++ .../services/WorkJAXBSchema.java | 42 + .../jaxb/src/main/resources/work_common.xsd | 171 ++++ .../main/resources/workauthority_common.xsd | 47 ++ services/work/output.txt | 744 ++++++++++++++++++ services/work/pom.xml | 41 + services/work/service/pom.xml | 146 ++++ .../services/work/WorkAuthorityResource.java | 69 ++ .../work/nuxeo/WorkAuthorityConstants.java | 35 + .../WorkAuthorityDocumentModelHandler.java | 55 ++ .../services/work/nuxeo/WorkConstants.java | 35 + .../work/nuxeo/WorkDocumentModelHandler.java | 114 +++ .../work/nuxeo/WorkValidatorHandler.java | 148 ++++ 40 files changed, 4383 insertions(+) create mode 100644 services/work/3rdparty/build.xml create mode 100644 services/work/3rdparty/nuxeo-platform-cs-work/build.xml create mode 100644 services/work/3rdparty/nuxeo-platform-cs-work/pom.xml create mode 100644 services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/META-INF/MANIFEST.MF create mode 100644 services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/core-types-contrib.xml create mode 100644 services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/deployment-fragment.xml create mode 100644 services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/ecm-types-contrib.xml create mode 100644 services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/layouts-contrib.xml create mode 100644 services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/life-cycle-contrib.xml create mode 100644 services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/schemas/workauthorities_common.xsd create mode 100644 services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/schemas/works_common.xsd create mode 100644 services/work/3rdparty/pom.xml create mode 100644 services/work/build.xml create mode 100644 services/work/client/pom.xml create mode 100644 services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClient.java create mode 100644 services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClientUtils.java create mode 100644 services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityProxy.java create mode 100644 services/work/client/src/test/java/org/collectionspace/services/client/test/WorkAuthorityServiceTest.java create mode 100644 services/work/client/src/test/resources/log4j.properties create mode 100644 services/work/installer/build.xml create mode 100644 services/work/jaxb/pom.xml create mode 100644 services/work/jaxb/src/main/java/org/collectionspace/services/WorkJAXBSchema.java create mode 100644 services/work/jaxb/src/main/resources/work_common.xsd create mode 100644 services/work/jaxb/src/main/resources/workauthority_common.xsd create mode 100644 services/work/output.txt create mode 100644 services/work/pom.xml create mode 100644 services/work/service/pom.xml create mode 100644 services/work/service/src/main/java/org/collectionspace/services/work/WorkAuthorityResource.java create mode 100644 services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkAuthorityConstants.java create mode 100644 services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkAuthorityDocumentModelHandler.java create mode 100644 services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkConstants.java create mode 100644 services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkDocumentModelHandler.java create mode 100644 services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkValidatorHandler.java diff --git a/services/JaxRsServiceProvider/pom.xml b/services/JaxRsServiceProvider/pom.xml index a0f770987..87565ca70 100644 --- a/services/JaxRsServiceProvider/pom.xml +++ b/services/JaxRsServiceProvider/pom.xml @@ -173,6 +173,11 @@ org.collectionspace.services.place.service ${project.version} + + org.collectionspace.services + org.collectionspace.services.work.service + ${project.version} + org.collectionspace.services org.collectionspace.services.concept.service diff --git a/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java b/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java index f2e3aca03..ff2638176 100644 --- a/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java +++ b/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java @@ -38,6 +38,7 @@ import org.collectionspace.services.batch.BatchResource; import org.collectionspace.services.imports.ImportsResource; import org.collectionspace.services.location.LocationAuthorityResource; import org.collectionspace.services.place.PlaceAuthorityResource; +import org.collectionspace.services.work.WorkAuthorityResource; import org.collectionspace.services.concept.ConceptAuthorityResource; import org.collectionspace.services.taxonomy.TaxonomyAuthorityResource; import org.collectionspace.services.movement.MovementResource; @@ -114,6 +115,7 @@ public class CollectionSpaceJaxRsApplication extends Application addResourceToMapAndSingletons(new ConceptAuthorityResource()); addResourceToMapAndSingletons(new TaxonomyAuthorityResource()); addResourceToMapAndSingletons(new PlaceAuthorityResource()); + addResourceToMapAndSingletons(new WorkAuthorityResource()); addResourceToMapAndSingletons(new AcquisitionResource()); addResourceToMapAndSingletons(new ContactResource()); addResourceToMapAndSingletons(new CollectionObjectResource()); diff --git a/services/build.xml b/services/build.xml index 5e4bde136..a01573126 100644 --- a/services/build.xml +++ b/services/build.xml @@ -172,6 +172,7 @@ + @@ -198,6 +199,7 @@ + @@ -250,6 +252,7 @@ + diff --git a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml index ce50d0750..e263015e7 100644 --- a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml +++ b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml @@ -2662,6 +2662,170 @@ + + + + + + default-domain + org.collectionspace.services.work.nuxeo.WorkAuthorityDocumentModelHandler + + + + + displayName + displayName + + + shortIdentifier + shortIdentifier + + + vocabType + vocabType + + + + + + org.collectionspace.services.common.init.AddIndices + + + workauthorities_common + displayname + + + workauthorities_common + shortidentifier + + + + + + + + + + + + + + + + + + + + + + + + + + default-domain + org.collectionspace.services.work.nuxeo.WorkDocumentModelHandler + + + + + + + + org.collectionspace.services.work.nuxeo.WorkValidatorHandler + + org.collectionspace.services.common.init.AddIndices + + + works_common + inauthority + + + worktermgroup + termdisplayname + + + works_common + shortidentifier + + + + + + objectNameProperty + workTermGroupList/[0]/termDisplayName + + + objectNumberProperty + shortIdentifier + + + + + + + + + + + + + authRef + creatorGroupList/*/creator + + + authRef + publisherGroupList/*/publisher + + + + termRef + creatorGroupList/*/creatorType + + + termRef + publisherGroupList/*/publisherType + + + termRef + workType + + + termRef + workTermGroupList/*/termType + + + termRef + workTermGroupList/*/termStatus + + + termRef + workTermGroupList/*/termLanguage + + + termRef + workTermGroupList/*/termSource + + + + + + + + + + + + + + + diff --git a/services/pom.xml b/services/pom.xml index abc587c1a..9f200fd81 100644 --- a/services/pom.xml +++ b/services/pom.xml @@ -63,6 +63,7 @@ imports location place + work concept taxonomy movement diff --git a/services/relation/service/pom.xml b/services/relation/service/pom.xml index 11a9fa8c2..51c52754c 100644 --- a/services/relation/service/pom.xml +++ b/services/relation/service/pom.xml @@ -59,6 +59,11 @@ org.collectionspace.services.place.client ${project.version} + + org.collectionspace.services + org.collectionspace.services.work.client + ${project.version} + org.collectionspace.services org.collectionspace.services.taxonomy.client diff --git a/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java b/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java index 2b5e22c14..44e24b958 100644 --- a/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java +++ b/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java @@ -56,6 +56,7 @@ import org.collectionspace.services.client.OrgAuthorityClient; import org.collectionspace.services.client.LocationAuthorityClient; import org.collectionspace.services.client.TaxonomyAuthorityClient; import org.collectionspace.services.client.PlaceAuthorityClient; +import org.collectionspace.services.client.WorkAuthorityClient; import org.collectionspace.services.client.ConceptAuthorityClient; import org.collectionspace.services.client.workflow.WorkflowClient; diff --git a/services/work/3rdparty/build.xml b/services/work/3rdparty/build.xml new file mode 100644 index 000000000..579742c5c --- /dev/null +++ b/services/work/3rdparty/build.xml @@ -0,0 +1,131 @@ + + + + work service 3rdparty + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/build.xml b/services/work/3rdparty/nuxeo-platform-cs-work/build.xml new file mode 100644 index 000000000..63c936c78 --- /dev/null +++ b/services/work/3rdparty/nuxeo-platform-cs-work/build.xml @@ -0,0 +1,149 @@ + + + + work nuxeo document type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/pom.xml b/services/work/3rdparty/nuxeo-platform-cs-work/pom.xml new file mode 100644 index 000000000..8f98b996e --- /dev/null +++ b/services/work/3rdparty/nuxeo-platform-cs-work/pom.xml @@ -0,0 +1,43 @@ + + + org.collectionspace.services + org.collectionspace.services.work.3rdparty + 3.2-SNAPSHOT + + + 4.0.0 + org.collectionspace.services + org.collectionspace.services.work.3rdparty.nuxeo + services.work.3rdparty.nuxeo + jar + + Work Nuxeo Document Type + + + + + + src/main/resources + true + + + + + org.apache.maven.plugins + maven-jar-plugin + + + src/main/resources/META-INF/MANIFEST.MF + + ${eclipseVersion} + 2 + + + + + + + + diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/META-INF/MANIFEST.MF b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/META-INF/MANIFEST.MF new file mode 100644 index 000000000..988d8906c --- /dev/null +++ b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 1 +Bundle-Name: NuxeoCS +Bundle-SymbolicName: org.collectionspace.work;singleton:=true +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Bundle-Vendor: Nuxeo +Require-Bundle: org.nuxeo.runtime, + org.nuxeo.ecm.core.api, + org.nuxeo.ecm.core, + org.nuxeo.ecm.core.api, + org.nuxeo.ecm.platform.types.api, + org.nuxeo.ecm.platform.versioning.api, + org.nuxeo.ecm.platform.ui, + org.nuxeo.ecm.platform.forms.layout.client, + org.nuxeo.ecm.platform.ws, + org.collectionspace.collectionspace_core +Provide-Package: org.collectionspace.work +Nuxeo-Component: OSGI-INF/core-types-contrib.xml, + OSGI-INF/life-cycle-contrib.xml, + OSGI-INF/ecm-types-contrib.xml, + OSGI-INF/layouts-contrib.xml diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/core-types-contrib.xml b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/core-types-contrib.xml new file mode 100644 index 000000000..daf074d8a --- /dev/null +++ b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/core-types-contrib.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + works_common:workTermGroupList/0/termDisplayName + works_common:refName + works_common:shortIdentifier + + + + diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/deployment-fragment.xml b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/deployment-fragment.xml new file mode 100644 index 000000000..8bbdd72b6 --- /dev/null +++ b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/deployment-fragment.xml @@ -0,0 +1,408 @@ + + + + + + ${bundle.fileName} + + + + + nuxeo.war + /nuxeo + + + + + + + + + + + + Seam Context Filter + /ws/FileManageWS + + + + Seam Context Filter + /DocumentManagerWS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #{currentServerLocation.name}/#{currentTabAction.label} + + + + Create new document in #{currentDocument.name} + + + + Create new document in #{currentDocument.name} + + + + breadcrumb=command.user_dashboard + + + + breadcrumb=command.manageMembers + + + + breadcrumb=command.manageMembers + + + + breadcrumb=title.orgauthorities + + + + breadcrumb=command.advancedSearch + + + + + + en + en_GB + en_US + fr + de + es + it + ar + ru + ja + vn + + + messages + + + + config/addWorkspace.jpdl.xml + + + + + + generic_error_page + /generic_error_page.xhtml + + + + + generic_message_page + /generic_message_page.xhtml + + + + + home + /nxstartup.xhtml + + + + + user_login + /login.xhtml + + + + + user_logout + /logout.xhtml + + + + + view_servers + /view_servers.xhtml + + + + + + + view_domains + /view_domains.xhtml + + + + + select_document_type + /select_document_type.xhtml + + + + + create_document + /create_document.xhtml + + + + + edit_document + /edit_document.xhtml + + + + + view_documents + /view_documents.xhtml + + + + + create_file + /create_file.xhtml + + + + + create_workspace_wizard + /createWorkspaceWizard.xhtml + + + + + send_email + /document_email.xhtml + + + + + + view_workspaces + /view_workspaces.xhtml + + + + + + create_domain + /create_domain.xhtml + + + + + + edit_domain + /edit_domain.xhtml + + + + + + create_workspace + /create_workspace.xhtml + + + + + + edit_workspace + /edit_workspace.xhtml + + + + + + + members_management + /members_management.xhtml + + + + + view_users + /view_users.xhtml + + + + + view_many_users + /view_many_users.xhtml + + + + + edit_user + /edit_user.xhtml + + + + + edit_user_password + /edit_user_password.xhtml + + + + + view_user + /view_user.xhtml + + + + + create_user + /create_user.xhtml + + + + + view_groups + /view_groups.xhtml + + + + + view_group + /view_group.xhtml + + + + + edit_group + /edit_group.xhtml + + + + + create_group + /create_group.xhtml + + + + + view_orgauthorities + /view_orgauthorities.xhtml + + + + + view_orgauthority + /view_orgauthority.xhtml + + + + + + + search_form + /search/search_form.xhtml + + + + + search_results_nxql + /search/search_results_nxql.xhtml + + + + + search_results_advanced + + /search/search_results_advanced.xhtml + + + + + + search_results_simple + /search/search_results_simple.xhtml + + + + + + + clipboard + /incl/clipboard.xhtml + + + + + user_dashboard + /user_dashboard.xhtml + + + + + select_workspace_template + /select_workspace_template.xhtml + + + + + pdf_generation_error + /pdf_generation_error.xhtml + + + + + mass_edit + /massedit_documents.xhtml + + + + + mass_edit_confirm + /massedit_documents_preview.xhtml + + + + + + diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/ecm-types-contrib.xml b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/ecm-types-contrib.xml new file mode 100644 index 000000000..214104ec9 --- /dev/null +++ b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/ecm-types-contrib.xml @@ -0,0 +1,53 @@ + + + + + + + view_documents + + + heading + csworkauthority + + + + + + Workauthority + + + + + + Workauthority + + + + + + + + + view_documents + + + heading + work + + + + + + Work + + + + + + Work + + + + + diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/layouts-contrib.xml b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/layouts-contrib.xml new file mode 100644 index 000000000..4327cd542 --- /dev/null +++ b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/layouts-contrib.xml @@ -0,0 +1,240 @@ + + + + + + + + + + + + displayName + shortIdentifier + refName + vocabType + + + + + + + true + + displayName + + + dataInputText + + + + + + + + true + + shortIdentifier + + + dataInputText + + + + + + + + true + + refName + + + dataInputText + + + + + + + + true + + vocabType + + + dataInputText + + + + + + + + + + + + + + inAuthority + shortIdentifier + refName + displayName + displayNameComputed + name + conditionNote + conditionNoteDate + securityNote + workType + status + + + + + + + true + + inAuthority + + + dataInputText + + + + + + + + true + + shortIdentifier + + + dataInputText + + + + + + + + true + + refName + + + dataInputText + + + + + + + + true + + displayName + + + dataInputText + + + + + + + + true + + displayNameComputed + + + dataInputText + + + + + + + + true + + name + + + dataInputText + + + + + + + + true + + conditionNote + + + dataInputText + + + + + + + + true + + conditionNoteDate + + + dataInputText + + + + + + + + true + + securityNote + + + dataInputText + + + + + + + + true + + workType + + + dataInputText + + + + + + + + true + + status + + + dataInputText + + + + + + diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/life-cycle-contrib.xml b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/life-cycle-contrib.xml new file mode 100644 index 000000000..d2db5418e --- /dev/null +++ b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/life-cycle-contrib.xml @@ -0,0 +1,12 @@ + + + + + + ${Lifecycle} + ${Lifecycle} + + + + diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/schemas/workauthorities_common.xsd b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/schemas/workauthorities_common.xsd new file mode 100644 index 000000000..8a0e95c90 --- /dev/null +++ b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/schemas/workauthorities_common.xsd @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/schemas/works_common.xsd b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/schemas/works_common.xsd new file mode 100644 index 000000000..76fc28043 --- /dev/null +++ b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/schemas/works_common.xsd @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/services/work/3rdparty/pom.xml b/services/work/3rdparty/pom.xml new file mode 100644 index 000000000..97bce69ea --- /dev/null +++ b/services/work/3rdparty/pom.xml @@ -0,0 +1,23 @@ + + + + org.collectionspace.services + org.collectionspace.services.work + 3.2-SNAPSHOT + + + 4.0.0 + org.collectionspace.services + org.collectionspace.services.work.3rdparty + services.work.3rdparty + pom + + 3rd party build for work service + + + + nuxeo-platform-cs-work + + diff --git a/services/work/build.xml b/services/work/build.xml new file mode 100644 index 000000000..b8f3ffe85 --- /dev/null +++ b/services/work/build.xml @@ -0,0 +1,131 @@ + + + Work Authority service + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/work/client/pom.xml b/services/work/client/pom.xml new file mode 100644 index 000000000..f526786cc --- /dev/null +++ b/services/work/client/pom.xml @@ -0,0 +1,91 @@ + + + + org.collectionspace.services + org.collectionspace.services.work + 3.2-SNAPSHOT + + + 4.0.0 + org.collectionspace.services + org.collectionspace.services.work.client + services.work.client + + + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-log4j12 + + + + org.collectionspace.services + org.collectionspace.services.jaxb + ${project.version} + + + org.collectionspace.services + org.collectionspace.services.common + true + ${project.version} + + + org.collectionspace.services + org.collectionspace.services.work.jaxb + ${project.version} + + + org.collectionspace.services + org.collectionspace.services.client + ${project.version} + + + org.collectionspace.services + org.collectionspace.services.authority.jaxb + true + ${project.version} + + + + org.testng + testng + + + org.jboss.resteasy + resteasy-jaxrs + + + + tjws + webserver + + + + + org.jboss.resteasy + resteasy-jaxb-provider + + + org.jboss.resteasy + resteasy-multipart-provider + + + commons-httpclient + commons-httpclient + 3.1 + + + + + collectionspace-services-work-client + + + + + diff --git a/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClient.java b/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClient.java new file mode 100644 index 000000000..cb74f4c42 --- /dev/null +++ b/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClient.java @@ -0,0 +1,72 @@ +/** + * This document is a part of the source code and related artifacts for + * CollectionSpace, an open source collections management system for museums and + * related institutions: + * + * http://www.collectionspace.org http://wiki.collectionspace.org + * + * Copyright © 2009 The Regents of the University of California + * + * Licensed under the Educational Community License (ECL), Version 2.0. You may + * not use this file except in compliance with this License. + * + * You may obtain a copy of the ECL 2.0 License at + * https://source.collectionspace.org/collection-space/LICENSE.txt + */ +package org.collectionspace.services.client; + +import org.collectionspace.services.work.WorksCommon; + +/** + * The Class WorkAuthorityClient. + */ +public class WorkAuthorityClient extends AuthorityClientImpl { + + public static final String SERVICE_NAME = "workauthorities"; + public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME; + public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT; + public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME; + public static final String TERM_INFO_GROUP_XPATH_BASE = "workTermGroupList"; + // + // Subitem constants + // + public static final String SERVICE_ITEM_NAME = "works"; + public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME; + // + // Payload Part/Schema part names + // + public static final String SERVICE_COMMON_PART_NAME = SERVICE_NAME + + PART_LABEL_SEPARATOR + PART_COMMON_LABEL; + public static final String SERVICE_ITEM_COMMON_PART_NAME = SERVICE_ITEM_NAME + + PART_LABEL_SEPARATOR + PART_COMMON_LABEL; + + @Override + public String getServiceName() { + return SERVICE_NAME; + } + + @Override + public String getServicePathComponent() { + return SERVICE_PATH_COMPONENT; + } + + @Override + public String getItemCommonPartName() { + return getCommonPartName(SERVICE_ITEM_NAME); + } + + @Override + public Class getProxyClass() { + return WorkAuthorityProxy.class; + } + + @Override + public String getInAuthority(WorksCommon item) { + return item.getInAuthority(); + } + + @Override + public void setInAuthority(WorksCommon item, String inAuthorityCsid) { + item.setInAuthority(inAuthorityCsid); + } +} diff --git a/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClientUtils.java b/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClientUtils.java new file mode 100644 index 000000000..2b783d8fa --- /dev/null +++ b/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClientUtils.java @@ -0,0 +1,294 @@ +package org.collectionspace.services.client; + +import java.io.File; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import org.apache.commons.io.FileUtils; +import org.collectionspace.services.WorkJAXBSchema; +import org.collectionspace.services.client.test.ServiceRequestType; +import org.collectionspace.services.common.api.Tools; +import org.collectionspace.services.work.WorkTermGroup; +import org.collectionspace.services.work.WorkTermGroupList; +import org.collectionspace.services.work.WorkauthoritiesCommon; +import org.collectionspace.services.work.WorksCommon; +import org.dom4j.DocumentException; +import org.jboss.resteasy.client.ClientResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class WorkAuthorityClientUtils { + private static final Logger logger = + LoggerFactory.getLogger(WorkAuthorityClientUtils.class); + + /** + * Creates a new Work Authority + * @param displayName The displayName used in UI, etc. + * @param refName The proper refName for this authority + * @param headerLabel The common part label + * @return The PoxPayloadOut payload for the create call + */ + public static PoxPayloadOut createWorkAuthorityInstance( + String displayName, String shortIdentifier, String headerLabel ) { + WorkauthoritiesCommon workAuthority = new WorkauthoritiesCommon(); + workAuthority.setDisplayName(displayName); + workAuthority.setShortIdentifier(shortIdentifier); + String refName = createWorkAuthRefName(shortIdentifier, displayName); + workAuthority.setRefName(refName); + workAuthority.setVocabType("WorkAuthority"); //FIXME: REM - Should this really be hard-coded? + PoxPayloadOut multipart = new PoxPayloadOut(WorkAuthorityClient.SERVICE_PAYLOAD_NAME); + PayloadOutputPart commonPart = multipart.addPart(workAuthority, MediaType.APPLICATION_XML_TYPE); + commonPart.setLabel(headerLabel); + + if(logger.isDebugEnabled()){ + logger.debug("to be created, workAuthority common ", + workAuthority, WorkauthoritiesCommon.class); + } + + return multipart; + } + + /** + * @param workRefName The proper refName for this authority + * @param workInfo the properties for the new Work. Can pass in one condition + * note and date string. + * @param headerLabel The common part label + * @return The PoxPayloadOut payload for the create call + */ + public static PoxPayloadOut createWorkInstance( + String workAuthRefName, Map workInfo, + List terms, String headerLabel){ + WorksCommon work = new WorksCommon(); + String shortId = workInfo.get(WorkJAXBSchema.SHORT_IDENTIFIER); + work.setShortIdentifier(shortId); + + // Set values in the Term Information Group + WorkTermGroupList termList = new WorkTermGroupList(); + if (terms == null || terms.isEmpty()) { + terms = getTermGroupInstance(getGeneratedIdentifier()); + } + termList.getWorkTermGroup().addAll(terms); + work.setWorkTermGroupList(termList); + + PoxPayloadOut multipart = new PoxPayloadOut(WorkAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME); + PayloadOutputPart commonPart = multipart.addPart(work, + MediaType.APPLICATION_XML_TYPE); + commonPart.setLabel(headerLabel); + + if(logger.isDebugEnabled()){ + logger.debug("to be created, work common ", work, WorksCommon.class); + } + + return multipart; + } + + /** + * @param vcsid CSID of the authority to create a new work + * @param workAuthorityRefName The refName for the authority + * @param workMap the properties for the new Work + * @param client the service client + * @return the CSID of the new item + */ + public static String createItemInAuthority(String vcsid, + String workAuthorityRefName, Map workMap, + List terms, WorkAuthorityClient client ) { + // Expected status code: 201 Created + int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode(); + // Type of service request being tested + ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE; + + String displayName = ""; + if ((terms !=null) && (! terms.isEmpty())) { + displayName = terms.get(0).getTermDisplayName(); + } + if(logger.isDebugEnabled()){ + logger.debug("Creating item with display name: \"" + displayName + +"\" in locationAuthority: \"" + vcsid +"\""); + } + PoxPayloadOut multipart = + createWorkInstance( workAuthorityRefName, + workMap, terms, client.getItemCommonPartName() ); + String newID = null; + ClientResponse res = client.createItem(vcsid, multipart); + try { + int statusCode = res.getStatus(); + + if(!REQUEST_TYPE.isValidStatusCode(statusCode)) { + throw new RuntimeException("Could not create Item: \"" + +workMap.get(WorkJAXBSchema.SHORT_IDENTIFIER) + +"\" in workAuthority: \"" + workAuthorityRefName + +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + } + if(statusCode != EXPECTED_STATUS_CODE) { + throw new RuntimeException("Unexpected Status when creating Item: \"" + +workMap.get(WorkJAXBSchema.SHORT_IDENTIFIER) + +"\" in workAuthority: \"" + workAuthorityRefName +"\", Status:"+ statusCode); + } + newID = extractId(res); + } finally { + res.releaseConnection(); + } + + return newID; + } + + public static PoxPayloadOut createWorkInstance( + String commonPartXML, String headerLabel) throws DocumentException { + PoxPayloadOut multipart = new PoxPayloadOut(WorkAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME); + PayloadOutputPart commonPart = multipart.addPart(commonPartXML, + MediaType.APPLICATION_XML_TYPE); + commonPart.setLabel(headerLabel); + + if(logger.isDebugEnabled()){ + logger.debug("to be created, work common ", commonPartXML); + } + + return multipart; + } + + public static String createItemInAuthority(String vcsid, + String commonPartXML, + WorkAuthorityClient client ) throws DocumentException { + // Expected status code: 201 Created + int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode(); + // Type of service request being tested + ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE; + + PoxPayloadOut multipart = + createWorkInstance(commonPartXML, client.getItemCommonPartName()); + String newID = null; + ClientResponse res = client.createItem(vcsid, multipart); + try { + int statusCode = res.getStatus(); + + if(!REQUEST_TYPE.isValidStatusCode(statusCode)) { + throw new RuntimeException("Could not create Item: \""+commonPartXML + +"\" in workAuthority: \"" + vcsid + +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + } + if(statusCode != EXPECTED_STATUS_CODE) { + throw new RuntimeException("Unexpected Status when creating Item: \""+commonPartXML + +"\" in workAuthority: \"" + vcsid +"\", Status:"+ statusCode); + } + newID = extractId(res); + } finally { + res.releaseConnection(); + } + + return newID; + } + + /** + * Creates the from xml file. + * + * @param fileName the file name + * @return new CSID as string + * @throws Exception the exception + */ + private String createItemInAuthorityFromXmlFile(String vcsid, String commonPartFileName, + WorkAuthorityClient client) throws Exception { + byte[] b = FileUtils.readFileToByteArray(new File(commonPartFileName)); + String commonPartXML = new String(b); + return createItemInAuthority(vcsid, commonPartXML, client ); + } + + /** + * Creates the workAuthority ref name. + * + * @param shortId the workAuthority shortIdentifier + * @param displaySuffix displayName to be appended, if non-null + * @return the string + */ + public static String createWorkAuthRefName(String shortId, String displaySuffix) { + String refName = "urn:cspace:org.collectionspace.demo:workauthority:name(" + +shortId+")"; + if(displaySuffix!=null&&!displaySuffix.isEmpty()) + refName += "'"+displaySuffix+"'"; + return refName; + } + + /** + * Creates the work ref name. + * + * @param workAuthRefName the workAuthority ref name + * @param shortId the work shortIdentifier + * @param displaySuffix displayName to be appended, if non-null + * @return the string + */ + public static String createWorkRefName( + String workAuthRefName, String shortId, String displaySuffix) { + String refName = workAuthRefName+":work:name("+shortId+")"; + if(displaySuffix!=null&&!displaySuffix.isEmpty()) + refName += "'"+displaySuffix+"'"; + return refName; + } + + public static String extractId(ClientResponse res) { + MultivaluedMap mvm = res.getMetadata(); + String uri = (String) ((ArrayList) mvm.get("Location")).get(0); + if(logger.isDebugEnabled()){ + logger.debug("extractId:uri=" + uri); + } + String[] segments = uri.split("/"); + String id = segments[segments.length - 1]; + if(logger.isDebugEnabled()){ + logger.debug("id=" + id); + } + return id; + } + + /** + * Returns an error message indicating that the status code returned by a + * specific call to a service does not fall within a set of valid status + * codes for that service. + * + * @param serviceRequestType A type of service request (e.g. CREATE, DELETE). + * + * @param statusCode The invalid status code that was returned in the response, + * from submitting that type of request to the service. + * + * @return An error message. + */ + public static String invalidStatusCodeMessage(ServiceRequestType requestType, int statusCode) { + return "Status code '" + statusCode + "' in response is NOT within the expected set: " + + requestType.validStatusCodesAsString(); + } + + + + /** + * Produces a default displayName from one or more supplied field(s). + * @see WorkAuthorityDocumentModelHandler.prepareDefaultDisplayName() which + * duplicates this logic, until we define a service-general utils package + * that is neither client nor service specific. + * @param workName + * @return a display name + */ + public static String prepareDefaultDisplayName( + String workName ) { + StringBuilder newStr = new StringBuilder(); + newStr.append(workName); + return newStr.toString(); + } + + public static List getTermGroupInstance(String identifier) { + if (Tools.isBlank(identifier)) { + identifier = getGeneratedIdentifier(); + } + List terms = new ArrayList(); + WorkTermGroup term = new WorkTermGroup(); + term.setTermDisplayName(identifier); + term.setTermName(identifier); + terms.add(term); + return terms; + } + + private static String getGeneratedIdentifier() { + return "id" + new Date().getTime(); + } + +} diff --git a/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityProxy.java b/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityProxy.java new file mode 100644 index 000000000..0bdf244b4 --- /dev/null +++ b/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityProxy.java @@ -0,0 +1,11 @@ +package org.collectionspace.services.client; + +import javax.ws.rs.Consumes; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; + +@Path(WorkAuthorityClient.SERVICE_PATH + "/") +@Produces("application/xml") +@Consumes("application/xml") +public interface WorkAuthorityProxy extends AuthorityProxy { +} diff --git a/services/work/client/src/test/java/org/collectionspace/services/client/test/WorkAuthorityServiceTest.java b/services/work/client/src/test/java/org/collectionspace/services/client/test/WorkAuthorityServiceTest.java new file mode 100644 index 000000000..34d0130d8 --- /dev/null +++ b/services/work/client/src/test/java/org/collectionspace/services/client/test/WorkAuthorityServiceTest.java @@ -0,0 +1,525 @@ +/** + * This document is a part of the source code and related artifacts + * for CollectionSpace, an open source collections management system + * for museums and related institutions: + * + * http://www.collectionspace.org + * http://wiki.collectionspace.org + * + * Copyright (c)) 2009 Regents of the University of California + * + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + * + * You may obtain a copy of the ECL 2.0 License at + * https://source.collectionspace.org/collection-space/LICENSE.txt + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.collectionspace.services.client.test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.collectionspace.services.WorkJAXBSchema; +import org.collectionspace.services.client.AbstractCommonListUtils; +import org.collectionspace.services.client.AuthorityClient; +import org.collectionspace.services.client.CollectionSpaceClient; +import org.collectionspace.services.client.PayloadOutputPart; +import org.collectionspace.services.client.PoxPayloadIn; +import org.collectionspace.services.client.PoxPayloadOut; +import org.collectionspace.services.client.WorkAuthorityClient; +import org.collectionspace.services.client.WorkAuthorityClientUtils; +import org.collectionspace.services.jaxb.AbstractCommonList; +import org.collectionspace.services.work.WorkTermGroup; +import org.collectionspace.services.work.WorkTermGroupList; +import org.collectionspace.services.work.WorkauthoritiesCommon; +import org.collectionspace.services.work.WorksCommon; +import org.jboss.resteasy.client.ClientResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +/** + * WorkAuthorityServiceTest, carries out tests against a + * deployed and running WorkAuthority Service. + * + */ +public class WorkAuthorityServiceTest extends AbstractAuthorityServiceTest { + + /** The logger. */ + private final String CLASS_NAME = WorkAuthorityServiceTest.class.getName(); + private final Logger logger = LoggerFactory.getLogger(WorkAuthorityServiceTest.class); + + @Override + public String getServicePathComponent() { + return WorkAuthorityClient.SERVICE_PATH_COMPONENT; + } + + @Override + protected String getServiceName() { + return WorkAuthorityClient.SERVICE_NAME; + } + + public String getItemServicePathComponent() { + return AuthorityClient.ITEMS; + } + + // Instance variables specific to this test. + +// /** The SERVICE path component. */ +// final String SERVICE_PATH_COMPONENT = "workauthorities"; +// +// /** The ITEM service path component. */ +// final String ITEM_SERVICE_PATH_COMPONENT = "items"; +// + + final String TEST_WORK_TERM_DISPLAY_NAME = "Muppets Take Manhattan (1984)"; + final String TEST_WORK_TERM_NAME = "Muppets Take Manhattan"; + final String TEST_WORK_TERM_TYPE = ""; + final String TEST_WORK_TERM_STATUS = "accepted"; + final String TEST_WORK_TERM_QUALIFIER = ""; + final String TEST_WORK_TERM_LANGUAGE = "english"; + final Boolean TEST_WORK_TERM_PREFFORLANG = true; + final String TEST_WORK_TERM_SOURCE = "featurefilms"; + final String TEST_WORK_TERM_SOURCE_DETAIL = "internal"; + final String TEST_WORK_TERM_SOURCE_ID = "12345"; + final String TEST_WORK_TERM_SOURCE_NOTE = "source note goes here"; + final String TEST_WORK_HISTORY_NOTE = "history note goes here"; + final String TEST_WORK_TYPE = "work type goes here"; + final String TEST_WORK_CREATOR_GROUP_CREATOR = "Frank Oz"; + final String TEST_WORK_CREATOR_GROUP_CREATOR_TYPE = "director"; + final String TEST_WORK_PUBLISHER_GROUP_PUBLISHER = "TriStar Pictures"; + final String TEST_WORK_PUBLISHER_GROUP_PUBLISHER_TYPE = "Distributor"; + final String TEST_WORK_SHORT_IDENTIFIER = "muppetstakemanhattan"; + final String TEST_WORK_REFNAME = "refname"; + + /** The known resource id. */ + private String knownResourceShortIdentifer = null; + private String knownResourceRefName = null; + private String knownWorkTypeRefName = null; + + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance() + */ + @Override + protected CollectionSpaceClient getClientInstance() { + return new WorkAuthorityClient(); + } + + /** + * Creates the item in authority. + * + * @param vcsid the vcsid + * @param authRefName the auth ref name + * @return the string + */ + private String createItemInAuthority(String vcsid, String authRefName) { + final String testName = "createItemInAuthority("+vcsid+","+authRefName+")"; + + // Submit the request to the service and store the response. + WorkAuthorityClient client = new WorkAuthorityClient(); + Map workMap = new HashMap(); + // TODO Make work type and status be controlled vocabs. + workMap.put(WorkJAXBSchema.SHORT_IDENTIFIER, TEST_WORK_SHORT_IDENTIFIER); + workMap.put(WorkJAXBSchema.WORK_TYPE, TEST_WORK_TYPE); + workMap.put(WorkJAXBSchema.WORK_HISTORY_NOTE, TEST_WORK_HISTORY_NOTE); + + List terms = new ArrayList(); + WorkTermGroup term = new WorkTermGroup(); + term.setTermDisplayName(TEST_WORK_TERM_DISPLAY_NAME); + term.setTermName(TEST_WORK_TERM_NAME); + term.setTermSource(TEST_WORK_TERM_SOURCE); + term.setTermSourceDetail(TEST_WORK_TERM_SOURCE_DETAIL); + term.setTermStatus(TEST_WORK_TERM_STATUS); + terms.add(term); + + String newID = WorkAuthorityClientUtils.createItemInAuthority(vcsid, + authRefName, workMap, terms, client ); + + // Store the ID returned from the first item resource created + // for additional tests below. + if (knownItemResourceId == null){ + setKnownItemResource(newID, TEST_WORK_SHORT_IDENTIFIER); + if (logger.isDebugEnabled()) { + logger.debug(testName + ": knownItemResourceId=" + newID); + } + } + + // Store the IDs from any item resources created + // by tests, along with the IDs of their parents, so these items + // can be deleted after all tests have been run. + allResourceItemIdsCreated.put(newID, vcsid); + + return newID; + } + + /** + * Verify illegal item display name. + * + * @param testName the test name + * @throws Exception the exception + */ + @Test(dataProvider="testName") + public void verifyIllegalItemDisplayName(String testName) throws Exception { + // Perform setup for read. + setupRead(); + + // Submit the request to the service and store the response. + WorkAuthorityClient client = new WorkAuthorityClient(); + ClientResponse res = client.readItem(knownResourceId, knownItemResourceId); + WorksCommon work = null; + try { + assertStatusCode(res, testName); + PoxPayloadIn input = new PoxPayloadIn(res.getEntity()); + work = (WorksCommon) extractPart(input, + client.getItemCommonPartName(), WorksCommon.class); + Assert.assertNotNull(work); + } finally { + if (res != null) { + res.releaseConnection(); + } + } + + // + // Make an invalid UPDATE request, without a display name + // + WorkTermGroupList termList = work.getWorkTermGroupList(); + Assert.assertNotNull(termList); + List terms = termList.getWorkTermGroup(); + Assert.assertNotNull(terms); + Assert.assertTrue(terms.size() > 0); + terms.get(0).setTermDisplayName(null); + terms.get(0).setTermName(null); + + setupUpdateWithInvalidBody(); // we expect a failure + + // Submit the updated resource to the service and store the response. + PoxPayloadOut output = new PoxPayloadOut(WorkAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME); + PayloadOutputPart commonPart = output.addPart(client.getItemCommonPartName(), work); + setupUpdateWithInvalidBody(); // we expected a failure here. + res = client.updateItem(knownResourceId, knownItemResourceId, output); + try { + assertStatusCode(res, testName); + } finally { + if (res != null) { + res.releaseConnection(); + } + } + } + + /** + * Read item list. + */ + @Test(dataProvider = "testName", groups = {"readList"}, + dependsOnMethods = {"readList"}) + public void readItemList(String testName) { + readItemList(knownAuthorityWithItems, null); + } + + /** + * Read item list by authority name. + */ + @Test(dataProvider = "testName", groups = {"readList"}, + dependsOnMethods = {"readItemList"}) + public void readItemListByAuthorityName(String testName) { + readItemList(null, READITEMS_SHORT_IDENTIFIER); + } + + /** + * Read item list. + * + * @param vcsid + * the vcsid + * @param name + * the name + */ + private void readItemList(String vcsid, String shortId) { + String testName = "readItemList"; + + // Perform setup. + setupReadList(); + + // Submit the request to the service and store the response. + WorkAuthorityClient client = new WorkAuthorityClient(); + ClientResponse res = null; + if (vcsid != null) { + res = client.readItemList(vcsid, null, null); + } else if (shortId != null) { + res = client.readItemListForNamedAuthority(shortId, null, null); + } else { + Assert.fail("readItemList passed null csid and name!"); + } + + AbstractCommonList list = null; + try { + assertStatusCode(res, testName); + list = res.getEntity(); + } finally { + if (res != null) { + res.releaseConnection(); + } + } + + List items = list.getListItem(); + int nItemsReturned = items.size(); + // There will be 'nItemsToCreateInList' + // items created by the createItemList test, + // all associated with the same parent resource. + int nExpectedItems = nItemsToCreateInList; + if (logger.isDebugEnabled()) { + logger.debug(testName + ": Expected " + nExpectedItems + + " items; got: " + nItemsReturned); + } + Assert.assertEquals(nItemsReturned, nExpectedItems); + + for (AbstractCommonList.ListItem item : items) { + String value = AbstractCommonListUtils.ListItemGetElementValue( + item, WorkJAXBSchema.REF_NAME); + Assert.assertTrue((null != value), "Item refName is null!"); + value = AbstractCommonListUtils.ListItemGetElementValue(item, + WorkJAXBSchema.WORK_TERM_DISPLAY_NAME); + Assert.assertTrue((null != value), "Item termDisplayName is null!"); + } + if (logger.isTraceEnabled()) { + AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, + testName); + } + } + + @Override + public void delete(String testName) throws Exception { + // Do nothing. See localDelete(). This ensure proper test order. + } + + @Test(dataProvider = "testName", dependsOnMethods = {"localDeleteItem"}) + public void localDelete(String testName) throws Exception { + super.delete(testName); + } + + @Override + public void deleteItem(String testName) throws Exception { + // Do nothing. We need to wait until after the test "localDelete" gets run. When it does, + // its dependencies will get run first and then we can call the base class' delete method. + } + + @Test(dataProvider = "testName", groups = {"delete"}, + dependsOnMethods = {"verifyIllegalItemDisplayName"}) + public void localDeleteItem(String testName) throws Exception { + super.deleteItem(testName); + } + + // --------------------------------------------------------------- + // Cleanup of resources created during testing + // --------------------------------------------------------------- + + /** + * Deletes all resources created by tests, after all tests have been run. + * + * This cleanup method will always be run, even if one or more tests fail. + * For this reason, it attempts to remove all resources created + * at any point during testing, even if some of those resources + * may be expected to be deleted by certain tests. + */ + + @AfterClass(alwaysRun=true) + public void cleanUp() { + String noTest = System.getProperty("noTestCleanup"); + if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) { + if (logger.isDebugEnabled()) { + logger.debug("Skipping Cleanup phase ..."); + } + return; + } + if (logger.isDebugEnabled()) { + logger.debug("Cleaning up temporary resources created for testing ..."); + } + String parentResourceId; + String itemResourceId; + // Clean up contact resources. + WorkAuthorityClient client = new WorkAuthorityClient(); + parentResourceId = knownResourceId; + // Clean up item resources. + for (Map.Entry entry : allResourceItemIdsCreated.entrySet()) { + itemResourceId = entry.getKey(); + parentResourceId = entry.getValue(); + // Note: Any non-success responses from the delete operation + // below are ignored and not reported. + client.deleteItem(parentResourceId, itemResourceId).releaseConnection(); + } + // Clean up parent resources. + for (String resourceId : allResourceIdsCreated) { + // Note: Any non-success responses from the delete operation + // below are ignored and not reported. + client.delete(resourceId).releaseConnection(); + } + } + + // --------------------------------------------------------------- + // Utility methods used by tests above + // --------------------------------------------------------------- + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent() + */ + + /** + * Returns the root URL for the item service. + * + * This URL consists of a base URL for all services, followed by + * a path component for the owning parent, followed by the + * path component for the items. + * + * @param parentResourceIdentifier An identifier (such as a UUID) for the + * parent authority resource of the relevant item resource. + * + * @return The root URL for the item service. + */ + protected String getItemServiceRootURL(String parentResourceIdentifier) { + return getResourceURL(parentResourceIdentifier) + "/" + getItemServicePathComponent(); + } + + /** + * Returns the URL of a specific item resource managed by a service, and + * designated by an identifier (such as a universally unique ID, or UUID). + * + * @param parentResourceIdentifier An identifier (such as a UUID) for the + * parent authority resource of the relevant item resource. + * + * @param itemResourceIdentifier An identifier (such as a UUID) for an + * item resource. + * + * @return The URL of a specific item resource managed by a service. + */ + protected String getItemResourceURL(String parentResourceIdentifier, String itemResourceIdentifier) { + return getItemServiceRootURL(parentResourceIdentifier) + "/" + itemResourceIdentifier; + } + + @Override + public void authorityTests(String testName) { + // TODO Auto-generated method stub + + } + + // + // Work specific overrides + // + + @Override + protected PoxPayloadOut createInstance(String commonPartName, + String identifier) { + // Submit the request to the service and store the response. + String shortId = identifier; + String displayName = "displayName-" + shortId; + // String baseRefName = WorkAuthorityClientUtils.createWorkAuthRefName(shortId, null); + PoxPayloadOut result = + WorkAuthorityClientUtils.createWorkAuthorityInstance( + displayName, shortId, commonPartName); + return result; + } + + @Override + protected PoxPayloadOut createNonExistenceInstance(String commonPartName, String identifier) { + String displayName = "displayName-NON_EXISTENT_ID"; + PoxPayloadOut result = WorkAuthorityClientUtils.createWorkAuthorityInstance( + displayName, "nonEx", commonPartName); + return result; + } + + @Override + protected WorkauthoritiesCommon updateInstance(WorkauthoritiesCommon workauthoritiesCommon) { + WorkauthoritiesCommon result = new WorkauthoritiesCommon(); + + result.setDisplayName("updated-" + workauthoritiesCommon.getDisplayName()); + result.setVocabType("updated-" + workauthoritiesCommon.getVocabType()); + + return result; + } + + @Override + protected void compareUpdatedInstances(WorkauthoritiesCommon original, + WorkauthoritiesCommon updated) throws Exception { + Assert.assertEquals(updated.getDisplayName(), + original.getDisplayName(), + "Display name in updated object did not match submitted data."); + } + + protected void compareReadInstances(WorkauthoritiesCommon original, + WorkauthoritiesCommon fromRead) throws Exception { + Assert.assertNotNull(fromRead.getDisplayName()); + Assert.assertNotNull(fromRead.getShortIdentifier()); + Assert.assertNotNull(fromRead.getRefName()); + } + + // + // Authority item specific overrides + // + + @Override + protected String createItemInAuthority(String authorityId) { + return createItemInAuthority(authorityId, null /*refname*/); + } + + @Override + protected WorksCommon updateItemInstance(WorksCommon worksCommon) { + + WorkTermGroupList termList = worksCommon.getWorkTermGroupList(); + Assert.assertNotNull(termList); + List terms = termList.getWorkTermGroup(); + Assert.assertNotNull(terms); + Assert.assertTrue(terms.size() > 0); + terms.get(0).setTermDisplayName("updated-" + terms.get(0).getTermDisplayName()); + terms.get(0).setTermName("updated-" + terms.get(0).getTermName()); + worksCommon.setWorkTermGroupList(termList); + + return worksCommon; + } + + @Override + protected void compareUpdatedItemInstances(WorksCommon original, + WorksCommon updated) throws Exception { + + WorkTermGroupList originalTermList = original.getWorkTermGroupList(); + Assert.assertNotNull(originalTermList); + List originalTerms = originalTermList.getWorkTermGroup(); + Assert.assertNotNull(originalTerms); + Assert.assertTrue(originalTerms.size() > 0); + + WorkTermGroupList updatedTermList = updated.getWorkTermGroupList(); + Assert.assertNotNull(updatedTermList); + List updatedTerms = updatedTermList.getWorkTermGroup(); + Assert.assertNotNull(updatedTerms); + Assert.assertTrue(updatedTerms.size() > 0); + + Assert.assertEquals(updatedTerms.get(0).getTermDisplayName(), + originalTerms.get(0).getTermDisplayName(), + "Value in updated record did not match submitted data."); + } + + @Override + protected void verifyReadItemInstance(WorksCommon item) + throws Exception { + // TODO Auto-generated method stub + + } + + @Override + protected PoxPayloadOut createNonExistenceItemInstance( + String commonPartName, String identifier) { + Map nonexMap = new HashMap(); + nonexMap.put(WorkJAXBSchema.WORK_TERM_DISPLAY_NAME, TEST_WORK_TERM_DISPLAY_NAME); + nonexMap.put(WorkJAXBSchema.SHORT_IDENTIFIER, "nonEx"); + nonexMap.put(WorkJAXBSchema.WORK_TERM_STATUS, TEST_WORK_TERM_STATUS); + final String EMPTY_REFNAME = ""; + PoxPayloadOut result = + WorkAuthorityClientUtils.createWorkInstance(EMPTY_REFNAME, nonexMap, + WorkAuthorityClientUtils.getTermGroupInstance(TEST_WORK_TERM_DISPLAY_NAME), commonPartName); + return result; + } +} diff --git a/services/work/client/src/test/resources/log4j.properties b/services/work/client/src/test/resources/log4j.properties new file mode 100644 index 000000000..148a3e865 --- /dev/null +++ b/services/work/client/src/test/resources/log4j.properties @@ -0,0 +1,23 @@ +log4j.rootLogger=debug, stdout, R + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout + +# Pattern to output the caller's file name and line number. +log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n + +log4j.appender.R=org.apache.log4j.RollingFileAppender +log4j.appender.R.File=target/test-client.log + +log4j.appender.R.MaxFileSize=100KB +# Keep one backup file +log4j.appender.R.MaxBackupIndex=1 + +log4j.appender.R.layout=org.apache.log4j.PatternLayout +log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n + +#packages +log4j.logger.org.collectionspace=DEBUG +log4j.logger.org.apache=INFO +log4j.logger.httpclient=INFO +log4j.logger.org.jboss.resteasy=INFO diff --git a/services/work/installer/build.xml b/services/work/installer/build.xml new file mode 100644 index 000000000..3fa6787ea --- /dev/null +++ b/services/work/installer/build.xml @@ -0,0 +1,61 @@ + + + + work service + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/work/jaxb/pom.xml b/services/work/jaxb/pom.xml new file mode 100644 index 000000000..9117a659c --- /dev/null +++ b/services/work/jaxb/pom.xml @@ -0,0 +1,60 @@ + + + + org.collectionspace.services + org.collectionspace.services.work + 3.2-SNAPSHOT + + + 4.0.0 + org.collectionspace.services + org.collectionspace.services.work.jaxb + services.work.jaxb + + + + org.collectionspace.services + org.collectionspace.services.common + ${project.version} + + + com.sun.xml.bind + jaxb-impl + + + + org.collectionspace.services + org.collectionspace.services.jaxb + ${project.version} + + + org.collectionspace.services + org.collectionspace.services.authority.jaxb + true + ${project.version} + + + + + collectionspace-services-work-jaxb + install + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + + + + + diff --git a/services/work/jaxb/src/main/java/org/collectionspace/services/WorkJAXBSchema.java b/services/work/jaxb/src/main/java/org/collectionspace/services/WorkJAXBSchema.java new file mode 100644 index 000000000..3fa9a36d5 --- /dev/null +++ b/services/work/jaxb/src/main/java/org/collectionspace/services/WorkJAXBSchema.java @@ -0,0 +1,42 @@ +/** + * + */ +package org.collectionspace.services; +import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema; + +public interface WorkJAXBSchema extends AuthorityItemJAXBSchema { + final static String WORKS_COMMON = "works_common"; + final static String DISPLAY_NAME = "displayName"; + final static String DISPLAY_NAME_COMPUTED = "displayNameComputed"; + final static String SHORT_DISPLAY_NAME = "shortDisplayName"; + final static String SHORT_DISPLAY_NAME_COMPUTED = "shortDisplayNameComputed"; + + final static String WORK_TYPE = "workType"; + final static String WORK_HISTORY_NOTE = "workHistoryNote"; + + final static String WORK_CREATOR_GROUP_LIST = "creatorGroupList"; + final static String WORK_CREATOR_GROUP_CREATOR = "creator"; + final static String WORK_CREATOR_GROUP_CREATOR_TYPE = "creatorType"; + + final static String WORK_PUBLISHER_GROUP_LIST = "publisherGroupList"; + final static String WORK_PUBLISHER_GROUP_PUBLISHER = "publisher"; + final static String WORK_PUBLISHER_GROUP_PUBLISHER_TYPE = "publisherType"; + + final static String WORK_TERM_GROUP_LIST = "workTermGroupList"; + final static String WORK_TERM_DISPLAY_NAME = "termDisplayName"; + final static String WORK_TERM_NAME = "termName"; + final static String WORK_TERM_TYPE = "termType"; + final static String WORK_TERM_STATUS = "termStatus"; + final static String WORK_TERM_QUALIFIER = "termQualifier"; + final static String WORK_TERM_LANGUAGE = "termLanguage"; + final static String WORK_TERM_PREFFORLANGUAGE = "termPrefForLang"; + final static String WORK_TERM_SOURCE = "termSource"; + final static String WORK_TERM_SOURCE_DETAIL = "termSourceDetail"; + final static String WORK_TERM_SOURCE_ID = "termSourceID"; + final static String WORK_TERM_SOURCE_NOTE = "termSourceNote"; + + final static String WORK_SHORT_IDENTIFIER = "shortIdentifier"; + final static String WORK_REFNAME = "refName"; + final static String WORK_INAUTHORITY = "inAuthority"; +} + diff --git a/services/work/jaxb/src/main/resources/work_common.xsd b/services/work/jaxb/src/main/resources/work_common.xsd new file mode 100644 index 000000000..20e84069c --- /dev/null +++ b/services/work/jaxb/src/main/resources/work_common.xsd @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/services/work/jaxb/src/main/resources/workauthority_common.xsd b/services/work/jaxb/src/main/resources/workauthority_common.xsd new file mode 100644 index 000000000..dac51d87b --- /dev/null +++ b/services/work/jaxb/src/main/resources/workauthority_common.xsd @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/work/output.txt b/services/work/output.txt new file mode 100644 index 000000000..0f075d95b --- /dev/null +++ b/services/work/output.txt @@ -0,0 +1,744 @@ +[INFO] Scanning for projects... +[INFO] Reactor build order: +[INFO] services.work +[INFO] services.work.jaxb +[INFO] services.work.client +[INFO] services.work.service +[INFO] services.work.3rdparty +[INFO] services.work.3rdparty.nuxeo +[INFO] ------------------------------------------------------------------------ +[INFO] Building services.work +[INFO] task-segment: [test] +[INFO] ------------------------------------------------------------------------ +[INFO] No goals needed for project - skipping +[INFO] ------------------------------------------------------------------------ +[INFO] Building services.work.jaxb +[INFO] task-segment: [test] +[INFO] ------------------------------------------------------------------------ +[INFO] [jaxb2:generate {execution: default}] +[INFO] Skipped XJC execution. Generated sources were up-to-date. +[INFO] [resources:resources {execution: default-resources}] +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Copying 2 resources +[INFO] Copying 1 resource +[INFO] [compiler:compile {execution: default-compile}] +[INFO] Nothing to compile - all classes are up to date +[INFO] [resources:testResources {execution: default-testResources}] +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] skip non existing resourceDirectory /Users/mjesse/Documents/github/walker/services/services/work/jaxb/src/test/resources +[INFO] [compiler:testCompile {execution: default-testCompile}] +[INFO] No sources to compile +[WARNING] DEPRECATED [systemProperties]: Use systemPropertyVariables instead. +[INFO] [surefire:test {execution: default-test}] +[INFO] No tests to run. +[INFO] Surefire report directory: /Users/mjesse/Documents/github/walker/services/services/work/jaxb/target/surefire-reports + +------------------------------------------------------- + T E S T S +------------------------------------------------------- +Running TestSuite +There are no tests to run. + +Results : + +Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 + +[INFO] ------------------------------------------------------------------------ +[INFO] Building services.work.client +[INFO] task-segment: [test] +[INFO] ------------------------------------------------------------------------ +[INFO] [resources:resources {execution: default-resources}] +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] skip non existing resourceDirectory /Users/mjesse/Documents/github/walker/services/services/work/client/src/main/resources +[INFO] [compiler:compile {execution: default-compile}] +[INFO] Nothing to compile - all classes are up to date +[INFO] [resources:testResources {execution: default-testResources}] +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Copying 1 resource +[INFO] [compiler:testCompile {execution: default-testCompile}] +[INFO] Nothing to compile - all classes are up to date +[WARNING] DEPRECATED [systemProperties]: Use systemPropertyVariables instead. +[INFO] [surefire:test {execution: default-test}] +[INFO] Surefire report directory: /Users/mjesse/Documents/github/walker/services/services/work/client/target/surefire-reports + +------------------------------------------------------- + T E S T S +------------------------------------------------------- +Running TestSuite +2013-02-05 17:40:24,168 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:24,229 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:24,233 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:24,936 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = create +=================================================== +2013-02-05 17:40:24,948 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:24,948 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:24,949 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:25,034 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:26,115 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] create: HTTP status = 201 +2013-02-05 17:40:26,118 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/3983ae95-ffec-40e9-be1c +2013-02-05 17:40:26,118 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=3983ae95-ffec-40e9-be1c +2013-02-05 17:40:26,120 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:100] create: Setting knownResourceId=3983ae95-ffec-40e9-be1c +2013-02-05 17:40:26,127 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = createList +=================================================== +2013-02-05 17:40:26,129 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:26,129 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:26,130 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:26,168 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:26,626 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201 +2013-02-05 17:40:26,627 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/12d307c8-6fa2-44cd-b6b7 +2013-02-05 17:40:26,628 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=12d307c8-6fa2-44cd-b6b7 +2013-02-05 17:40:26,630 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:26,631 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:26,631 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:26,659 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:26,959 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201 +2013-02-05 17:40:26,960 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/37563d16-ba88-4f80-a5a8 +2013-02-05 17:40:26,960 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=37563d16-ba88-4f80-a5a8 +2013-02-05 17:40:26,961 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:26,973 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:26,974 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:26,995 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:27,198 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201 +2013-02-05 17:40:27,198 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/18ab8cb4-099f-4936-9492 +2013-02-05 17:40:27,199 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=18ab8cb4-099f-4936-9492 +2013-02-05 17:40:27,200 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:27,201 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:27,201 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:27,219 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:27,606 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201 +2013-02-05 17:40:27,607 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/175cdd05-e79c-4dd4-b657 +2013-02-05 17:40:27,608 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=175cdd05-e79c-4dd4-b657 +2013-02-05 17:40:27,609 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:27,616 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:27,617 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:27,638 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:27,870 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201 +2013-02-05 17:40:27,871 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/64d8cd08-a95d-441a-afac +2013-02-05 17:40:27,871 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=64d8cd08-a95d-441a-afac +2013-02-05 17:40:27,872 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:27,873 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:27,874 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:27,905 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:28,099 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201 +2013-02-05 17:40:28,100 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/7e4cc36a-31cb-428f-a301 +2013-02-05 17:40:28,115 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=7e4cc36a-31cb-428f-a301 +2013-02-05 17:40:28,117 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:28,117 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:28,118 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:28,134 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:28,374 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201 +2013-02-05 17:40:28,375 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/196cff90-c760-4dff-a8e1 +2013-02-05 17:40:28,381 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=196cff90-c760-4dff-a8e1 +2013-02-05 17:40:28,382 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:28,392 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:28,392 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:28,407 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:28,849 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201 +2013-02-05 17:40:28,849 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/71c79387-8ac1-44e3-a648 +2013-02-05 17:40:28,850 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=71c79387-8ac1-44e3-a648 +2013-02-05 17:40:28,851 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:28,852 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:28,853 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:28,871 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:29,148 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201 +2013-02-05 17:40:29,149 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/d3f9ca52-8f58-44d2-9e3d +2013-02-05 17:40:29,151 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=d3f9ca52-8f58-44d2-9e3d +2013-02-05 17:40:29,154 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:29,155 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:29,155 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:29,169 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:29,357 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201 +2013-02-05 17:40:29,358 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/036a5fd8-f613-45c7-ac68 +2013-02-05 17:40:29,358 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=036a5fd8-f613-45c7-ac68 +2013-02-05 17:40:29,363 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = read +=================================================== +2013-02-05 17:40:29,364 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:29,365 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:29,365 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:29,852 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:194] read: status = 200 +2013-02-05 17:40:29,856 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:29,856 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:29,857 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:29,879 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:29,881 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:29,882 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:29,882 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:29,917 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:29,921 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:29,930 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:29,946 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part workauthorities_common ... +2013-02-05 17:40:30,156 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = readList +=================================================== +2013-02-05 17:40:30,157 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:30,158 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:30,158 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:30,497 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:429] readList: status = 200 +2013-02-05 17:40:30,501 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = readPaginatedList +=================================================== +2013-02-05 17:40:30,502 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:30,502 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:30,502 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:30,609 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:758] readPaginatedList: status = 200 +2013-02-05 17:40:30,619 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:477] readPaginatedList:created list of 11 to be paginated. +2013-02-05 17:40:30,708 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:758] readPaginatedList: status = 200 +2013-02-05 17:40:30,731 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:785] readPaginatedList:page number is 0 +2013-02-05 17:40:30,731 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:791] readPaginatedList:page size is 3 +2013-02-05 17:40:30,731 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:797] readPaginatedList:actual items in page was/were 3 +2013-02-05 17:40:30,732 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:803] readPaginatedList:total number of items is 11 +2013-02-05 17:40:30,831 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:758] readPaginatedList: status = 200 +2013-02-05 17:40:30,854 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:785] readPaginatedList:page number is 1 +2013-02-05 17:40:30,854 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:791] readPaginatedList:page size is 3 +2013-02-05 17:40:30,855 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:797] readPaginatedList:actual items in page was/were 3 +2013-02-05 17:40:30,855 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:803] readPaginatedList:total number of items is 11 +2013-02-05 17:40:30,997 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:758] readPaginatedList: status = 200 +2013-02-05 17:40:31,093 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:785] readPaginatedList:page number is 2 +2013-02-05 17:40:31,094 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:791] readPaginatedList:page size is 3 +2013-02-05 17:40:31,094 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:797] readPaginatedList:actual items in page was/were 3 +2013-02-05 17:40:31,094 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:803] readPaginatedList:total number of items is 11 +2013-02-05 17:40:31,186 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:758] readPaginatedList: status = 200 +2013-02-05 17:40:31,202 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:785] readPaginatedList:page number is 3 +2013-02-05 17:40:31,203 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:791] readPaginatedList:page size is 3 +2013-02-05 17:40:31,203 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:797] readPaginatedList:actual items in page was/were 2 +2013-02-05 17:40:31,203 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:803] readPaginatedList:total number of items is 11 +2013-02-05 17:40:31,205 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = testSubmitRequest +=================================================== +2013-02-05 17:40:31,206 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:31,211 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:31,212 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:31,503 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:372] testSubmitRequest: url=http://localhost:8180/cspace-services/workauthorities/3983ae95-ffec-40e9-be1c status=200 +2013-02-05 17:40:31,506 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = update +=================================================== +2013-02-05 17:40:31,507 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:31,508 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:31,508 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:31,838 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:317] update: read status = 200 +2013-02-05 17:40:31,838 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:322] Got object to update with CSID= 3983ae95-ffec-40e9-be1c +2013-02-05 17:40:31,839 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:31,840 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:31,840 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:31,856 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part workauthorities_common ... +2013-02-05 17:40:32,128 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:329] + +To be updated fields: CSID = 3983ae95-ffec-40e9-be1c + + + updated-displayName-1360450869391 + updated-WorkAuthority + + +2013-02-05 17:40:32,131 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:32,131 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:32,133 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:32,606 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:339] update: status = 200 +2013-02-05 17:40:32,607 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:32,607 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:32,608 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:32,625 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part workauthorities_common ... +2013-02-05 17:40:32,760 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = readWorkflow +=================================================== +2013-02-05 17:40:32,761 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:32,786 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:32,787 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:32,932 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] readWorkflow: status = 200 +2013-02-05 17:40:33,019 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:33,020 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:33,020 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:33,031 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:33,031 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:33,032 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:33,040 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:33,211 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/ad8ded5b-8885-4748-a745 +2013-02-05 17:40:33,212 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=ad8ded5b-8885-4748-a745 +2013-02-05 17:40:33,213 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:33,214 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:33,214 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:33,224 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:33,225 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:33,225 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:33,233 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:33,399 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/4c2e8eea-4cd5-4e3f-82f2 +2013-02-05 17:40:33,399 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=4c2e8eea-4cd5-4e3f-82f2 +2013-02-05 17:40:33,404 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:33,404 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:33,404 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:33,434 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:33,435 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:33,436 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:33,445 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:33,667 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/814172fb-9069-44d3-81bc +2013-02-05 17:40:33,667 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=814172fb-9069-44d3-81bc +2013-02-05 17:40:33,668 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:33,668 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:33,669 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:33,793 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] readWorkflow: status = 200 +2013-02-05 17:40:33,794 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:818] Got object to update life cycle state with ID: 814172fb-9069-44d3-81bc +2013-02-05 17:40:33,836 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:830] Current workflow state: + + cs_default + project + + +2013-02-05 17:40:34,036 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] readWorkflow: status = 200 +2013-02-05 17:40:34,126 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] readWorkflow: status = 200 +2013-02-05 17:40:34,126 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:857] Got workflow state of updated object with ID: 814172fb-9069-44d3-81bc +2013-02-05 17:40:34,133 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:863] Expected workflow state found: deleted +2013-02-05 17:40:34,134 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:34,134 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:34,134 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:34,404 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] readWorkflow: status = 200 +2013-02-05 17:40:34,508 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:34,508 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:34,509 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:34,606 INFO [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:550] Workflow transition to 'deleted' is complete +2013-02-05 17:40:34,609 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = delete +=================================================== +2013-02-05 17:40:34,618 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = readNonExistent +=================================================== +2013-02-05 17:40:34,619 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:34,620 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:34,620 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:34,714 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:242] readNonExistent: status = 404 +2013-02-05 17:40:34,720 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = baseCRUDTests +=================================================== +2013-02-05 17:40:34,722 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = CRUDTests +=================================================== +2013-02-05 17:40:34,725 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = createItem +=================================================== +2013-02-05 17:40:34,726 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:34,727 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:34,727 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:34,734 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:109] Creating item with display name: "Muppets Take Manhattan (1984)" in locationAuthority: "3983ae95-ffec-40e9-be1c" +2013-02-05 17:40:34,734 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:83] to be created, work common +2013-02-05 17:40:34,933 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:234] extractId:uri=http://localhost:8180/cspace-services/workauthorities/3983ae95-ffec-40e9-be1c/items/59763387-2665-4cf7-b188 +2013-02-05 17:40:34,934 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:239] id=59763387-2665-4cf7-b188 +2013-02-05 17:40:34,934 DEBUG [main] [org.collectionspace.services.client.test.WorkAuthorityServiceTest:152] createItemInAuthority(3983ae95-ffec-40e9-be1c,null): knownItemResourceId=59763387-2665-4cf7-b188 +2013-02-05 17:40:34,943 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = baseAuthorityTests +=================================================== +2013-02-05 17:40:34,945 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = createItemList +=================================================== +2013-02-05 17:40:34,945 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:34,946 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:34,946 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:34,953 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:35,128 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createItemList: HTTP status = 201 +2013-02-05 17:40:35,128 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/c70af1dd-d27c-43ef-aebe +2013-02-05 17:40:35,129 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=c70af1dd-d27c-43ef-aebe +2013-02-05 17:40:35,130 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:35,130 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:35,130 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:35,138 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:109] Creating item with display name: "Muppets Take Manhattan (1984)" in locationAuthority: "c70af1dd-d27c-43ef-aebe" +2013-02-05 17:40:35,140 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:83] to be created, work common +2013-02-05 17:40:35,535 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:234] extractId:uri=http://localhost:8180/cspace-services/workauthorities/c70af1dd-d27c-43ef-aebe/items/b615f65c-2141-45d8-95f2 +2013-02-05 17:40:35,535 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:239] id=b615f65c-2141-45d8-95f2 +2013-02-05 17:40:35,538 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:35,539 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:35,539 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:35,546 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:109] Creating item with display name: "Muppets Take Manhattan (1984)" in locationAuthority: "c70af1dd-d27c-43ef-aebe" +2013-02-05 17:40:35,547 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:83] to be created, work common +2013-02-05 17:40:35,803 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:234] extractId:uri=http://localhost:8180/cspace-services/workauthorities/c70af1dd-d27c-43ef-aebe/items/ff11bc76-efeb-41f7-8255 +2013-02-05 17:40:35,804 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:239] id=ff11bc76-efeb-41f7-8255 +2013-02-05 17:40:35,805 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:35,805 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:35,805 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:35,826 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:109] Creating item with display name: "Muppets Take Manhattan (1984)" in locationAuthority: "c70af1dd-d27c-43ef-aebe" +2013-02-05 17:40:35,827 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:83] to be created, work common +2013-02-05 17:40:36,013 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:234] extractId:uri=http://localhost:8180/cspace-services/workauthorities/c70af1dd-d27c-43ef-aebe/items/9ad7de8a-6a91-4326-aa03 +2013-02-05 17:40:36,014 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:239] id=9ad7de8a-6a91-4326-aa03 +2013-02-05 17:40:36,016 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:36,018 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:36,019 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:36,026 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:109] Creating item with display name: "Muppets Take Manhattan (1984)" in locationAuthority: "c70af1dd-d27c-43ef-aebe" +2013-02-05 17:40:36,026 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:83] to be created, work common +2013-02-05 17:40:36,191 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:234] extractId:uri=http://localhost:8180/cspace-services/workauthorities/c70af1dd-d27c-43ef-aebe/items/010c033e-b272-4b08-8226 +2013-02-05 17:40:36,192 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:239] id=010c033e-b272-4b08-8226 +2013-02-05 17:40:36,192 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:36,194 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:36,194 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:36,200 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:109] Creating item with display name: "Muppets Take Manhattan (1984)" in locationAuthority: "c70af1dd-d27c-43ef-aebe" +2013-02-05 17:40:36,201 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:83] to be created, work common +2013-02-05 17:40:36,412 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:234] extractId:uri=http://localhost:8180/cspace-services/workauthorities/c70af1dd-d27c-43ef-aebe/items/486bb415-76ab-4780-b39f +2013-02-05 17:40:36,412 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:239] id=486bb415-76ab-4780-b39f +2013-02-05 17:40:36,417 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = readByName +=================================================== +2013-02-05 17:40:36,419 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:36,419 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:36,420 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:36,748 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:228] readByName: status = 200 +2013-02-05 17:40:36,749 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:36,749 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:36,749 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:36,756 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part workauthorities_common ... +2013-02-05 17:40:36,951 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = readItem +=================================================== +2013-02-05 17:40:36,952 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:36,953 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:36,953 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:37,230 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:294] readItem: status = 200 +2013-02-05 17:40:37,231 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:37,231 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:37,232 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:37,237 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part works_common ... +2013-02-05 17:40:37,329 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = readItemListByName +=================================================== +2013-02-05 17:40:37,331 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:37,331 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:37,331 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:37,443 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:348] readItemListByName: status = 200 +2013-02-05 17:40:37,502 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:359] readItemListByName: Expected 5 items; got: 5 of: 5 +2013-02-05 17:40:37,505 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = readItemNonExistent +=================================================== +2013-02-05 17:40:37,505 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:37,506 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:37,506 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:37,614 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:273] readItemNonExistent: status = 404 +2013-02-05 17:40:37,615 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = testItemSubmitRequest +=================================================== +2013-02-05 17:40:37,616 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:37,616 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:37,616 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:37,890 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:121] testItemSubmitRequest: url=http://localhost:8180/cspace-services/workauthorities/3983ae95-ffec-40e9-be1c/items/59763387-2665-4cf7-b188 status=200 +2013-02-05 17:40:37,891 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = verifyIgnoredUpdateWithInAuthority +=================================================== +2013-02-05 17:40:37,892 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:37,892 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:37,893 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:38,427 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:143] verifyIgnoredUpdateWithInAuthority read authority:3983ae95-ffec-40e9-be1c/Item:59763387-2665-4cf7-b188 status = 200 +2013-02-05 17:40:38,428 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:38,428 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:38,429 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:38,435 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part works_common ... +2013-02-05 17:40:38,620 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:38,621 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:38,621 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:38,877 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:164] verifyIgnoredUpdateWithInAuthority: status = 200 +2013-02-05 17:40:39,224 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:39,224 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:39,225 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:39,231 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part works_common ... +2013-02-05 17:40:39,326 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = updateItem +=================================================== +2013-02-05 17:40:39,327 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:39,327 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:39,327 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:39,685 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:437] updateItem: read status = 200 +2013-02-05 17:40:39,685 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:442] got Authority item to update with ID: 59763387-2665-4cf7-b188 in authority: 3983ae95-ffec-40e9-be1c +2013-02-05 17:40:39,686 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:39,687 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:39,687 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:39,693 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part works_common ... +2013-02-05 17:40:39,855 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:452] + +To be updated fields: CSID = 59763387-2665-4cf7-b188 + + + 59763387-2665-4cf7-b188 + 3983ae95-ffec-40e9-be1c + muppetstakemanhattan + urn:cspace:core.collectionspace.org:workauthorities:name(1360450869391):item:name(muppetstakemanhattan)'Muppets Take Manhattan (1984)' + + + updated-Muppets Take Manhattan (1984) + updated-Muppets Take Manhattan + + accepted + + + false + featurefilms + internal + + + + + + + + + +2013-02-05 17:40:39,858 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:39,877 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:39,883 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:40,271 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:467] updateItem: status = 200 +2013-02-05 17:40:40,272 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:40,272 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:40,273 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:40,278 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part works_common ... +2013-02-05 17:40:40,327 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = deleteItem +=================================================== +2013-02-05 17:40:40,329 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = deleteNonExistentItem +=================================================== +2013-02-05 17:40:40,330 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:40,330 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:40,330 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:40,423 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:395] deleteNonExistentItem: status = 404 +2013-02-05 17:40:40,425 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = deleteNonExistent +=================================================== +2013-02-05 17:40:40,426 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:40,427 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:40,427 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:40,513 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:266] deleteNonExistent: status = 404 +2013-02-05 17:40:40,515 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = updateNonExistent +=================================================== +2013-02-05 17:40:40,516 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:40,516 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:40,516 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:40,522 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:40,661 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:699] updateNonExistent: status = 404 +2013-02-05 17:40:40,664 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = updateNonExistentItem +=================================================== +2013-02-05 17:40:40,665 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:40,665 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:40,665 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:40,672 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:83] to be created, work common +2013-02-05 17:40:40,849 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:508] updateNonExistentItem: status = 404 +2013-02-05 17:40:40,851 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = readItemList +=================================================== +2013-02-05 17:40:40,852 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:40,852 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:40,852 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:41,054 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] readItemList: status = 200 +2013-02-05 17:40:41,102 DEBUG [main] [org.collectionspace.services.client.test.WorkAuthorityServiceTest:278] readItemList: Expected 5 items; got: 5 +2013-02-05 17:40:41,106 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = readItemListByAuthorityName +=================================================== +2013-02-05 17:40:41,108 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:41,108 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:41,109 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:41,260 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] readItemList: status = 200 +2013-02-05 17:40:41,298 DEBUG [main] [org.collectionspace.services.client.test.WorkAuthorityServiceTest:278] readItemList: Expected 5 items; got: 5 +2013-02-05 17:40:41,299 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = verifyIllegalItemDisplayName +=================================================== +2013-02-05 17:40:41,300 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:41,300 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:41,301 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:41,614 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] verifyIllegalItemDisplayName: status = 200 +2013-02-05 17:40:41,877 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] verifyIllegalItemDisplayName: status = 400 +2013-02-05 17:40:41,879 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = localDeleteItem +=================================================== +2013-02-05 17:40:41,880 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:41,880 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:41,880 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:41,991 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:322] delete: status = 200 +2013-02-05 17:40:41,993 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = localDelete +=================================================== +2013-02-05 17:40:41,994 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:41,995 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:41,995 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:42,118 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:221] localDelete: status = 200 +2013-02-05 17:40:42,119 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = readAuthorityItemWorkflow +=================================================== +2013-02-05 17:40:42,120 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:42,120 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:42,121 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:42,132 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:42,133 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:42,133 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:42,141 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:42,142 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:42,142 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:42,148 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common +2013-02-05 17:40:42,444 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/3bb3435f-19a2-4615-a718 +2013-02-05 17:40:42,445 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=3bb3435f-19a2-4615-a718 +2013-02-05 17:40:42,448 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:42,448 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:42,448 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:42,454 WARN [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:985] Sub-class test clients should override this method +2013-02-05 17:40:42,454 WARN [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:1062] org.collectionspace.services.client.test.WorkAuthorityServiceTest did not implement createWorkflowTarget() method. No workflow tests performed. +2013-02-05 17:40:42,462 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] +=================================================== +Class = WorkAuthorityServiceTest + Test = searchWorkflowDeleted +=================================================== +2013-02-05 17:40:42,475 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:42,476 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:42,477 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +2013-02-05 17:40:42,497 DEBUG [main] [org.collectionspace.services.client.test.WorkAuthorityServiceTest:342] Cleaning up temporary resources created for testing ... +2013-02-05 17:40:42,498 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/ +2013-02-05 17:40:42,498 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator +2013-02-05 17:40:42,498 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication +Tests run: 34, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 20.689 sec + +Results : + +Tests run: 34, Failures: 0, Errors: 0, Skipped: 0 + +[INFO] ------------------------------------------------------------------------ +[INFO] Building services.work.service +[INFO] task-segment: [test] +[INFO] ------------------------------------------------------------------------ +[INFO] [resources:resources {execution: default-resources}] +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] skip non existing resourceDirectory /Users/mjesse/Documents/github/walker/services/services/work/service/src/main/resources +[INFO] [compiler:compile {execution: default-compile}] +[INFO] Nothing to compile - all classes are up to date +[INFO] [resources:testResources {execution: default-testResources}] +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] skip non existing resourceDirectory /Users/mjesse/Documents/github/walker/services/services/work/service/src/test/resources +[INFO] [compiler:testCompile {execution: default-testCompile}] +[INFO] No sources to compile +[WARNING] DEPRECATED [systemProperties]: Use systemPropertyVariables instead. +[INFO] [surefire:test {execution: default-test}] +[INFO] No tests to run. +[INFO] Surefire report directory: /Users/mjesse/Documents/github/walker/services/services/work/service/target/surefire-reports + +------------------------------------------------------- + T E S T S +------------------------------------------------------- +Running TestSuite +There are no tests to run. + +Results : + +Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 + +[INFO] ------------------------------------------------------------------------ +[INFO] Building services.work.3rdparty +[INFO] task-segment: [test] +[INFO] ------------------------------------------------------------------------ +[INFO] No goals needed for project - skipping +[INFO] ------------------------------------------------------------------------ +[INFO] Building services.work.3rdparty.nuxeo +[INFO] task-segment: [test] +[INFO] ------------------------------------------------------------------------ +[INFO] [resources:resources {execution: default-resources}] +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] Copying 8 resources +[INFO] [compiler:compile {execution: default-compile}] +[INFO] No sources to compile +[INFO] [resources:testResources {execution: default-testResources}] +[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] skip non existing resourceDirectory /Users/mjesse/Documents/github/walker/services/services/work/3rdparty/nuxeo-platform-cs-work/src/test/resources +[INFO] [compiler:testCompile {execution: default-testCompile}] +[INFO] No sources to compile +[WARNING] DEPRECATED [systemProperties]: Use systemPropertyVariables instead. +[INFO] [surefire:test {execution: default-test}] +[INFO] No tests to run. +[INFO] Surefire report directory: /Users/mjesse/Documents/github/walker/services/services/work/3rdparty/nuxeo-platform-cs-work/target/surefire-reports + +------------------------------------------------------- + T E S T S +------------------------------------------------------- +Running TestSuite +There are no tests to run. + +Results : + +Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 + +[INFO] +[INFO] +[INFO] ------------------------------------------------------------------------ +[INFO] Reactor Summary: +[INFO] ------------------------------------------------------------------------ +[INFO] services.work ......................................... SUCCESS [0.362s] +[INFO] services.work.jaxb .................................... SUCCESS [6.008s] +[INFO] services.work.client .................................. SUCCESS [22.019s] +[INFO] services.work.service ................................. SUCCESS [1.629s] +[INFO] services.work.3rdparty ................................ SUCCESS [0.001s] +[INFO] services.work.3rdparty.nuxeo .......................... SUCCESS [0.525s] +[INFO] ------------------------------------------------------------------------ +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD SUCCESSFUL +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 31 seconds +[INFO] Finished at: Tue Feb 05 17:40:46 EST 2013 +[INFO] Final Memory: 50M/102M +[INFO] ------------------------------------------------------------------------ diff --git a/services/work/pom.xml b/services/work/pom.xml new file mode 100644 index 000000000..93f401b14 --- /dev/null +++ b/services/work/pom.xml @@ -0,0 +1,41 @@ + + + + org.collectionspace.services + org.collectionspace.services.main + 3.2-SNAPSHOT + + + 4.0.0 + org.collectionspace.services + org.collectionspace.services.work + services.work + pom + + + + + + + jaxb + service + 3rdparty + client + + + + + samples + + + + + + + + diff --git a/services/work/service/pom.xml b/services/work/service/pom.xml new file mode 100644 index 000000000..0708b5208 --- /dev/null +++ b/services/work/service/pom.xml @@ -0,0 +1,146 @@ + + + + org.collectionspace.services + org.collectionspace.services.work + 3.2-SNAPSHOT + + + 4.0.0 + org.collectionspace.services + org.collectionspace.services.work.service + services.work.service + jar + + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-log4j12 + + + + org.collectionspace.services + org.collectionspace.services.common + ${project.version} + + + org.collectionspace.services + org.collectionspace.services.work.jaxb + ${project.version} + + + org.collectionspace.services + org.collectionspace.services.work.client + ${project.version} + + + org.collectionspace.services + org.collectionspace.services.authority.service + true + ${project.version} + + + + junit + junit + 4.1 + test + + + org.testng + testng + 5.6 + + + + + commons-beanutils + commons-beanutils + 1.6.1 + + + + commons-logging + commons-logging + 1.1 + + + + + + javax.security + jaas + 1.0.01 + provided + + + + dom4j + dom4j + 1.6.1 + provided + + + + + + org.jboss.resteasy + resteasy-jaxrs + + + tjws + webserver + + + + + org.jboss.resteasy + resteasy-jaxb-provider + + + org.jboss.resteasy + resteasy-multipart-provider + + + + + + org.nuxeo.ecm.core + nuxeo-core-api + + + jboss-remoting + jboss + + + + + + org.restlet + org.restlet + 1.0.7 + + + com.noelios.restlet + com.noelios.restlet.ext.httpclient + 1.0.7 + + + com.noelios.restlet + com.noelios.restlet + 1.0.7 + + + + + + collectionspace-services-work + + + + + diff --git a/services/work/service/src/main/java/org/collectionspace/services/work/WorkAuthorityResource.java b/services/work/service/src/main/java/org/collectionspace/services/work/WorkAuthorityResource.java new file mode 100644 index 000000000..045b14ae4 --- /dev/null +++ b/services/work/service/src/main/java/org/collectionspace/services/work/WorkAuthorityResource.java @@ -0,0 +1,69 @@ +/** + * This document is a part of the source code and related artifacts for + * CollectionSpace, an open source collections management system for museums and + * related institutions: + * + * http://www.collectionspace.org http://wiki.collectionspace.org + * + * Copyright 2009 University of California at Berkeley + * + * Licensed under the Educational Community License (ECL), Version 2.0. You may + * not use this file except in compliance with this License. + * + * You may obtain a copy of the ECL 2.0 License at + * + * https://source.collectionspace.org/collection-space/LICENSE.txt + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package org.collectionspace.services.work; + +import javax.ws.rs.Consumes; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import org.collectionspace.services.client.WorkAuthorityClient; +import org.collectionspace.services.common.vocabulary.AuthorityResource; +import org.collectionspace.services.work.nuxeo.WorkDocumentModelHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * WorkAuthorityResource + * + * Handles, dispatches, and returns responses to RESTful requests + * related to Work authority-related resources. + */ + +@Path(WorkAuthorityClient.SERVICE_PATH) +@Consumes("application/xml") +@Produces("application/xml") +public class WorkAuthorityResource + extends AuthorityResource { + + final Logger logger = LoggerFactory.getLogger(WorkAuthorityResource.class); + + public WorkAuthorityResource() { + super(WorkauthoritiesCommon.class, WorkAuthorityResource.class, + WorkAuthorityClient.SERVICE_COMMON_PART_NAME, WorkAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME); + } + + @Override + public String getServiceName() { + return WorkAuthorityClient.SERVICE_NAME; + } + + @Override + public String getItemServiceName() { + return WorkAuthorityClient.SERVICE_ITEM_NAME; + } + + @Override + public String getItemTermInfoGroupXPathBase() { + return WorkAuthorityClient.TERM_INFO_GROUP_XPATH_BASE; + } + +} diff --git a/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkAuthorityConstants.java b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkAuthorityConstants.java new file mode 100644 index 000000000..af98993ad --- /dev/null +++ b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkAuthorityConstants.java @@ -0,0 +1,35 @@ +/** + * This document is a part of the source code and related artifacts + * for CollectionSpace, an open source collections management system + * for museums and related institutions: + + * http://www.collectionspace.org + * http://wiki.collectionspace.org + + * Copyright 2009 University of California at Berkeley + + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + + * You may obtain a copy of the ECL 2.0 License at + + * https://source.collectionspace.org/collection-space/LICENSE.txt + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.collectionspace.services.work.nuxeo; + +/** + * WorkAuthorityConstants processes CollectionObject document + * + */ +public class WorkAuthorityConstants { + + public final static String NUXEO_DOCTYPE = "WorkAuthority"; + public final static String NUXEO_SCHEMA_NAME = "workauthority"; + public final static String NUXEO_DC_TITLE = "CollectionSpace-WorkAuthority"; +} diff --git a/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkAuthorityDocumentModelHandler.java b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkAuthorityDocumentModelHandler.java new file mode 100644 index 000000000..f295d71d0 --- /dev/null +++ b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkAuthorityDocumentModelHandler.java @@ -0,0 +1,55 @@ +/** + * This document is a part of the source code and related artifacts + * for CollectionSpace, an open source collections management system + * for museums and related institutions: + + * http://www.collectionspace.org + * http://wiki.collectionspace.org + + * Copyright 2009 University of California at Berkeley + + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + + * You may obtain a copy of the ECL 2.0 License at + + * https://source.collectionspace.org/collection-space/LICENSE.txt + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.collectionspace.services.work.nuxeo; + +import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler; +import org.collectionspace.services.work.WorkauthoritiesCommon; + +/** + * WorkAuthorityDocumentModelHandler + * + */ +public class WorkAuthorityDocumentModelHandler + extends AuthorityDocumentModelHandler { + + /** + * Common part schema label + */ + private static final String COMMON_PART_LABEL = "workauthorities_common"; + + public WorkAuthorityDocumentModelHandler() { + super(COMMON_PART_LABEL); + } + + /** + * getQProperty converts the given property to qualified schema property + * @param prop + * @return + */ + @Override + public String getQProperty(String prop) { + return WorkAuthorityConstants.NUXEO_SCHEMA_NAME + ":" + prop; + } +} + diff --git a/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkConstants.java b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkConstants.java new file mode 100644 index 000000000..44e80367a --- /dev/null +++ b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkConstants.java @@ -0,0 +1,35 @@ +/** + * This document is a part of the source code and related artifacts + * for CollectionSpace, an open source collections management system + * for museums and related institutions: + + * http://www.collectionspace.org + * http://wiki.collectionspace.org + + * Copyright 2009 University of California at Berkeley + + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + + * You may obtain a copy of the ECL 2.0 License at + + * https://source.collectionspace.org/collection-space/LICENSE.txt + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.collectionspace.services.work.nuxeo; + +/** + * WorkConstants processes CollectionObject document + * + */ +public class WorkConstants { + + public final static String NUXEO_DOCTYPE = "Work"; + public final static String NUXEO_SCHEMA_NAME = "work"; + public final static String NUXEO_DC_TITLE = "CollectionSpace-Work"; +} diff --git a/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkDocumentModelHandler.java b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkDocumentModelHandler.java new file mode 100644 index 000000000..8e175b76e --- /dev/null +++ b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkDocumentModelHandler.java @@ -0,0 +1,114 @@ +/** + * This document is a part of the source code and related artifacts + * for CollectionSpace, an open source collections management system + * for museums and related institutions: + + * http://www.collectionspace.org + * http://wiki.collectionspace.org + + * Copyright 2009 University of California at Berkeley + + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + + * You may obtain a copy of the ECL 2.0 License at + + * https://source.collectionspace.org/collection-space/LICENSE.txt + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.collectionspace.services.work.nuxeo; + +import org.collectionspace.services.WorkJAXBSchema; +import org.collectionspace.services.client.WorkAuthorityClient; +import org.collectionspace.services.common.document.DocumentWrapper; +import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler; +import org.collectionspace.services.work.WorksCommon; +import org.nuxeo.ecm.core.api.DocumentModel; + +/** + * WorkDocumentModelHandler + * + */ +public class WorkDocumentModelHandler + extends AuthorityItemDocumentModelHandler { + + /** + * Common part schema label + */ + private static final String COMMON_PART_LABEL = "works_common"; + + public WorkDocumentModelHandler() { + super(COMMON_PART_LABEL); + } + + @Override + public String getAuthorityServicePath(){ + return WorkAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932 + } + + /** + * Handle display name. + * + * @param docModel the doc model + * @throws Exception the exception + */ +// @Override +// protected void handleComputedDisplayNames(DocumentModel docModel) throws Exception { +// String commonPartLabel = getServiceContext().getCommonPartLabel("works"); +// Boolean displayNameComputed = (Boolean) docModel.getProperty(commonPartLabel, +// WorkJAXBSchema.DISPLAY_NAME_COMPUTED); +// Boolean shortDisplayNameComputed = (Boolean) docModel.getProperty(commonPartLabel, +// WorkJAXBSchema.SHORT_DISPLAY_NAME_COMPUTED); +// if(displayNameComputed==null) +// displayNameComputed = true; +// if(shortDisplayNameComputed==null) +// shortDisplayNameComputed = true; +// if (displayNameComputed || shortDisplayNameComputed) { +// // Obtain the primary work name from the list of work names, for computing the display name. +// String xpathToWorkName = WorkJAXBSchema.WORK_TERM_NAME_GROUP_LIST +// + "/[0]/" + WorkeJAXBSchema.WORK_TERM_NAME; +// String workName = getXPathStringValue(docModel, COMMON_PART_LABEL, xpathToWorkName); +// String displayName = prepareDefaultDisplayName(workName); +// if (displayNameComputed) { +// docModel.setProperty(commonPartLabel, WorkJAXBSchema.DISPLAY_NAME, +// displayName); +// } +// if (shortDisplayNameComputed) { +// docModel.setProperty(commonPartLabel, WorkJAXBSchema.SHORT_DISPLAY_NAME, +// displayName); +// } +// } +// } + + /** + * Produces a default displayName from one or more supplied fields. + * @see WorkAuthorityClientUtils.prepareDefaultDisplayName() which + * duplicates this logic, until we define a service-general utils package + * that is neither client nor service specific. + * @param workName + * @return the default display name + * @throws Exception + */ + private static String prepareDefaultDisplayName( + String workName ) throws Exception { + StringBuilder newStr = new StringBuilder(); + newStr.append(workName); + return newStr.toString(); + } + + /** + * getQProperty converts the given property to qualified schema property + * @param prop + * @return + */ + @Override + public String getQProperty(String prop) { + return WorkConstants.NUXEO_SCHEMA_NAME + ":" + prop; + } +} + diff --git a/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkValidatorHandler.java b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkValidatorHandler.java new file mode 100644 index 000000000..93d6341ec --- /dev/null +++ b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkValidatorHandler.java @@ -0,0 +1,148 @@ +/** + * This document is a part of the source code and related artifacts + * for CollectionSpace, an open source collections management system + * for museums and related institutions: + + * http://www.collectionspace.org + * http://wiki.collectionspace.org + + * Copyright 2009 University of California, Berkeley + + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + + * You may obtain a copy of the ECL 2.0 License at + + * https://source.collectionspace.org/collection-space/LICENSE.txt + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.collectionspace.services.work.nuxeo; + +import java.util.List; +import java.util.regex.Pattern; +import org.collectionspace.services.common.api.Tools; +import org.collectionspace.services.common.document.InvalidDocumentException; +import org.collectionspace.services.common.document.ValidatorHandlerImpl; +import org.collectionspace.services.work.WorkTermGroup; +import org.collectionspace.services.work.WorkTermGroupList; +import org.collectionspace.services.work.WorksCommon; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * WorkValidatorHandler + * + * Performs validation when making requests related to Work records. + * As an example, you can modify this class to customize validation of + * payloads supplied in requests to create and/or update records. + */ +public class WorkValidatorHandler extends ValidatorHandlerImpl { + + final Logger logger = LoggerFactory.getLogger(WorkValidatorHandler.class); + // 'Bad pattern' for shortIdentifiers matches any non-word characters + private static final Pattern SHORT_ID_BAD_PATTERN = Pattern.compile("[\\W]"); + private static final String SHORT_ID_BAD_CHARS_ERROR = + "shortIdentifier must only contain standard word characters"; + private static final String HAS_NO_TERMS_ERROR = + "Authority items must contain at least one term."; + private static final String TERM_HAS_EMPTY_DISPLAYNAME_ERROR = + "Each term group in an authority item must contain " + + "a non-empty display name."; + + @Override + protected Class getCommonPartClass() { + return WorksCommon.class; + } + + @Override + protected void handleCreate() throws InvalidDocumentException { + WorksCommon work = (WorksCommon) getCommonPart(); + // No guarantee that there is a common part in every post/update. + if (work != null) { + try { + String shortId = work.getShortIdentifier(); + if (shortId != null) { + CS_ASSERT(shortIdentifierContainsOnlyValidChars(shortId), SHORT_ID_BAD_CHARS_ERROR); + } + CS_ASSERT(containsAtLeastOneTerm(work), HAS_NO_TERMS_ERROR); + CS_ASSERT(allTermsContainDisplayName(work), TERM_HAS_EMPTY_DISPLAYNAME_ERROR); + } catch (AssertionError e) { + if (logger.isErrorEnabled()) { + logger.error(e.getMessage(), e); + } + throw new InvalidDocumentException(e.getMessage(), e); + } + } + } + + @Override + protected void handleGet() throws InvalidDocumentException { + } + + @Override + protected void handleGetAll() throws InvalidDocumentException { + } + + @Override + protected void handleUpdate() throws InvalidDocumentException { + WorksCommon work = (WorksCommon) getCommonPart(); + // No guarantee that there is a common part in every post/update. + if (work != null) { + try { + // shortIdentifier is among a set of fields that are + // prevented from being changed on an update, and thus + // we don't need to check its value here. + CS_ASSERT(containsAtLeastOneTerm(work), HAS_NO_TERMS_ERROR); + CS_ASSERT(allTermsContainDisplayName(work), TERM_HAS_EMPTY_DISPLAYNAME_ERROR); + } catch (AssertionError e) { + if (logger.isErrorEnabled()) { + logger.error(e.getMessage(), e); + } + throw new InvalidDocumentException(e.getMessage(), e); + } + } + } + + @Override + protected void handleDelete() throws InvalidDocumentException { + } + + private boolean shortIdentifierContainsOnlyValidChars(String shortId) { + // Check whether any characters match the 'bad' pattern + if (SHORT_ID_BAD_PATTERN.matcher(shortId).find()) { + return false; + } + return true; + } + + private boolean containsAtLeastOneTerm(WorksCommon work) { + WorkTermGroupList termGroupList = work.getWorkTermGroupList(); + if (termGroupList == null) { + return false; + } + List termGroups = termGroupList.getWorkTermGroup(); + if ((termGroups == null) || (termGroups.isEmpty())){ + return false; + } + return true; + } + + private boolean allTermsContainDisplayName(WorksCommon work) { + WorkTermGroupList termGroupList = work.getWorkTermGroupList(); + List termGroups = termGroupList.getWorkTermGroup(); + for (WorkTermGroup termGroup : termGroups) { + if (Tools.isBlank(termGroup.getTermDisplayName())) { + return false; + } + } + return true; + } +} + -- 2.47.3