Skip to content

Commit

Permalink
Re-enabling auto-versioning test with update to undo changes after th…
Browse files Browse the repository at this point in the history
…e test is done
  • Loading branch information
escowles committed Apr 10, 2014
1 parent 58865d9 commit f306d90
Showing 1 changed file with 16 additions and 8 deletions.
Expand Up @@ -29,7 +29,6 @@
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.BasicHttpEntity;
import org.apache.http.util.EntityUtils;
import org.junit.Ignore;
import org.junit.Test;

import javax.ws.rs.core.Response;
Expand Down Expand Up @@ -259,14 +258,20 @@ public void testAddMixinAutoVersioning() throws IOException {
}

@Test
@Ignore
public void testRepositoryWideAutoVersioning() throws IOException {
postNodeTypeCNDSnippet("[fedora:autoVersioned] mixin\n" +
" - fedoraconfig:versioningPolicy (STRING) = \"auto-version\" autocreated");
postNodeTypeCNDSnippet("[fedora:resource] > fedora:relations, mix:created, mix:lastModified, mix:lockable, mix:versionable, fedora:autoVersioned, dc:describable mixin\n" +
" - rdf:type (URI) multiple\n" +
" - * (undefined) multiple\n" +
" - * (undefined)");
final String autoVersionedType = "[fedora:autoVersioned] mixin\n" +
" - fedoraconfig:versioningPolicy (STRING) = \"auto-version\" autocreated";
final String autoVersionedResource = "[fedora:resource] > fedora:relations, mix:created, mix:lastModified, mix:lockable, mix:versionable, fedora:autoVersioned, dc:describable mixin\n" +
"- rdf:type (URI) multiple\n" +
"- * (undefined) multiple\n" +
"- * (undefined)";
final String defaultResource = "[fedora:resource] > fedora:relations, mix:created, mix:lastModified, mix:lockable, mix:referenceable, dc:describable mixin\n" +
"- rdf:type (URI) multiple\n" +
"- * (undefined) multiple\n" +
"- * (undefined)";

postNodeTypeCNDSnippet(autoVersionedType);
postNodeTypeCNDSnippet(autoVersionedResource);

final String objName = "testRepositoryWideAutoVersioning";
final String dsName = "datastream";
Expand All @@ -278,6 +283,9 @@ public void testRepositoryWideAutoVersioning() throws IOException {
initialVersion.contains(Node.ANY, createResource(serverAddress + objName).asNode(), VERSIONING_POLICY.asNode(), NodeFactory.createLiteral("auto-version")));

testDatastreamContentUpdatesCreateNewVersions(objName, dsName);

// undo auto-versioning
postNodeTypeCNDSnippet(defaultResource);
}

private void testDatastreamContentUpdatesCreateNewVersions(final String objName, final String dsName) throws IOException {
Expand Down

0 comments on commit f306d90

Please sign in to comment.