From 1a400fc09d03526b48e0710c4a7e39f11e2a44f9 Mon Sep 17 00:00:00 2001 From: Laramie Crocker Date: Tue, 9 Nov 2010 20:49:16 +0000 Subject: [PATCH] NOJIRA: merging from branch sprint --- .../test/CollectionSpaceIntegrationTest.java | 2 +- .../test/RelationIntegrationTest.java | 2 +- .../test/XmlReplayMasterTest.java | 23 + .../test/XmlReplaySelfTest.java | 169 +++++++ .../xmlreplay/authrefs/newPerson.xml | 9 + .../xmlreplay/authrefs/newPersonAuthority.xml | 7 + .../test-data/xmlreplay/bugs/nonlatin/acq.out | 54 +++ .../test-data/xmlreplay/bugs/nonlatin/acq.sql | 4 + .../xmlreplay/bugs/nonlatin/acq19-mod.xml | 27 ++ .../xmlreplay/bugs/nonlatin/non-latin-3.txt | 1 + .../bugs/nonlatin/non-latin-notes.txt | 27 ++ .../xmlreplay/bugs/nonlatin/non-latin.xml | 19 + .../xmlreplay/bugs/nonlatin/utf-8-bug.txt | 27 ++ ...cspace-2242-first-value-instance-blank.xml | 22 + ...ace-2242-first-value-instance-nonblank.xml | 22 + .../collectionobject/nh-collectionobject.xml | 52 +++ .../xmlreplay/collectionobject/nh-part.xml | 6 + .../collectionobject/repfield_null1.xml | 6 + .../collectionobject/repfield_whitesp1.xml | 13 + .../collectionobject/repfield_whitesp2.xml | 20 + .../collectionobject/repfield_whitesp3.xml | 23 + .../collectionobject/repfield_whitesp4.xml | 20 + .../collectionobject/testCambridge-update.xml | 9 + .../collectionobject/testCambridge.xml | 94 ++++ .../test-data/xmlreplay/dimension-master.xml | 16 + .../test-data/xmlreplay/dimension.xml | 39 ++ .../test-data/xmlreplay/dimension/1.xml | 9 + .../test-data/xmlreplay/dimension/2-put.xml | 9 + .../xmlreplay/objectext/xml-replay-config.xml | 232 ++++++++++ .../test-data/xmlreplay/organization.xml | 37 ++ .../organization/organizations_common.xml | 31 ++ .../organization/orgauthorities_common.xml | 10 + .../xmlreplay/organization/repeatables.xml | 11 + .../test-data/xmlreplay/security.xml | 433 ++++++++++++++++++ .../security/1-bigbird-permission.xml | 19 + .../security/10-permissionroles-elmo.xml | 13 + .../security/11-bigbird-permission-CRU.xml | 16 + .../11-permissionroles-bigbird-CRU.xml | 13 + .../security/12-bigbird-permission-R.xml | 10 + .../security/12-permissionroles-bigbird-R.xml | 13 + .../security/13-permissionroles-bigbird.xml | 13 + .../xmlreplay/security/2-elmo-permission.xml | 9 + .../xmlreplay/security/3-role-test-cm.xml | 6 + .../xmlreplay/security/4-role-intern.xml | 5 + .../xmlreplay/security/5-account-bigbird.xml | 14 + .../xmlreplay/security/6-account-elmo.xml | 14 + .../security/7-accountroles-bigbird.xml | 15 + .../security/8-account-roles-elmo.xml | 15 + .../security/9-permissionroles-bigbird.xml | 13 + .../security/Base64-authentication-notes.txt | 44 ++ .../test-data/xmlreplay/xml-replay-config.xml | 255 +++++++++++ .../xmlreplay/xml-replay-master-self-test.xml | 16 + .../test-data/xmlreplay/xml-replay-master.xml | 27 ++ .../xmlreplay/xml-replay-self-test.xml | 37 ++ 54 files changed, 2050 insertions(+), 2 deletions(-) rename services/IntegrationTests/src/test/java/org/collectionspace/services/{ItegrationTests => IntegrationTests}/test/CollectionSpaceIntegrationTest.java (95%) mode change 100644 => 100755 rename services/IntegrationTests/src/test/java/org/collectionspace/services/{ItegrationTests => IntegrationTests}/test/RelationIntegrationTest.java (99%) mode change 100644 => 100755 create mode 100755 services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/XmlReplayMasterTest.java create mode 100755 services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/XmlReplaySelfTest.java create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/newPerson.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/newPersonAuthority.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/acq.out create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/acq.sql create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/acq19-mod.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin-3.txt create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin-notes.txt create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/utf-8-bug.txt create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/cspace-2242-first-value-instance-blank.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/cspace-2242-first-value-instance-nonblank.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/nh-collectionobject.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/nh-part.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_null1.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp1.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp2.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp3.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp4.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/testCambridge-update.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/testCambridge.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension-master.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/1.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/2-put.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectext/xml-replay-config.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/organizations_common.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/orgauthorities_common.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/repeatables.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/1-bigbird-permission.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/10-permissionroles-elmo.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/11-bigbird-permission-CRU.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/11-permissionroles-bigbird-CRU.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/12-bigbird-permission-R.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/12-permissionroles-bigbird-R.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/13-permissionroles-bigbird.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/2-elmo-permission.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/3-role-test-cm.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/4-role-intern.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/5-account-bigbird.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/6-account-elmo.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/7-accountroles-bigbird.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/8-account-roles-elmo.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/9-permissionroles-bigbird.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/Base64-authentication-notes.txt create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-config.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master-self-test.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-self-test.xml diff --git a/services/IntegrationTests/src/test/java/org/collectionspace/services/ItegrationTests/test/CollectionSpaceIntegrationTest.java b/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/CollectionSpaceIntegrationTest.java old mode 100644 new mode 100755 similarity index 95% rename from services/IntegrationTests/src/test/java/org/collectionspace/services/ItegrationTests/test/CollectionSpaceIntegrationTest.java rename to services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/CollectionSpaceIntegrationTest.java index 66ea21185..03f39e960 --- a/services/IntegrationTests/src/test/java/org/collectionspace/services/ItegrationTests/test/CollectionSpaceIntegrationTest.java +++ b/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/CollectionSpaceIntegrationTest.java @@ -24,7 +24,7 @@ * You may obtain a copy of the ECL 2.0 License at * https://source.collectionspace.org/collection-space/LICENSE.txt */ -package org.collectionspace.services.ItegrationTests.test; +package org.collectionspace.services.IntegrationTests.test; import java.util.ArrayList; diff --git a/services/IntegrationTests/src/test/java/org/collectionspace/services/ItegrationTests/test/RelationIntegrationTest.java b/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/RelationIntegrationTest.java old mode 100644 new mode 100755 similarity index 99% rename from services/IntegrationTests/src/test/java/org/collectionspace/services/ItegrationTests/test/RelationIntegrationTest.java rename to services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/RelationIntegrationTest.java index 4a07ac09a..74ab97e5b --- a/services/IntegrationTests/src/test/java/org/collectionspace/services/ItegrationTests/test/RelationIntegrationTest.java +++ b/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/RelationIntegrationTest.java @@ -20,7 +20,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.collectionspace.services.ItegrationTests.test; +package org.collectionspace.services.IntegrationTests.test; import java.util.List; diff --git a/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/XmlReplayMasterTest.java b/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/XmlReplayMasterTest.java new file mode 100755 index 000000000..eed0cfe65 --- /dev/null +++ b/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/XmlReplayMasterTest.java @@ -0,0 +1,23 @@ +package org.collectionspace.services.IntegrationTests.test; + +import org.collectionspace.services.IntegrationTests.xmlreplay.ServiceResult; +import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplay; +import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplayTest; +import org.testng.annotations.Test; + +import java.util.List; + +/** + * User: laramie + * $LastChangedRevision: $ + * $LastChangedDate: $ + */ +public class XmlReplayMasterTest extends XmlReplayTest { + + @Test + public void runMaster() throws Exception { + XmlReplay replay = createXmlReplayUsingIntegrationTestsModule(".."); + List> list = replay.runMaster(XmlReplay.DEFAULT_MASTER_CONTROL); + logTestForGroup(list, "XmlReplayMasterTest"); + } +} diff --git a/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/XmlReplaySelfTest.java b/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/XmlReplaySelfTest.java new file mode 100755 index 000000000..b66b1b23c --- /dev/null +++ b/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/XmlReplaySelfTest.java @@ -0,0 +1,169 @@ +/** + * 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.IntegrationTests.test; + +import org.collectionspace.services.IntegrationTests.xmlreplay.ServiceResult; +import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplay; +import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplayTest; +import org.testng.annotations.Test; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** The test cases in here also document the ways that XmlReplay was designed to be used programmatically. + * The most automated way to use XmlReplay is demonstrated in runMaster(). You just create a master file and a control + * file in the IntegrationTests xml replay repository, which is in services/IntegrationTests + XmlReplayTest.XMLREPLAY_REL_DIR_TO_MODULE. + * + * If you choose to run from a module, you'll need to add a dependency to the IntegrationTests module: + * e.g. + * <project ...> + * <dependencies> + * <dependency> + <groupId>org.collectionspace.services</groupId> + <artifactId>org.collectionspace.services.IntegrationTests</artifactId> + <version>${project.version}</version> + </dependency> + * + * User: laramie + * $LastChangedRevision: $ + * $LastChangedDate: $ + */ +public class XmlReplaySelfTest extends XmlReplayTest { + + public static XmlReplay createXmlReplay() throws Exception { + return XmlReplayTest.createXmlReplayUsingIntegrationTestsModule(".."); + //NOTE: this self-test lives in services/IntegrationTests, so relToServicesRoot is ".." + // but if you were running from, say, services/dimension/client, then relToServicesRoot would be "../.." + // so you would have to call XmlReplayTest.createXmlReplayUsingIntegrationTestsModule("../..") + // which is done for you if you just call XmlReplayTest.createXmlReplay(). + } + + @Test + public void runMaster() throws Exception { + XmlReplay replay = createXmlReplay(); + List> list = replay.runMaster("xml-replay-master-self-test.xml"); + logTestForGroup(list, "runMaster"); + } + + @Test + public void runTestGroup() throws Exception { + XmlReplay replay = createXmlReplay(); + replay.readOptionsFromMasterConfigFile("xml-replay-master-self-test.xml"); //or use: XmlReplay.DEFAULT_MASTER_CONTROL as master filename; + replay.setControlFileName("xml-replay-self-test.xml"); + List list = replay.runTestGroup("selftestGroup"); + logTest(list, "runTestGroup"); + } + + @Test + public void runOneTest() throws Exception { + XmlReplay replay = createXmlReplay(); + replay.readOptionsFromMasterConfigFile("xml-replay-master-self-test.xml"); + replay.setControlFileName("xml-replay-self-test.xml"); + + ServiceResult res = replay.runTest("selftestGroup", "OrgAuth1"); + logTest(res, "runOneTest"); + } + + + @Test + public void runMultipleTestsManualCleanup() throws Exception { + XmlReplay replay = createXmlReplay(); + replay.readOptionsFromMasterConfigFile("xml-replay-master-self-test.xml"); + replay.setControlFileName("xml-replay-self-test.xml"); + replay.setAutoDeletePOSTS(false); //defaults to true, so turn it off to to it ourselves. + + List testResultsList = new ArrayList(); + + ServiceResult res1 = replay.runTest("selftestGroup", "OrgAuth1"); + testResultsList.add(res1); + + ServiceResult res2 = replay.runTest("selftestGroup", "Org1"); + testResultsList.add(res2); + + ServiceResult res3 = replay.runTest("selftestGroup", "getOrg1"); + testResultsList.add(res3); + + //Now, clean up. You may skip this if your tests do all the DELETEs. + List deleteList = replay.autoDelete("runMultipleTestsManualCleanup"); + + logTest(testResultsList, "runTwoTestsManualCleanup.tests"); + logTest(deleteList, "runTwoTestsManualCleanup.cleanups"); + + } + + + @Test + public void runTestGroup_AllOptions() throws Exception { + XmlReplay replay = createXmlReplay(); //Use the central repository. + //You can also use your own xml replay repository in your module, like so: + // XmlReplay replay = XmlReplayTest.createXmlReplayForModule(); if you are in your module + //You can also manually specify to use the central repository: + // XmlReplay replay = XmlReplayTest.createXmlReplayUsingIntegrationTestsModule(".."); if you are in a module such as dimension + // XmlReplay replay = XmlReplayTest.createXmlReplayUsingIntegrationTestsModule("../.."); if you are in a module such as dimension/client + + //You may read Dump, Auths, and protoHostPort from the master file: + replay.readOptionsFromMasterConfigFile("xml-replay-master-self-test.xml"); //or use: XmlReplay.DEFAULT_MASTER_CONTROL as master filename; + //or you may set those options individually as shown next. + // Note that controlFileName is NOT set from calling readOptionsFromMasterConfigFile. + // If you run a master, it sets controlFileName, possibly in a loop. + // All of the Auths will be read from the master file, and may be referenced from your control file, + // or you may specify Auths in your control file. There are also public methods to set the AuthsMap yourself. + + //XmlReplay wants to know about two files: a master and a control file + // The master references one to many control files. + // If you don't call runMaster(), you must specify the control file: + replay.setControlFileName("xml-replay-self-test.xml"); + + //These option default sensibly, some of them from the master, but here's how to set them all: + + //Dump determines how much goes to log, and how verbose. + XmlReplay.Dump dump = XmlReplay.getDumpConfig(); //static factory call. + dump.payloads = false; + dump.dumpServiceResult = ServiceResult.DUMP_OPTIONS.minimal; + replay.setDump(dump); + + //use this if you must look it up from some other place. + // Default is to have it in xml-replay-master.xml + replay.setProtoHostPort("http://localhost:8180"); + + //Default is true, but you can override if you want to leave objects on server, or control the order of deletion. + replay.setAutoDeletePOSTS(false); + + //You don't need this, but you can inspect what XmlReplay holds onto: a data structure of CSIDs + Map serviceResultsMap = replay.getServiceResultsMap(); + + // ****** RUN A GROUP *********************************************** + List list = replay.runTestGroup("selftestGroup"); + + // This runs a group called "organization" inside a control file named above, which happens to be called "organization.xml". + // You could also run just one test using these options by calling replay.runTest as shown above in XmlReplayTest.runOneTest() + + //Now, since we set setAutoDeletePOSTS(false) above, you can clean up manually: + replay.autoDelete("runTestGroup_AllOptions"); //deletes everything in serviceResultsMap, which it hangs onto. + + logTest(list, "runTestGroup_AllOptions"); + } + +} diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/newPerson.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/newPerson.xml new file mode 100755 index 000000000..eef3b8b76 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/newPerson.xml @@ -0,0 +1,9 @@ + + +4a6dc8f3-3329-4c5d-a1a8 +connieContactPerson +urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth)'TestPersonAuth':person:name(connieContactPerson) +true +Connie +ContactPerson + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/newPersonAuthority.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/newPersonAuthority.xml new file mode 100755 index 000000000..7809ec478 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/newPersonAuthority.xml @@ -0,0 +1,7 @@ + + +TestPersonAuth +TestPersonAuth +urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth)'TestPersonAuth' +PersonAuthority + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/acq.out b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/acq.out new file mode 100755 index 000000000..4a8568c1b --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/acq.out @@ -0,0 +1,54 @@ +-- MySQL dump 10.11 +-- +-- Host: localhost Database: nuxeo +-- ------------------------------------------------------ +-- Server version 5.0.51a-24+lenny3 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `acquisitions_common_acquisitionsources` +-- + +DROP TABLE IF EXISTS `acquisitions_common_acquisitionsources`; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +CREATE TABLE `acquisitions_common_acquisitionsources` ( + `id` varchar(36) character set utf8 collate utf8_bin NOT NULL, + `pos` int(11) default NULL, + `item` varchar(500) default NULL, + KEY `acquisitions_common_acquisitionsources_id_hierarchy_fk` (`id`), + KEY `id_idx` (`id`), + CONSTRAINT `acquisitions_common_acquisitionsources_id_hierarchy_fk` FOREIGN KEY (`id`) REFERENCES `hierarchy` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SET character_set_client = @saved_cs_client; + +-- +-- Dumping data for table `acquisitions_common_acquisitionsources` +-- + +LOCK TABLES `acquisitions_common_acquisitionsources` WRITE; +/*!40000 ALTER TABLE `acquisitions_common_acquisitionsources` DISABLE KEYS */; +INSERT INTO `acquisitions_common_acquisitionsources` VALUES ('7a517303-afad-458f-b8fb-3adaaad901b0',0,'urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(stephencharla)\'Stephen+Charla\''),('7a517303-afad-458f-b8fb-3adaaad901b0',1,'urn:cspace:org.collectionspace.demo:orgauthority:name(organization):organization:name(emersonradiophonographcorporation)\'Emerson+Radio+Phonograph+Corporation\''),('7a517303-afad-458f-b8fb-3adaaad901b0',2,''),('7a517303-afad-458f-b8fb-3adaaad901b0',3,'urn:cspace:org.collectionspace.demo:orgauthority:name(organization):organization:name(irwintoylimited)\'Irwin+Toy+Limited\''),('08372066-b1cd-4168-b480-6e198eff4df3',0,''),('a5235e94-9612-4fcd-a125-019a937cfb39',0,''),('65d03bcd-8c4a-48e6-a204-850bb382cb15',0,''),('4e330edd-ebf4-4425-bb18-2d58624cbb25',0,' ⺠ , 0 1The β Source of All ψ Acquisitions'),('d675779c-e93d-48ce-bed9-3ac3dd3740c2',0,' ? , 0 1The ? Source of All ? Acquisitions'); +/*!40000 ALTER TABLE `acquisitions_common_acquisitionsources` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2010-10-08 22:31:11 diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/acq.sql b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/acq.sql new file mode 100755 index 000000000..90eee8fef --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/acq.sql @@ -0,0 +1,4 @@ +update acquisitions_common_acquisitionsources set item =' ⺠ , 0 1The β Source of All ψ Acquisitions' where id = '4e330edd-ebf4-4425-bb18-2d58624cbb25'; + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/acq19-mod.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/acq19-mod.xml new file mode 100755 index 000000000..9d810f1af --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/acq19-mod.xml @@ -0,0 +1,27 @@ + + + + This is a transfer of title number + + + + + + + + fubar + + + + + + + + + ⺠ , 0 1The β Source of All ψ Acquisitions + + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin-3.txt b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin-3.txt new file mode 100755 index 000000000..ff06d2f62 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin-3.txt @@ -0,0 +1 @@ + ⺠, 0 1The β Source of All ψ Acquisitions diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin-notes.txt b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin-notes.txt new file mode 100755 index 000000000..765ff9abc --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin-notes.txt @@ -0,0 +1,27 @@ +Here are the steps we tried: + +On nightly.collectionspace.org, which is running Nuxeo 5.3 with mysql + + Update a record through Nuxeo Web GUI, inserting a greek psi character. + ==> failure: able to edit record, but on read and edit again, character is tranformed into question mark. + +On nightly, we ran a SQL update and then a SQL dump on a table, and got the UTF8 non-Latin1 characters back. + ==> success: full round trip, from file.sql to MySQL to file.out . + Note that we used the UTF8 option on the command line: + + mysql -u cspace_user -p --default_character_set utf8 nuxeo < ~/acq.sql + + mysqldump -u cspace_user -p nuxeo acquisitions_common_acquisitionsources > acq.out + +On localhost which is running the older version of Nuxeo with mysql + + Update a record through Nuxeo Web GUI, inserting a greek psi character. + ==> success: able to read and edit record and see character. + + + +Notes: + Check the encoding of the DB: + mysql> SHOW VARIABLES LIKE 'character_set_database'; + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin.xml new file mode 100755 index 000000000..534d65f8f --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin.xml @@ -0,0 +1,19 @@ + + + http://localhost:8280 + + + POST + /cspace-services/acquisitions/ + + + acq19-mod.xml + + + + GET + /cspace-services/acquisitions/ + 1001 + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/utf-8-bug.txt b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/utf-8-bug.txt new file mode 100755 index 000000000..765ff9abc --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/utf-8-bug.txt @@ -0,0 +1,27 @@ +Here are the steps we tried: + +On nightly.collectionspace.org, which is running Nuxeo 5.3 with mysql + + Update a record through Nuxeo Web GUI, inserting a greek psi character. + ==> failure: able to edit record, but on read and edit again, character is tranformed into question mark. + +On nightly, we ran a SQL update and then a SQL dump on a table, and got the UTF8 non-Latin1 characters back. + ==> success: full round trip, from file.sql to MySQL to file.out . + Note that we used the UTF8 option on the command line: + + mysql -u cspace_user -p --default_character_set utf8 nuxeo < ~/acq.sql + + mysqldump -u cspace_user -p nuxeo acquisitions_common_acquisitionsources > acq.out + +On localhost which is running the older version of Nuxeo with mysql + + Update a record through Nuxeo Web GUI, inserting a greek psi character. + ==> success: able to read and edit record and see character. + + + +Notes: + Check the encoding of the DB: + mysql> SHOW VARIABLES LIKE 'character_set_database'; + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/cspace-2242-first-value-instance-blank.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/cspace-2242-first-value-instance-blank.xml new file mode 100755 index 000000000..c0ab86876 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/cspace-2242-first-value-instance-blank.xml @@ -0,0 +1,22 @@ + + + + + 2 + description + + + + + + bob2 + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/cspace-2242-first-value-instance-nonblank.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/cspace-2242-first-value-instance-nonblank.xml new file mode 100755 index 000000000..a75c58472 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/cspace-2242-first-value-instance-nonblank.xml @@ -0,0 +1,22 @@ + + + + + 2 + description + + + + data + + bob2 + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/nh-collectionobject.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/nh-collectionobject.xml new file mode 100755 index 000000000..06ed8577b --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/nh-collectionobject.xml @@ -0,0 +1,52 @@ + + + +2271966-1285644709415 +remNumber + +objectNumber-1285644709375 + + +101.objectName-1285644709375 +integer + + +101.502.23.456.objectName-1285644709375 +ipaddress + + +urn:org.walkerart.id:123 + +Papier mache bird cow mask with horns, painted red with black and yellow spots. Puerto Rico. ca. 8&quot; high, 6&quot; wide, projects 10&quot; (with horns). +Acrylic rabbit mask with wings, painted red with green and aquamarine spots. Puerto Rico. ca. 8&quot; high, 6&quot; wide, projects 10&quot; (with wings). + + + +an object name + + + +urn:org.collectionspace.services.department:Registrar +urn:org.walkerart.department:Fine Art + +atitle + + + + +length +head +cm +30 + + +width +leg +m +2.57 + + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/nh-part.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/nh-part.xml new file mode 100755 index 000000000..1debb2a30 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/nh-part.xml @@ -0,0 +1,6 @@ + + +test-string +999 +9999 + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_null1.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_null1.xml new file mode 100755 index 000000000..3eff5fc38 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_null1.xml @@ -0,0 +1,6 @@ + + +objectNumber + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp1.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp1.xml new file mode 100755 index 000000000..df977b5f2 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp1.xml @@ -0,0 +1,13 @@ + + +objectNumber + +XXX +otherNumberType + briefDescription +distFeatures +numberOfObjects + + responsibleDept1responsibleDept2 +title + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp2.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp2.xml new file mode 100755 index 000000000..1917883d7 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp2.xml @@ -0,0 +1,20 @@ + + +objectNumber + +XXX +otherNumberType + +briefDescription1 +briefDescription2 + +distFeatures +numberOfObjects + + +responsibleDept1 +responsibleDept2 + + +title + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp3.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp3.xml new file mode 100755 index 000000000..ab44bf314 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp3.xml @@ -0,0 +1,23 @@ + + +objectNumber + +XXX +otherNumberType + + + briefDescription1 +briefDescription2 + + +distFeatures +numberOfObjects + + + + responsibleDept1 +responsibleDept2 + + +title + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp4.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp4.xml new file mode 100755 index 000000000..e8746eed1 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/repfield_whitesp4.xml @@ -0,0 +1,20 @@ + + +objectNumber + +XXX +otherNumberType + + briefDescription1 + briefDescription2 + +distFeatures +numberOfObjects + + + responsibleDept1 + responsibleDept2 + + +title + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/testCambridge-update.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/testCambridge-update.xml new file mode 100755 index 000000000..81aeadcfc --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/testCambridge-update.xml @@ -0,0 +1,9 @@ + + + objectNumber + XXX + otherNumberType + This is an UPDATEd comment + NEW TITLE UPDATED + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/testCambridge.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/testCambridge.xml new file mode 100755 index 000000000..00f581393 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/testCambridge.xml @@ -0,0 +1,94 @@ + + + objectNumber + XXX + otherNumberType + + comments + distFeatures + numberOfObjects + + + title + objectTitleLanguage + titleTranslation + titleType + age + ageQualifier + ageUnit + color + contentActivity + contentConcept + XXX + contentDescription + contentEventName + contentEventNameType + contentNote + contentLanguage + contentObject + contentObjectType + contentOrganization + contentOther + contentOtherType + contentPeople + contentPerson + contentPlace + contentPosition + XXX + copyNumber + editionNumber +
form
+ inscriptionContent +inscriptionContentInscriber +inscriptionContentDate +inscriptionContentInterpretation +inscriptionContentLanguage +inscriptionContentMethod +inscriptionContentPosition +inscriptionContentScript +inscriptionContentTranslation +inscriptionContentTransliteration +inscriptionContentType inscriptionDescription + +inscriptionDescriptionInscriber + +inscriptionDescriptionDate + +inscriptionDescriptionInterpretation + +inscriptionDescriptionMethod + +inscriptionDescriptionPosition + +inscriptionDescriptionType + material + materialComponent + materialComponentNote + materialName + materialSource + objectStatus + phase + physicalDescription + sex + + technicalAttribute + +technicalAttributeMeasurement + +technicalAttributeMeasurementUnit + objectComponentName + +objectComponentInformation + dateAssociation + +{"level":"objectLevel","content-script":"descContentScript","content-method":"descContentMethod","otherNumber":"otherNumber"} + +dateEarliestSingleCertainty + +dateEarlierstSingleQualifier + XXX + dateLatestCertainty + dateLatestQualifier + datePeriod + dateText +
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension-master.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension-master.xml new file mode 100755 index 000000000..a5a7750b6 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension-master.xml @@ -0,0 +1,16 @@ + + + http://localhost:8180 + + + + + + dGVzdDp0ZXN0 + + + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension.xml new file mode 100755 index 000000000..cd1a23c5d --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension.xml @@ -0,0 +1,39 @@ + + + + + dGVzdDp0ZXN0 + YmlnYmlyZDIwMTA6YmlnYmlyZDIwMTA= + + + + + + + + 403 + POST + /cspace-services/dimensions/ + + + dimension/1.xml + + + + + + + 403 + POST + /cspace-services/dimensions/ + + + dimension/1.xml + + + + + + + + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/1.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/1.xml new file mode 100755 index 000000000..6867ddfaf --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/1.xml @@ -0,0 +1,9 @@ + + + dimensionType-1288727556164 + entryNumber-1288727556164 + entryDate-1288727556164 + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/2-put.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/2-put.xml new file mode 100755 index 000000000..6fa97caee --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/2-put.xml @@ -0,0 +1,9 @@ + + + dimensionType-1288727552274 + updated-entryNumber-1288727552274 + updated-entryDate-1288727552274 + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectext/xml-replay-config.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectext/xml-replay-config.xml new file mode 100755 index 000000000..18e5550f8 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectext/xml-replay-config.xml @@ -0,0 +1,232 @@ + + + http://localhost:8280 + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/repfield_whitesp1.xml + + + + GET + /cspace-services/collectionobjects/ + nh + + + PUT + /cspace-services/collectionobjects/ + + + collectionobject/testCambridge-update.xml + + cambridge-1 + + + DELETE + /cspace-services/collectionobjects/ + 1001 + + + LIST + /cspace-services/personauthorities/ + newPersonAuthority + + + GET + /cspace-services/collectionobjects/ + + + collectionobject/repfield_whitesp2.xml + + + + + + + POST + /cspace-services/collectionobjects/ + + + + collectionobject/nh-collectionobject.xml + + + + collectionobject/nh-part.xml + + + + + GET + /cspace-services/collectionobjects/ + nh + + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/repfield_whitesp2.xml + + + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/repfield_whitesp1.xml + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/repfield_whitesp2.xml + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/repfield_whitesp3.xml + + + + DELETE + /cspace-services/collectionobjects/ + 1001 + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/repfield_whitesp4.xml + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/cspace-2242-first-value-instance-blank.xml + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/cspace-2242-first-value-instance-nonblank.xml + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/repfield_null1.xml + + + + GET + /cspace-services/collectionobjects/?sortBy=&pgNum=0&pgSz=8 + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/testCambridge.xml + + + + GET + /cspace-services/collectionobjects/ + cambridge-1 + + + PUT + /cspace-services/collectionobjects/ + + + collectionobject/testCambridge-update.xml + + cambridge-1 + + + + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/testCambridge.xml + + + + GET + /cspace-services/collectionobjects/ + cambridge-2 + + + PUT + /cspace-services/collectionobjects/ + + + collectionobject/testCambridge-update.xml + + cambridge-2 + + + + + + + POST + /cspace-services/personauthorities/ + + + authrefs/newPersonAuthority.xml + + + + GET + /cspace-services/personauthorities/ + newPersonAuthority + + + POST + /cspace-services/personauthorities/ + + + authrefs/newPerson.xml + + newPersonAuthority + + + + + LIST + /cspace-services/personauthorities/ + newPersonAuthority + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization.xml new file mode 100755 index 000000000..e02a01c26 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization.xml @@ -0,0 +1,37 @@ + + + + + POST + /cspace-services/orgauthorities/ + + + organization/orgauthorities_common.xml + + + + POST + /cspace-services/orgauthorities/${OrgAuth1.CSID}/items/ + + + organization/organizations_common.xml + + + + GET + /cspace-services/orgauthorities/${OrgAuth1.CSID}/items/${Org1.CSID} + + + GET + /cspace-services/orgauthorities/${OrgAuth1.CSID} + + + LIST + /cspace-services/orgauthorities/${OrgAuth1.CSID} + + + LIST + /cspace-services/orgauthorities/${OrgAuth1.CSID}/items/ + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/organizations_common.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/organizations_common.xml new file mode 100755 index 000000000..addcdeb4d --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/organizations_common.xml @@ -0,0 +1,31 @@ + + + 1288047801161 + urn:cspace:org.collectionspace.demo:orgauthority:name(1288047801161):organization:name(1288047801161) + true + true + Test Organization-1288047801161 + Test Organization Name + + urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth)'TestPersonAuth':person:name(charlieOrgcontact) + urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth)'TestPersonAuth':person:name(chelsieContact) + + Anytown, USA + + urn:cspace:org.collectionspace.demo:orgauthority:name(1288047801161):organization:name(1288047803708) + + + My new function + My second function + + + My new group + My second group + My third group + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/orgauthorities_common.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/orgauthorities_common.xml new file mode 100755 index 000000000..fb559baca --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/orgauthorities_common.xml @@ -0,0 +1,10 @@ + + + 1288047801161 + TestOrgAuth-1288047801161 + urn:cspace:org.collectionspace.demo:orgauthority:name(1288047801161)'TestOrgAuth-1288047801161' + OrgAuthority + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/repeatables.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/repeatables.xml new file mode 100755 index 000000000..7a85a0740 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/repeatables.xml @@ -0,0 +1,11 @@ + + + 1288047805974 + displayName-1288047805974 + urn:cspace:org.collectionspace.demo:orgauthority:name(1288047805974)'displayName-1288047805974' + OrgAuthority + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security.xml new file mode 100755 index 000000000..451566a3b --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security.xml @@ -0,0 +1,433 @@ + + + + + dGVzdDp0ZXN0 + dGVzdC1wYWhtYTp0ZXN0 + dXNlcjFAbXVzZXVtMS5vcmc6dXNlcjFAbXVzZXVtMS5vcmc= + YmlnYmlyZDIwMTA6YmlnYmlyZDIwMTA= + ZWxtbzIwMTA6ZWxtbzIwMTA= + + + + + + 401,500,501 + POST + /cspace-services/dimensions/ + + + dimension/1.xml + + + + + + POST + /cspace-services/authorization/permissions + security/1-bigbird-permission.xml + + + POST + /cspace-services/authorization/permissions + security/2-elmo-permission.xml + + + POST + /cspace-services/authorization/roles + security/3-role-test-cm.xml + + + POST + /cspace-services/authorization/roles + security/4-role-intern.xml + + + POST + /cspace-services/accounts + security/5-account-bigbird.xml + + + POST + /cspace-services/accounts + security/6-account-elmo.xml + + + POST + /cspace-services/accounts/${accountBigbird.CSID}/accountroles + security/7-accountroles-bigbird.xml + + + POST + /cspace-services/accounts/${accountElmo.CSID}/accountroles + security/8-account-roles-elmo.xml + + + POST + /cspace-services/authorization/permissions/${permBigbird.CSID}/permroles + security/9-permissionroles-bigbird.xml + + + POST + /cspace-services/authorization/permissions/${permElmo.CSID}/permroles + security/10-permissionroles-elmo.xml + + + + POST + /cspace-services/dimensions/ + + + dimension/1.xml + + + + PUT + /cspace-services/dimensions/${dimension1.CSID} + + + dimension/2-put.xml + + + + GET + /cspace-services/dimensions/ + dimension1 + + + 403 + POST + /cspace-services/dimensions/ + + + dimension/1.xml + + + + 403 + PUT + /cspace-services/dimensions/${dimension1.CSID} + + + dimension/2-put.xml + + + + GET + /cspace-services/dimensions/ + dimension1 + + + 403 + DELETE + dimension1 + + + DELETE + dimension1 + + + + + + + DELETE + /cspace-services/authorization/permissions/${permBigbird.CSID}/permroles + + + + DELETE + /cspace-services/authorization/permissions/${permElmo.CSID}/permroles + + + + Removing all permissions from Bigbird's role + 403,404 + POST + /cspace-services/dimensions/ + + + dimension/1.xml + + + + 404 + PUT + /cspace-services/dimensions/${dimension1.CSID} + + + dimension/2-put.xml + + + + + + DELETE + /cspace-services/accounts/${accountBigbird.CSID}/accountroles + + + DELETE + /cspace-services/accounts/${accountElmo.CSID}/accountroles + + + DELETE + + ${roleTestCM.deleteURL} + roleTestCM + + + DELETE + roleIntern + + + DELETE + accountBigbird + + + DELETE + accountElmo + + + + + + + + + + + + + + + 401,500,501 + POST + /cspace-services/dimensions/ + + + dimension/1.xml + + + + + + POST + /cspace-services/authorization/permissions + security/1-bigbird-permission.xml + + + POST + /cspace-services/authorization/roles + security/3-role-test-cm.xml + + + POST + /cspace-services/accounts + security/5-account-bigbird.xml + + + POST + /cspace-services/accounts/${accountBigbird.CSID}/accountroles + security/7-accountroles-bigbird.xml + + + POST + /cspace-services/authorization/permissions/${permBigbird.CSID}/permroles + security/9-permissionroles-bigbird.xml + + + + + + POST + /cspace-services/dimensions/ + + + dimension/1.xml + + + + PUT + /cspace-services/dimensions/${dimensionBigbird_POST.CSID} + + + dimension/2-put.xml + + + + GET + /cspace-services/dimensions/ + dimensionBigbird_POST + + + DELETE + dimensionBigbird_POST + + + + + + Deleting permroles from bigbird2010 + DELETE + /cspace-services/authorization/permissions/${permBigbird.CSID}/permroles + + + + + + Trying to POST after permroles removed from Bigbird + 404 + POST + /cspace-services/dimensions/ + + + dimension/1.xml + + + + 404 + PUT + /cspace-services/dimensions/${dimensionBigbird_POST_AfterPermrolesDeleted.CSID} + + + dimension/2-put.xml + + + + 404 + GET + /cspace-services/dimensions/ + dimensionBigbird_POST_AfterPermrolesDeleted + + + 404 + DELETE + dimensionBigbird_POST_AfterPermrolesDeleted + + + + + + POST + /cspace-services/authorization/permissions + security/11-bigbird-permission-CRU.xml + + + POST + /cspace-services/authorization/permissions/${permBigbird_CRU.CSID}/permroles + security/11-permissionroles-bigbird-CRU.xml + + + + + + POST + /cspace-services/dimensions/ + + + dimension/1.xml + + + + PUT + /cspace-services/dimensions/${dimensionBigbird_POST_CRU.CSID} + + + dimension/2-put.xml + + + + GET + /cspace-services/dimensions/ + dimensionBigbird_POST_CRU + + + 404 + DELETE + dimensionBigbird_POST_CRU + + + + + + Deleting permroles from bigbird2010 + DELETE + /cspace-services/authorization/permissions/${permBigbird_CRU.CSID}/permroles + + + + + + POST + /cspace-services/authorization/permissions + security/12-bigbird-permission-R.xml + + + POST + /cspace-services/authorization/permissions/${permBigbird_R.CSID}/permroles + security/12-permissionroles-bigbird-R.xml + + + + + + 404 + POST + /cspace-services/dimensions/ + + + dimension/1.xml + + + + 404 + PUT + /cspace-services/dimensions/${dimensionBigbird_POST_R.CSID} + + + dimension/2-put.xml + + + + GET + /cspace-services/dimensions/ + dimensionBigbird_POST_R + + + 404 + DELETE + dimensionBigbird_POST_R + + + + + DELETE + /cspace-services/accounts/${accountBigbird.CSID}/accountroles + + + DELETE + roleTestCM + + + DELETE + accountBigbird + + + + + + + + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/1-bigbird-permission.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/1-bigbird-permission.xml new file mode 100755 index 000000000..30c459671 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/1-bigbird-permission.xml @@ -0,0 +1,19 @@ + + + dimensions + + CREATE + + + READ + + + UPDATE + + + DELETE + + PERMIT + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/10-permissionroles-elmo.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/10-permissionroles-elmo.xml new file mode 100755 index 000000000..0806b9414 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/10-permissionroles-elmo.xml @@ -0,0 +1,13 @@ + + + + ${permElmo.CSID} + dimensions + + + ${roleIntern.CSID} + ROLE_TEST_INTERN + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/11-bigbird-permission-CRU.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/11-bigbird-permission-CRU.xml new file mode 100755 index 000000000..f542aa5e6 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/11-bigbird-permission-CRU.xml @@ -0,0 +1,16 @@ + + + dimensions + + CREATE + + + READ + + + UPDATE + + PERMIT + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/11-permissionroles-bigbird-CRU.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/11-permissionroles-bigbird-CRU.xml new file mode 100755 index 000000000..90287511f --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/11-permissionroles-bigbird-CRU.xml @@ -0,0 +1,13 @@ + + + + ${permBigbird_CRU.CSID} + dimensions + + + ${roleTestCM.CSID} + ROLE_TEST_CM + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/12-bigbird-permission-R.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/12-bigbird-permission-R.xml new file mode 100755 index 000000000..4786d012f --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/12-bigbird-permission-R.xml @@ -0,0 +1,10 @@ + + + dimensions + + READ + + PERMIT + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/12-permissionroles-bigbird-R.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/12-permissionroles-bigbird-R.xml new file mode 100755 index 000000000..dde7075cc --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/12-permissionroles-bigbird-R.xml @@ -0,0 +1,13 @@ + + + + ${permBigbird_R.CSID} + dimensions + + + ${roleTestCM.CSID} + ROLE_TEST_CM + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/13-permissionroles-bigbird.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/13-permissionroles-bigbird.xml new file mode 100755 index 000000000..dde7075cc --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/13-permissionroles-bigbird.xml @@ -0,0 +1,13 @@ + + + + ${permBigbird_R.CSID} + dimensions + + + ${roleTestCM.CSID} + ROLE_TEST_CM + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/2-elmo-permission.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/2-elmo-permission.xml new file mode 100755 index 000000000..8396775f1 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/2-elmo-permission.xml @@ -0,0 +1,9 @@ + + + dimensions + + READ + + PERMIT + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/3-role-test-cm.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/3-role-test-cm.xml new file mode 100755 index 000000000..d81506a7f --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/3-role-test-cm.xml @@ -0,0 +1,6 @@ + + + ROLE_TEST_CM + role for ROLE_TEST_CM + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/4-role-intern.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/4-role-intern.xml new file mode 100755 index 000000000..b0fdce4b8 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/4-role-intern.xml @@ -0,0 +1,5 @@ + + + ROLE_TEST_INTERN + role for ROLE_TEST_INTERN + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/5-account-bigbird.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/5-account-bigbird.xml new file mode 100755 index 000000000..327ff7f1f --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/5-account-bigbird.xml @@ -0,0 +1,14 @@ + + + bigbird2010 + bigbird2010 + bigbird@cspace.org + 1234567890 + bigbird2010 + YmlnYmlyZDIwMTA= + + 1 + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/6-account-elmo.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/6-account-elmo.xml new file mode 100755 index 000000000..6ffe44bef --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/6-account-elmo.xml @@ -0,0 +1,14 @@ + + + elmo2010 + elmo2010 + elmo@cspace.org + 1234567890 + elmo2010 + ZWxtbzIwMTA= + + 1 + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/7-accountroles-bigbird.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/7-accountroles-bigbird.xml new file mode 100755 index 000000000..585db05b5 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/7-accountroles-bigbird.xml @@ -0,0 +1,15 @@ + + + ROLE + + ${accountBigbird.CSID} + bigbird2010 + bigbird2010 + + + ${roleTestCM.CSID} + ROLE_TEST_CM + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/8-account-roles-elmo.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/8-account-roles-elmo.xml new file mode 100755 index 000000000..1e34d9f5d --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/8-account-roles-elmo.xml @@ -0,0 +1,15 @@ + + + ROLE + + ${permElmo.CSID} + elmo2010 + elmo2010 + + + ${roleIntern.CSID} + ROLE_TEST_INTERN + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/9-permissionroles-bigbird.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/9-permissionroles-bigbird.xml new file mode 100755 index 000000000..9e05c2fdd --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/9-permissionroles-bigbird.xml @@ -0,0 +1,13 @@ + + + + ${permBigbird.CSID} + dimensions + + + ${roleTestCM.CSID} + ROLE_TEST_CM + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/Base64-authentication-notes.txt b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/Base64-authentication-notes.txt new file mode 100755 index 000000000..8a31d0df0 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/Base64-authentication-notes.txt @@ -0,0 +1,44 @@ + bigbird2010 + bsh % unp = "bigbird2010:bigbird2010"; + + bsh % String encoding = new sun.misc.BASE64Encoder().encode (unp.getBytes()); + bsh % encoding = new sun.misc.BASE64Encoder().encode (unp.getBytes()); + + + bsh % unp = "bigbird2010:bigbird2010"; + + bsh % encoding = new sun.misc.BASE64Encoder().encode (unp.getBytes()); + + + bsh % String decode(String s){return new String(Base64.decode(s.getBytes()));} + + bsh % decode("dGVzdC1wYWhtYTp0ZXN0"); + test-pahma:test + //used for DELETE /cspace-services/accounts/9230dc97-0888-4252-8c89-795c92305ca0 HTTP/1.1 + + //used for creating accounts, roles, etc: + bsh % decode("dGVzdDp0ZXN0"); + test:test + + //used for dimension service tests: + bsh % decode("dXNlcjFAbXVzZXVtMS5vcmc6dXNlcjFAbXVzZXVtMS5vcmc="); + user1@museum1.org:user1@museum1.org + + dGVzdDpudWxs + bsh % decode("dGVzdDpudWxs"); + test:null (no password) + ==> HTTP/1.1 401 Password Incorrect/Password Required + + bsh % decode("dXNlcjJAbXVzZXVtMi5vcmc6dXNlcjJAbXVzZXVtMi5vcmc="); + user2@museum2.org:user2@museum2.org + DELETE OK on DELETE /cspace-services/dimensions/7922ea12-401d-4a7b-9f1a HTTP/1.1 + + dGVzdDpiYXI= + test:bar + //used for incorrect password. + Some more forbidden auths: + bsh % decode("YmFieWJvcDpiYWJ5Ym9wMDk="); + babybop:babybop09 + bsh % decode("YmFybmV5OmJhcm5leTA4"); + barney:barney08 + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-config.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-config.xml new file mode 100755 index 000000000..b1593c58e --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-config.xml @@ -0,0 +1,255 @@ + + + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/repfield_whitesp1.xml + + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/repfield_whitesp2.xml + + + + + + + POST + /cspace-services/collectionobjects/ + + + + collectionobject/nh-collectionobject.xml + + + + collectionobject/nh-part.xml + + + + + GET + /cspace-services/collectionobjects/ + nh + + + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/repfield_whitesp1.xml + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/repfield_whitesp2.xml + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/repfield_whitesp3.xml + + + + DELETE + /cspace-services/collectionobjects/ + 1001 + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/repfield_whitesp4.xml + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/cspace-2242-first-value-instance-blank.xml + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/cspace-2242-first-value-instance-nonblank.xml + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/repfield_null1.xml + + + + GET + /cspace-services/collectionobjects/?sortBy=&pgNum=0&pgSz=8 + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/testCambridge.xml + + + + GET + /cspace-services/collectionobjects/ + cambridge-1 + + + PUT + /cspace-services/collectionobjects/ + + + collectionobject/testCambridge-update.xml + + cambridge-1 + + + + + + + POST + /cspace-services/collectionobjects/ + + + collectionobject/testCambridge.xml + + + + GET + /cspace-services/collectionobjects/ + cambridge-2 + + + PUT + /cspace-services/collectionobjects/ + + + collectionobject/testCambridge-update.xml + + cambridge-2 + + + + + + + POST + /cspace-services/personauthorities/ + + + authrefs/newPersonAuthority.xml + + + + GET + /cspace-services/personauthorities/ + newPersonAuthority + + + POST + /cspace-services/personauthorities/ + + + authrefs/newPerson.xml + + newPersonAuthority + + + + LIST + /cspace-services/personauthorities/ + newPersonAuthority + + + + + + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master-self-test.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master-self-test.xml new file mode 100755 index 000000000..1fae5a1ed --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master-self-test.xml @@ -0,0 +1,16 @@ + + + http://localhost:8180 + + + + + + dGVzdDp0ZXN0 + + + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml new file mode 100755 index 000000000..30132e16c --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml @@ -0,0 +1,27 @@ + + + http://localhost:8180 + + + + + + dGVzdDp0ZXN0 + + + + + + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-self-test.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-self-test.xml new file mode 100755 index 000000000..209013325 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-self-test.xml @@ -0,0 +1,37 @@ + + + + + POST + /cspace-services/orgauthorities/ + + + organization/orgauthorities_common.xml + + + + POST + /cspace-services/orgauthorities/${OrgAuth1.CSID}/items/ + + + organization/organizations_common.xml + + + + GET + /cspace-services/orgauthorities/${OrgAuth1.CSID}/items/${Org1.CSID} + + + GET + /cspace-services/orgauthorities/${OrgAuth1.CSID} + + + LIST + /cspace-services/orgauthorities/${OrgAuth1.CSID} + + + LIST + /cspace-services/orgauthorities/${OrgAuth1.CSID}/items/ + + + -- 2.47.3