Skip to content

Commit

Permalink
and in the DublinCore test (which should be DRY-ed out..s
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Feb 9, 2013
1 parent feef2ae commit f6c0548
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions fcrepo-dc/src/test/java/org/fcrepo/generator/DublinCoreTest.java
Expand Up @@ -23,7 +23,7 @@
@ContextConfiguration({"/spring-test/generator.xml", "/spring-test/repo.xml"})
public class DublinCoreTest {

protected static final int SERVER_PORT = 8080;
protected static final int SERVER_PORT = Integer.parseInt(System.getProperty("test.port", "8080"));

protected static final String HOSTNAME = "localhost";

Expand All @@ -42,11 +42,11 @@ public static void setLogger() {
@Test
public void testJcrPropertiesBasedOaiDc() throws Exception {
PostMethod createObjMethod =
new PostMethod(serverAddress + "objects/fdsa");
new PostMethod(serverAddress + "rest/objects/fdsa");
client.executeMethod(createObjMethod);

GetMethod getWorstCaseOaiMethod =
new GetMethod(serverAddress + "objects/fdsa/oai_dc");
new GetMethod(serverAddress + "rest/objects/fdsa/oai_dc");
getWorstCaseOaiMethod.setRequestHeader("Accept", TEXT_XML);
int status = client.executeMethod(getWorstCaseOaiMethod);
assertEquals(200, status);
Expand All @@ -62,19 +62,19 @@ public void testJcrPropertiesBasedOaiDc() throws Exception {
@Test
public void testWellKnownPathOaiDc() throws Exception {
PostMethod createObjMethod =
new PostMethod(serverAddress + "objects/lkjh");
new PostMethod(serverAddress + "rest/objects/lkjh");
client.executeMethod(createObjMethod);

PostMethod createDSMethod =
new PostMethod(serverAddress + "objects/lkjh/datastreams/DC");
new PostMethod(serverAddress + "rest/objects/lkjh/datastreams/DC");

createDSMethod.setRequestEntity(new StringRequestEntity(
"marbles for everyone", null, null));

client.executeMethod(createDSMethod);

GetMethod getWorstCaseOaiMethod =
new GetMethod(serverAddress + "objects/lkjh/oai_dc");
new GetMethod(serverAddress + "rest/objects/lkjh/oai_dc");
getWorstCaseOaiMethod.setRequestHeader("Accept", TEXT_XML);
int status = client.executeMethod(getWorstCaseOaiMethod);
assertEquals(200, status);
Expand Down
6 changes: 4 additions & 2 deletions fcrepo-dc/src/test/resources/spring-test/generator.xml
Expand Up @@ -12,9 +12,11 @@

<import resource="classpath:META-INF/cxf/cxf.xml"/>

<context:annotation-config/>
<context:property-placeholder/>

<jaxrs:server address="http://localhost:8080">
<context:annotation-config/>

<jaxrs:server address="http://localhost:${test.port:8080}/rest">
<jaxrs:serviceBeans>
<bean class="org.fcrepo.generator.DublinCore"/>
<bean class="org.fcrepo.api.legacy.FedoraObjects"/>
Expand Down

0 comments on commit f6c0548

Please sign in to comment.