Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
97 additions
and
90 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
2 changes: 1 addition & 1 deletion
2
src/test/java/org/fcrepo/ffmodeshapeprototype/FedoraIdentifiersTest.java
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
88 changes: 46 additions & 42 deletions
88
src/test/java/org/fcrepo/ffmodeshapeprototype/FedoraRepositoryTest.java
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 |
---|---|---|
@@ -1,54 +1,58 @@ | ||
package org.fcrepo.ffmodeshapeprototype; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.apache.commons.httpclient.HttpClient; | ||
import org.apache.commons.httpclient.methods.GetMethod; | ||
import org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer; | ||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import static junit.framework.Assert.assertEquals; | ||
|
||
public class FedoraRepositoryTest { | ||
|
||
private TJWSEmbeddedJaxrsServer server; | ||
int SERVER_PORT = 9999; | ||
|
||
@Before | ||
public void start() { | ||
|
||
server = new TJWSEmbeddedJaxrsServer(); | ||
server.setPort(SERVER_PORT); | ||
server.getDeployment().getActualResourceClasses().add(FedoraRepository.class); | ||
server.start(); | ||
} | ||
|
||
@After | ||
public void stop() { | ||
server.stop(); | ||
} | ||
|
||
@Test | ||
public void testDescribeModeshape() throws Exception { | ||
HttpClient client = new HttpClient(); | ||
GetMethod method = new GetMethod("http://localhost:" + SERVER_PORT + "/describe/modeshape"); | ||
int status = client.executeMethod(method); | ||
assertEquals(200, status); | ||
} | ||
|
||
@Test | ||
public void testDescribe() throws Exception { | ||
HttpClient client = new HttpClient(); | ||
GetMethod method = new GetMethod("http://localhost:" + SERVER_PORT + "/describe"); | ||
int status = client.executeMethod(method); | ||
assertEquals(200, status); | ||
} | ||
|
||
@Test | ||
public void testGetObjects() throws Exception { | ||
HttpClient client = new HttpClient(); | ||
GetMethod method = new GetMethod("http://localhost:" + SERVER_PORT + "/objects"); | ||
int status = client.executeMethod(method); | ||
assertEquals(200, status); | ||
} | ||
private TJWSEmbeddedJaxrsServer server; | ||
int SERVER_PORT = 9999; | ||
|
||
@Before | ||
public void start() { | ||
|
||
server = new TJWSEmbeddedJaxrsServer(); | ||
server.setPort(SERVER_PORT); | ||
server.getDeployment().getActualResourceClasses() | ||
.add(FedoraRepository.class); | ||
server.start(); | ||
} | ||
|
||
@After | ||
public void stop() { | ||
server.stop(); | ||
} | ||
|
||
@Test | ||
public void testDescribeModeshape() throws Exception { | ||
HttpClient client = new HttpClient(); | ||
GetMethod method = new GetMethod("http://localhost:" + SERVER_PORT | ||
+ "/describe/modeshape"); | ||
int status = client.executeMethod(method); | ||
assertEquals(200, status); | ||
} | ||
|
||
@Test | ||
public void testDescribe() throws Exception { | ||
HttpClient client = new HttpClient(); | ||
GetMethod method = new GetMethod("http://localhost:" + SERVER_PORT | ||
+ "/describe"); | ||
int status = client.executeMethod(method); | ||
assertEquals(200, status); | ||
} | ||
|
||
@Test | ||
public void testGetObjects() throws Exception { | ||
HttpClient client = new HttpClient(); | ||
GetMethod method = new GetMethod("http://localhost:" + SERVER_PORT | ||
+ "/objects"); | ||
int status = client.executeMethod(method); | ||
assertEquals(200, status); | ||
} | ||
} |