{"action":"created","issue":{"url":"https://api.github.com/repos/DSpace/DSpace/issues/820","labels_url":"https://api.github.com/repos/DSpace/DSpace/issues/820/labels{/name}","comments_url":"https://api.github.com/repos/DSpace/DSpace/issues/820/comments","events_url":"https://api.github.com/repos/DSpace/DSpace/issues/820/events","html_url":"https://github.com/DSpace/DSpace/pull/820","id":53811690,"number":820,"title":"DS-2040: Fix AIP restore so that it works with cross-mapped Items & add AIP Integration Tests","user":{"login":"tdonohue","id":483997,"avatar_url":"https://avatars.githubusercontent.com/u/483997?v=3","gravatar_id":"","url":"https://api.github.com/users/tdonohue","html_url":"https://github.com/tdonohue","followers_url":"https://api.github.com/users/tdonohue/followers","following_url":"https://api.github.com/users/tdonohue/following{/other_user}","gists_url":"https://api.github.com/users/tdonohue/gists{/gist_id}","starred_url":"https://api.github.com/users/tdonohue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdonohue/subscriptions","organizations_url":"https://api.github.com/users/tdonohue/orgs","repos_url":"https://api.github.com/users/tdonohue/repos","events_url":"https://api.github.com/users/tdonohue/events{/privacy}","received_events_url":"https://api.github.com/users/tdonohue/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-08T22:49:15Z","updated_at":"2015-01-09T18:39:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DSpace/DSpace/pulls/820","html_url":"https://github.com/DSpace/DSpace/pull/820","diff_url":"https://github.com/DSpace/DSpace/pull/820.diff","patch_url":"https://github.com/DSpace/DSpace/pull/820.patch"},"body":"https://jira.duraspace.org/browse/DS-2040\r\n\r\nThis PR fixes DS-2040, but also adds AIP Integration Testing (which was integral in actually discovering the underlying bug behind DS-2040). I've tried to keep individual changes as separate commits to make this easy to understand. But here's the overview of what all is in this PR:\r\n\r\n1. Adds a new `DSpaceAIPIntegrationTest` class which (during Unit Testing) automatically generates a test hierarchy of Communities, Collections and Items, and exports them to AIPs. It then performs a series of test restorations/replacements of test content based on those AIPs, and performs assertions against the final results to ensure restoration/replacement is working properly.\r\n2. Updates / refactors `AbstractPackageIngester` and `AbstractPackageDisseminator` to keep track of all packages processed (whenever their ingestAll() or disseminateAll() methods are called). This is imperative to fixing DS-2040, as the underlying issue is that Mapped Item packages were accidentally being processed *multiple* times.  See commit https://github.com/tdonohue/DSpace/commit/74241a4c9463998af6e6e9c8e59cc8cf761956c0\r\n3. Changes the default settings in `dspace.cfg` for AIP and METS ingester/disseminator plugins. By default, ALL plugin instances get cached in memory. But, in order to fix DS-2040 (as noted in bullet 2 above) for recursive imports/exports, we MUST have instance level global variables which keep track of which packages have already been processed. So, we CANNOT cache these plugin instances, as the global variables would never be reset properly. See commit https://github.com/tdonohue/DSpace/commit/a4d382d46b7a4548fbe25b60d2efeb1ba996b4a2\r\n4. All the above changes now have Integration Tests which verify that Community/Collection/Items can be restored/replaced properly using AIPs. This includes integration tests which verify that Mapped Items can be restored/replaced properly. Again, see `DSpaceAIPIntegrationTest`\r\n\r\nI'm confident this all works, as it all has tests built against the new code. However, I'd welcome more eyes & testers before we consider merging this for 5.0"},"comment":{"url":"https://api.github.com/repos/DSpace/DSpace/issues/comments/69378040","html_url":"https://github.com/DSpace/DSpace/pull/820#issuecomment-69378040","issue_url":"https://api.github.com/repos/DSpace/DSpace/issues/820","id":69378040,"user":{"login":"hardyoyo","id":611569,"avatar_url":"https://avatars.githubusercontent.com/u/611569?v=3","gravatar_id":"","url":"https://api.github.com/users/hardyoyo","html_url":"https://github.com/hardyoyo","followers_url":"https://api.github.com/users/hardyoyo/followers","following_url":"https://api.github.com/users/hardyoyo/following{/other_user}","gists_url":"https://api.github.com/users/hardyoyo/gists{/gist_id}","starred_url":"https://api.github.com/users/hardyoyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hardyoyo/subscriptions","organizations_url":"https://api.github.com/users/hardyoyo/orgs","repos_url":"https://api.github.com/users/hardyoyo/repos","events_url":"https://api.github.com/users/hardyoyo/events{/privacy}","received_events_url":"https://api.github.com/users/hardyoyo/received_events","type":"User","site_admin":false},"created_at":"2015-01-09T18:39:41Z","updated_at":"2015-01-09T18:39:41Z","body":"+1 tested, confirmed that an AIP of a cross-mapped item can now be restored. I used a replacement AIP for item 10673/7, I've uploaded the test AIP I used as an attachment to the DS-2040 ticket (see: https://jira.duraspace.org/secure/attachment/16985/10673-7.zip) if you would like to use it for testing, you should be able to do so on demo.dspace.org, or vagrant-dspace. "}}