Skip to content

Commit

Permalink
Allow fedora:binary to receive all fedora:resource properties
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Oct 17, 2014
1 parent c515a0c commit 0f18e84
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
Expand Up @@ -27,6 +27,7 @@
import com.hp.hpl.jena.rdf.model.StmtIterator;
import com.hp.hpl.jena.sparql.core.Quad;
import com.hp.hpl.jena.update.GraphStore;
import com.hp.hpl.jena.vocabulary.DC_11;
import nu.validator.htmlparser.sax.HtmlParser;
import nu.validator.saxtree.TreeBuilder;
import org.apache.commons.io.IOUtils;
Expand Down Expand Up @@ -494,6 +495,30 @@ public void testPatchBinaryDescription() throws Exception {
.getStatusCode());
}

@Test
public void testPatchBinaryDescriptionWithBinaryProperties() throws Exception {
final String pid = getRandomUniquePid();


createDatastream(pid, "x", "some content");

final String location = serverAddress + pid + "/x/fcr:metadata";
final HttpPatch patch = new HttpPatch(location);
patch.addHeader("Content-Type", "application/sparql-update");
final BasicHttpEntity e = new BasicHttpEntity();
e.setContent(new ByteArrayInputStream(
("INSERT { <" + serverAddress + pid + "/x>" +
" <http://purl.org/dc/elements/1.1/identifier> \"this is an identifier\" } WHERE {}")
.getBytes()));
patch.setEntity(e);
final HttpResponse response = client.execute(patch);
assertEquals(NO_CONTENT.getStatusCode(), response.getStatusLine()
.getStatusCode());

final GraphStore graphStore = getGraphStore(new HttpGet(location));
assertTrue(graphStore.contains(ANY, createURI(serverAddress + pid + "/x"), DC_11.identifier.asNode(), createLiteral("this is an identifier")));
}

@Test
public void testPatchWithBlankNode() throws Exception {
final String pid = getRandomUniquePid();
Expand Down
19 changes: 0 additions & 19 deletions fcrepo-http-api/src/test/resources/test_repository.json
Expand Up @@ -15,25 +15,6 @@
"metadataCacheName" : "FedoraRepositoryMetaData"
}
},
"externalSources" : {
"fileSystem" : {
"classname" : "org.fcrepo.connector.file.FedoraFileSystemConnector",
"directoryPath" : "target/test-classes/test-objects",
"readonly" : false,
"extraPropertiesStorage": "json",
"cacheTtlSeconds" : 2,
"projections" : [ "default:/files => /" ]
},
"readonly" : {
"classname" : "org.fcrepo.connector.file.FedoraFileSystemConnector",
"directoryPath" : "target/test-classes/test-objects",
"propertiesDirectoryPath" : "target/test-classes/test-meta",
"readonly" : true,
"extraPropertiesStorage": "none",
"cacheTtlSeconds" : 2,
"projections" : [ "default:/readonlyfiles => /" ]
}
},
"security" : {
"anonymous" : {
"roles" : ["readonly","readwrite","admin"],
Expand Down
Expand Up @@ -118,7 +118,7 @@
/*
* Some content that can have a checksum
*/
[fedora:binary] > mix:created mixin
[fedora:binary] > fedora:resource mixin
- premis:hasOriginalName (STRING)
- premis:hasSize (LONG) COPY
- fedora:digest (URI) COPY
Expand Down

0 comments on commit 0f18e84

Please sign in to comment.