Skip to content

Commit

Permalink
HTTP API tests now use FedoraFileSystemConnector instead of Modeshape…
Browse files Browse the repository at this point in the history
…'s, removing HTTP API dependency from FedoraFileSsytemConnector to prevent circular dependency
  • Loading branch information
escowles committed Mar 19, 2014
1 parent d6acff5 commit 8dd4650
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
7 changes: 0 additions & 7 deletions fcrepo-connector-file/pom.xml
Expand Up @@ -21,13 +21,6 @@
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
</dependency>

<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-http-api</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-http-commons</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions fcrepo-http-api/pom.xml
Expand Up @@ -30,6 +30,12 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-connector-file</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-serialization</artifactId>
Expand Down
Expand Up @@ -372,7 +372,7 @@ public void verifyFullSetOfRdfTypes() throws Exception {
logger.debug("Entering verifyFullSetOfRdfTypes()...");
final String pid = "FedoraGraphWithRdfTypes";
createObject(pid);
addMixin( "FedoraGraphWithRdfTypes", "http://www.jcp.org/jcr/mix/1.0versionable");
addMixin( "FedoraGraphWithRdfTypes", MIX_NAMESPACE + "versionable" );

final HttpGet getObjMethod =
new HttpGet(serverAddress + pid);
Expand Down Expand Up @@ -1027,7 +1027,8 @@ public void testCopyToProjection() throws IOException {
// copy to federated filesystem
final HttpCopy request = new HttpCopy(serverAddress + "repoObject");
request.addHeader("Destination", serverAddress + "files/projCopy");
client.execute(request);
final HttpResponse copyResponse = client.execute(request);
assertEquals(CREATED.getStatusCode(), copyResponse.getStatusLine().getStatusCode());

// federated copy should now exist
final HttpGet copyGet = new HttpGet(serverAddress + "files/projCopy");
Expand Down
Expand Up @@ -49,6 +49,7 @@
import static org.fcrepo.kernel.RdfLexicon.HAS_PRIMARY_TYPE;
import static org.fcrepo.kernel.RdfLexicon.HAS_VERSION;
import static org.fcrepo.kernel.RdfLexicon.VERSIONING_POLICY;
import static org.fcrepo.kernel.RdfLexicon.MIX_NAMESPACE;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
Expand All @@ -61,7 +62,7 @@ public void testGetObjectVersionProfile() throws Exception {
final String pid = UUID.randomUUID().toString();

createObject(pid);
addMixin( pid, "http://www.jcp.org/jcr/mix/1.0versionable");
addMixin( pid, MIX_NAMESPACE + "versionable" );
final HttpGet getVersion =
new HttpGet(serverAddress + pid + "/fcr:versions");
logger.debug("Retrieved version profile:");
Expand All @@ -75,7 +76,7 @@ public void testGetObjectVersionProfile() throws Exception {
public void testAddAndRetrieveVersion() throws Exception {
final String pid = UUID.randomUUID().toString();
createObject(pid);
addMixin( pid, "http://www.jcp.org/jcr/mix/1.0versionable");
addMixin( pid, MIX_NAMESPACE + "versionable" );

logger.info("Setting a title");
patchLiteralProperty(serverAddress + pid, "http://purl.org/dc/elements/1.1/title", "First Title");
Expand Down Expand Up @@ -104,7 +105,7 @@ public void testAddAndRetrieveVersion() throws Exception {
public void testVersioningANodeWithAVersionableChild() throws Exception {
final String pid = UUID.randomUUID().toString();
createObject(pid);
addMixin( pid, "http://www.jcp.org/jcr/mix/1.0versionable");
addMixin( pid, MIX_NAMESPACE + "versionable" );

logger.info("Adding a child");
createDatastream(pid, "ds", "This DS will not be versioned");
Expand Down Expand Up @@ -135,7 +136,7 @@ public void testCreateUnlabeledVersion() throws Exception {
logger.info("Creating an object");
final String objId = UUID.randomUUID().toString();
createObject(objId);
addMixin( objId, "http://www.jcp.org/jcr/mix/1.0versionable");
addMixin( objId, MIX_NAMESPACE + "versionable" );

logger.info("Setting a title");
patchLiteralProperty(serverAddress + objId, "http://purl.org/dc/elements/1.1/title", "Example Title");
Expand All @@ -149,7 +150,7 @@ public void testCreateTwoVersionsWithSameLabel() throws Exception {
logger.info("creating an object");
final String objId = UUID.randomUUID().toString();
createObject(objId);
addMixin( objId, "http://www.jcp.org/jcr/mix/1.0versionable");
addMixin( objId, MIX_NAMESPACE + "versionable" );

logger.info("Setting a title");
patchLiteralProperty(serverAddress + objId, "http://purl.org/dc/elements/1.1/title", "First title");
Expand Down Expand Up @@ -179,9 +180,9 @@ public void testGetDatastreamVersionNotFound() throws Exception {
final String pid = randomUUID().toString();

createObject(pid);
addMixin( pid, "http://www.jcp.org/jcr/mix/1.0versionable");
addMixin( pid, MIX_NAMESPACE + "versionable" );
createDatastream(pid, "ds1", "foo");
addMixin( pid + "/ds1", "http://www.jcp.org/jcr/mix/1.0versionable");
addMixin( pid + "/ds1", MIX_NAMESPACE + "versionable" );

final HttpGet getVersion =
new HttpGet(serverAddress
Expand Down Expand Up @@ -212,7 +213,7 @@ public void isAutoVersionedContentStillAccessible() throws Exception {

createObject(objName);
createDatastream(objName, dsName, firstVersionText);
addMixin( objName + "/" + dsName, "http://www.jcp.org/jcr/mix/1.0versionable");
addMixin( objName + "/" + dsName, MIX_NAMESPACE + "versionable" );

setAutoVersioning(serverAddress + objName + "/" + dsName);

Expand Down
4 changes: 2 additions & 2 deletions fcrepo-http-api/src/test/resources/test_repository.json
Expand Up @@ -17,7 +17,7 @@
},
"externalSources" : {
"fileSystem" : {
"classname" : "org.modeshape.connector.filesystem.FileSystemConnector",
"classname" : "org.fcrepo.connector.file.FedoraFileSystemConnector",
"directoryPath" : "target/test-classes/test-objects",
"readonly" : false,
"extraPropertiesStorage": "json",
Expand All @@ -35,4 +35,4 @@
]
},
"node-types" : ["fedora-node-types.cnd"]
}
}
4 changes: 2 additions & 2 deletions fcrepo-http-api/src/test/resources/test_repository_fs.json
Expand Up @@ -17,7 +17,7 @@
},
"externalSources" : {
"fileSystem" : {
"classname" : "org.modeshape.connector.filesystem.FileSystemConnector",
"classname" : "org.fcrepo.connector.file.FedoraFileSystemConnector",
"directoryPath" : "target/test-classes/test-objects",
"readonly" : false,
"extraPropertiesStorage": "json",
Expand All @@ -35,4 +35,4 @@
]
},
"node-types" : ["fedora-node-types.cnd"]
}
}

0 comments on commit 8dd4650

Please sign in to comment.