Skip to content

Commit

Permalink
Adding IT to demonstrate problem after uploading to projection
Browse files Browse the repository at this point in the history
  • Loading branch information
escowles committed Mar 17, 2014
1 parent 4e252e5 commit 39c5e16
Showing 1 changed file with 28 additions and 0 deletions.
Expand Up @@ -783,6 +783,34 @@ public void testGetProjectedNode() throws Exception {

}

/**
* I should be able to upload a file to a read/write federated filesystem.
**/
@Test
public void testUploadToProjection() throws IOException {
// upload file to federated filesystem using rest api
final String uploadLocation = serverAddress + "files/upload/ds1/fcr:content";
final String uploadContent = "abc123";
logger.debug("XXX: uploading to federated filesystem via rest api: " + uploadLocation);
final HttpPost post = postDSMethod("files/upload", "ds1", uploadContent);
final HttpResponse response = client.execute(post);
assertEquals(CREATED.getStatusCode(), response.getStatusLine().getStatusCode());
final String actualLocation = response.getFirstHeader("Location").getValue();
assertEquals("Wrong URI in Location header", uploadLocation, actualLocation);

// validate content
final HttpGet get = new HttpGet(uploadLocation);
final HttpResponse getResponse = client.execute(get);
final String actualContent = EntityUtils.toString( getResponse.getEntity() );
assertEquals(OK.getStatusCode(), getResponse.getStatusLine().getStatusCode());
assertEquals("Content doesn't match", actualContent, uploadContent);

// validate object profile
final HttpGet objGet = new HttpGet(serverAddress + "files/upload");
final HttpResponse objResponse = client.execute(objGet);
assertEquals(OK.getStatusCode(), objResponse.getStatusLine().getStatusCode());
}

@Test
public void testDescribeRdfCached() throws IOException {
final CloseableHttpClient cachingClient =
Expand Down

0 comments on commit 39c5e16

Please sign in to comment.