Navigation Menu

Skip to content

Commit

Permalink
Correcting deprecated JUnit imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ajs6f committed Jan 22, 2013
1 parent d44aa6d commit 6b9e23d
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 90 deletions.
@@ -1,5 +1,7 @@
package org.fcrepo.ffmodeshapeprototype;

import static org.junit.Assert.assertEquals;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.DeleteMethod;
import org.apache.commons.httpclient.methods.GetMethod;
Expand All @@ -10,8 +12,6 @@
import org.junit.Before;
import org.junit.Test;

import static junit.framework.Assert.assertEquals;

public class FedoraDatastreamsTest {

private TJWSEmbeddedJaxrsServer server;
Expand Down
@@ -1,6 +1,6 @@
package org.fcrepo.ffmodeshapeprototype;

import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertEquals;

import javax.servlet.http.HttpServletResponse;

Expand Down
@@ -1,5 +1,7 @@
package org.fcrepo.ffmodeshapeprototype;

import static org.junit.Assert.assertEquals;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.DeleteMethod;
import org.apache.commons.httpclient.methods.GetMethod;
Expand All @@ -9,62 +11,63 @@
import org.junit.Before;
import org.junit.Test;

import static junit.framework.Assert.assertEquals;

/**
* Created with IntelliJ IDEA.
* User: cabeer
* Date: 1/17/13
* Time: 14:11
* To change this template use File | Settings | File Templates.
* Created with IntelliJ IDEA. User: cabeer Date: 1/17/13 Time: 14:11 To change
* this template use File | Settings | File Templates.
*/
public class FedoraObjectsTest {

private TJWSEmbeddedJaxrsServer server;
int SERVER_PORT = 9999;
private TJWSEmbeddedJaxrsServer server;
int SERVER_PORT = 9999;

@Before
public void start() {
@Before
public void start() {

server = new TJWSEmbeddedJaxrsServer();
server.setPort(SERVER_PORT);
server.getDeployment().getActualResourceClasses().add(FedoraObjects.class);
server.start();
}
server = new TJWSEmbeddedJaxrsServer();
server.setPort(SERVER_PORT);
server.getDeployment().getActualResourceClasses()
.add(FedoraObjects.class);
server.start();
}

@After
public void stop() {
server.stop();
}
@After
public void stop() {
server.stop();
}

@Test
public void testIngest() throws Exception {
HttpClient client = new HttpClient();
PostMethod method = new PostMethod("http://localhost:" + SERVER_PORT + "/objects/asdf");
int status = client.executeMethod(method);
assertEquals(201, status);
}
@Test
public void testIngest() throws Exception {
HttpClient client = new HttpClient();
PostMethod method = new PostMethod("http://localhost:" + SERVER_PORT
+ "/objects/asdf");
int status = client.executeMethod(method);
assertEquals(201, status);
}

@Test
public void testGetObjectInXML() throws Exception {
HttpClient client = new HttpClient();
PostMethod pmethod = new PostMethod("http://localhost:" + SERVER_PORT + "/objects/fdsa");
client.executeMethod(pmethod);
@Test
public void testGetObjectInXML() throws Exception {
HttpClient client = new HttpClient();
PostMethod pmethod = new PostMethod("http://localhost:" + SERVER_PORT
+ "/objects/fdsa");
client.executeMethod(pmethod);

GetMethod method = new GetMethod("http://localhost:" + SERVER_PORT + "/objects/fdsa");
int status = client.executeMethod(method);
assertEquals(200, status);
}
GetMethod method = new GetMethod("http://localhost:" + SERVER_PORT
+ "/objects/fdsa");
int status = client.executeMethod(method);
assertEquals(200, status);
}

@Test
public void testDeleteObject() throws Exception {
HttpClient client = new HttpClient();
PostMethod pmethod = new PostMethod("http://localhost:" + SERVER_PORT + "/objects/asdf");
client.executeMethod(pmethod);
@Test
public void testDeleteObject() throws Exception {
HttpClient client = new HttpClient();
PostMethod pmethod = new PostMethod("http://localhost:" + SERVER_PORT
+ "/objects/asdf");
client.executeMethod(pmethod);

DeleteMethod method = new DeleteMethod("http://localhost:" + SERVER_PORT + "/objects/asdf");
int status = client.executeMethod(method);
assertEquals(204, status);
}
DeleteMethod method = new DeleteMethod("http://localhost:"
+ SERVER_PORT + "/objects/asdf");
int status = client.executeMethod(method);
assertEquals(204, status);
}

}
@@ -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);
}
}

0 comments on commit 6b9e23d

Please sign in to comment.