-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test for DISABLED digest type to FoxML digest Validation (#190)
* added test for DISABLED digest type * Adding Integration Test and a new exceptin for disabled digests * checkstyle fixes * changing index to match inline-it et al * seperating test index in case of clash * fixing issues with the disabled integration test * removing superflous log message as we throw an exception now * git wasn't adding an empty dir. used .gitkeep and now the test should parse tge datastream dir * .gitkeep broke the indexer. copying a datastream from another test * reverting to logging rather than throwing exception * improved DISABLED fixity Integration Test to use fcrepo-storage-ocfl session object * Switch from assembly to shade plugin to correct Jena re-packaging (#189) Resolves: https://fedora-repository.atlassian.net/browse/FCREPO-3836 * Alter test assertion to allow for ocfl 1.0 and 1.1 (#192) Resolves: https://fedora-repository.atlassian.net/browse/FCREPO-3863 * Bump woodstox-core from 6.2.3 to 6.4.0 (#191) Bumps [woodstox-core](https://github.com/FasterXML/woodstox) from 6.2.3 to 6.4.0. - [Release notes](https://github.com/FasterXML/woodstox/releases) - [Commits](FasterXML/woodstox@woodstox-core-6.2.3...woodstox-core-6.4.0) --- updated-dependencies: - dependency-name: com.fasterxml.woodstox:woodstox-core dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Increment version to 6.3.1-SNAPSHOT * fixing issues with the disabled integration test * removing superflous log message as we throw an exception now * git wasn't adding an empty dir. used .gitkeep and now the test should parse tge datastream dir * .gitkeep broke the indexer. copying a datastream from another test * reverting to logging rather than throwing exception * improved DISABLED fixity Integration Test to use fcrepo-storage-ocfl session object * fixed test to look for a DISABLED digest --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Dan Field <[email protected]> Co-authored-by: Dan Field <[email protected]> Co-authored-by: Jared Whiklo <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Bernstein <[email protected]>
- Loading branch information
1 parent
db57ddb
commit bad1e17
Showing
7 changed files
with
922 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/** | ||
* Copyright 2015 DuraSpace, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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.fcrepo.migration; | ||
|
||
import org.apache.commons.io.FileUtils; | ||
import org.junit.After; | ||
import org.junit.Test; | ||
import org.springframework.context.ConfigurableApplicationContext; | ||
import org.springframework.context.support.ClassPathXmlApplicationContext; | ||
import org.fcrepo.storage.ocfl.OcflObjectSessionFactory; | ||
|
||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
/** | ||
* @author Dan Field | ||
*/ | ||
public class DisabledDigestIT { | ||
|
||
private ConfigurableApplicationContext context; | ||
private Migrator migrator; | ||
private OcflObjectSessionFactory sessionFactory; | ||
|
||
@After | ||
public void tearDown() { | ||
if (context != null) { | ||
context.close(); | ||
} | ||
} | ||
|
||
private void setup(final String name) throws Exception { | ||
final var storage = Paths.get(String.format("target/test/ocfl/%s/storage", name)); | ||
final var staging = Paths.get(String.format("target/test/ocfl/%s/staging", name)); | ||
|
||
if (Files.exists(storage)) { | ||
FileUtils.forceDelete(storage.toFile()); | ||
} | ||
if (Files.exists(staging)) { | ||
FileUtils.forceDelete(staging.toFile()); | ||
} | ||
|
||
Files.createDirectories(storage); | ||
Files.createDirectories(staging); | ||
|
||
context = new ClassPathXmlApplicationContext(String.format("spring/%s-setup.xml", name)); | ||
migrator = (Migrator) context.getBean("migrator"); | ||
sessionFactory = (OcflObjectSessionFactory) context.getBean("ocflSessionFactory"); | ||
} | ||
|
||
@Test | ||
public void testMigrateObjectWithExternalDatastreamAndDisabledDigest() throws Exception { | ||
setup("inline-disabled-it"); | ||
migrator.run(); | ||
final var session = sessionFactory.newSession("info:fedora/llgc-id:1591190"); | ||
assertTrue(session.containsResource("info:fedora/llgc-id:1591190/POLICY")); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,4 +115,5 @@ public void failMigrationWhenInlineXmlDoesNotMatchDigest() throws Exception { | |
} | ||
} | ||
|
||
|
||
} |
30 changes: 30 additions & 0 deletions
30
...e/b4/info%3Afedora%2F1711.dl%3AAccess-policy-open-access-UW-Madison-all%2FXACML%2FXACML.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Policy | ||
xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://digital.library.wisc.edu/1711.dl/XMLSchema-XACML-3.0" | ||
PolicyId="hdl:1711.dl/Access-policy-open-access-UW-Madison-all" | ||
RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:deny-unless-permit" | ||
Version="1.0"> | ||
<Description> | ||
Open Access: any user can view, listen to, and/or download any representation of the object, | ||
as long as they're associated with or present at UW-Madison. | ||
</Description> | ||
<Target /> | ||
<Rule Effect="Permit" RuleId="permit-UWMadison"> | ||
<Target /> | ||
<Condition> | ||
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> | ||
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-one-and-only"> | ||
<AttributeDesignator | ||
AttributeId="http://digital.library.wisc.edu/1711.dl/vocabulary/access/population#" | ||
Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" | ||
DataType="http://www.w3.org/2001/XMLSchema#string" | ||
MustBePresent="true" /> | ||
</Apply> | ||
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">http://digital.library.wisc.edu/1711.dl/vocabulary/access/population#uwmadison</AttributeValue> | ||
</Apply> | ||
</Condition> | ||
</Rule> | ||
<Rule Effect="Deny" RuleId="deny-rule"></Rule> | ||
</Policy> |
Oops, something went wrong.