Skip to content

Commit

Permalink
Modified the test scripts input data.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnalah committed Apr 9, 2015
1 parent d32b57f commit f004178
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void testSetupEdit() {

Response res =
given().contentType("application/json").cookie("JSESSIONID=" + jsessionId)
.parameter("sampleId", "69500928").expect()
.parameter("sampleId", "57442308").expect()
.body("type", hasItems("physico-chemical characterization",
"in vitro characterization",
"ex vivo"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;

import org.glassfish.jersey.jackson.JacksonFeature;
import org.junit.Test;

import com.jayway.restassured.response.Response;
Expand All @@ -36,7 +35,7 @@ public void testSetup() {

Response res =
given().contentType("application/json")
.parameter("sampleId", "20917510").expect()
.parameter("sampleId", "20917508").expect()
.body("chemicalAssociationTypes", hasItems("Association","attachment","encapsulation","entrapment","intercalation"))
.when().get("http://localhost:8080/caNanoLab/rest/chemicalAssociation/setup");

Expand All @@ -50,7 +49,7 @@ public void testEdit() {

Map<String, String> parameters = new HashMap<String, String>();
parameters.put("sampleId", "20917508");
parameters.put("dataId", "73793538");
parameters.put("dataId", "59670528");
Response res =
given().contentType("application/json").cookie("JSESSIONID=" + jsessionId)
.parameters(parameters).expect()
Expand Down Expand Up @@ -83,10 +82,10 @@ public void testGetComposingElementsByNanomaterialEntityId() {

String jsessionId = RestTestLoginUtil.loginTest();
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("id", "84377600");
parameters.put("id", "21867783");
ValidatableResponse res =
given().contentType("application/json").cookie("JSESSIONID=" + jsessionId)
.queryParam("id", "84377600")
.queryParam("id", "21867783")
.when().post("http://localhost:8080/caNanoLab/rest/chemicalAssociation/getComposingElementsByNanomaterialEntityId")
.then().body(containsString("RNA"));
RestTestLoginUtil.logoutTest();
Expand Down Expand Up @@ -123,7 +122,6 @@ public void testsaveFile() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -177,7 +175,6 @@ public void testRemoveFile() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -230,7 +227,6 @@ public void testSubmit() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -284,7 +280,6 @@ public void testDelete() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;

import org.glassfish.jersey.client.ClientConfig;
import org.junit.Before;
import org.junit.Test;

Expand All @@ -16,10 +15,7 @@ public class CompositionServicesTest {

@Before
public void setUp() throws Exception {
client = ClientBuilder.newClient(new ClientConfig()
//.register(MyClientResponseFilter.class)
//.register(new AnotherClientFilter())
);
client = ClientBuilder.newClient();
}
@Test
public void testSummaryView() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class CoreServicesTest {

String urlbase = "http://localhost:8080/caNanoLab/rest/";

Client client;
@Before
public void setUp() throws Exception {

Expand All @@ -34,10 +34,7 @@ public void tearDown() throws Exception {

@Test
public void testInitSetup() {
Client client = ClientBuilder.newClient(new ClientConfig()
//.register(MyClientResponseFilter.class)
//.register(new AnotherClientFilter())
);
client = ClientBuilder.newClient();

String jsonString = client.target(urlbase)
.register(CoreServices.class)
Expand All @@ -55,10 +52,7 @@ public void testInitSetup() {

@Test
public void testGetTabs() {
Client client = ClientBuilder.newClient(new ClientConfig()
//.register(MyClientResponseFilter.class)
//.register(new AnotherClientFilter())
);
client = ClientBuilder.newClient();

String jsonString = client.target(urlbase)
.register(CoreServices.class)
Expand All @@ -76,7 +70,7 @@ public void testGetFavorites(){
Response res =
given().contentType("application/json").cookie("JSESSIONID=" + jsessionId)
.expect()
.body("samples.dataName", equalToIgnoringCase("Sample 1"))
.body("samples.dataName", equalToIgnoringCase("test_HJ_11"))
.when().get("http://localhost:8080/caNanoLab/rest/core/getFavorites");

RestTestLoginUtil.logoutTest();
Expand All @@ -87,8 +81,8 @@ public void testAddFavorites(){
String jsessionId = RestTestLoginUtil.loginTest();
FavoriteBean form = new FavoriteBean();
form.setDataType("sample");
form.setDataId("57835520");
form.setDataName("TestSample_Harika");
form.setDataId("56229901");
form.setDataName("test_HJ_12");
Response res =
given() .contentType("application/json").cookie("JSESSIONID=" + jsessionId).body(form)
.expect().statusCode(200)
Expand All @@ -101,8 +95,8 @@ public void testDeleteFavorites(){
String jsessionId = RestTestLoginUtil.loginTest();
FavoriteBean form = new FavoriteBean();
form.setDataType("sample");
form.setDataId("94699520");
form.setDataName("Test_HJ_DEV_01");
form.setDataId("56229895");
form.setDataName("test_HJ-10");
form.setId(new Long(105283586));
Response res =
given() .contentType("application/json").cookie("JSESSIONID=" + jsessionId).body(form)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import javax.ws.rs.core.Response;

import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.jackson.JacksonFeature;
import org.junit.Before;
import org.junit.Test;

Expand All @@ -24,7 +23,7 @@ public class CurationServicesTest {

@Before
public void setUp() throws Exception {
client = ClientBuilder.newClient(new ClientConfig());
client = ClientBuilder.newClient();

}
@Test
Expand All @@ -50,7 +49,6 @@ public void testGenerateBatchDataAvailability() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;

import org.glassfish.jersey.jackson.JacksonFeature;
import org.junit.Test;

import com.jayway.restassured.response.Response;
Expand Down Expand Up @@ -73,7 +72,6 @@ public void testSaveFunction() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -110,7 +108,6 @@ public void testRemoveComposingElement() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -151,7 +148,6 @@ public void testsaveFile() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -195,7 +191,6 @@ public void testRemoveFile() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -245,7 +240,6 @@ public void testSubmit() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -295,7 +289,6 @@ public void testDelete() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import gov.nih.nci.cananolab.restful.view.edit.SimpleSubmitPublicationBean;

import org.apache.commons.collections.map.HashedMap;
import org.glassfish.jersey.jackson.JacksonFeature;
import org.junit.Test;

import com.jayway.restassured.response.Response;
Expand All @@ -35,7 +34,7 @@ public void testSetup() {
Response res =
given().contentType("application/json")
.parameter("sampleId", "20917510").expect()
.body("nanomaterialEntityTypes", hasItems("biopolymer","carbon","carbon black","carbon nanotube","dendrimer","emulsion","fullerene","liposome","metal oxide","metal particle","metalloid","nanohorn","nanolipogel","nanorod","nanoshell","polymer","quantum dot","silica"))
.body("nanomaterialEntityTypes", hasItems("biopolymer", "carbon", "carbon black", "carbon nanotube", "dendrimer", "emulsion", "fullerene", "liposome", "metal oxide", "metal particle", "metalloid", "nanohorn", "nanorod", "nanoshell", "polymer", "quantum dot", "silica"))
.when().get("http://localhost:8080/caNanoLab/rest/nanomaterialEntity/setup");

System.out.println(res.getBody().asString());
Expand Down Expand Up @@ -106,7 +105,6 @@ public void testSaveComposingElement() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -148,7 +146,6 @@ public void testRemoveComposingElement() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -190,7 +187,6 @@ public void testsaveFile() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -232,7 +228,6 @@ public void testRemoveFile() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -283,7 +278,6 @@ public void testSubmit() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -333,7 +327,6 @@ public void testDelete() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import javax.ws.rs.core.Response;

import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.jackson.JacksonFeature;
import org.junit.Before;
import org.junit.Test;

Expand All @@ -33,7 +32,7 @@ public class ProtocolServicesTest {

@Before
public void setUp() throws Exception {
client = ClientBuilder.newClient(new ClientConfig());
client = ClientBuilder.newClient();

}

Expand Down Expand Up @@ -63,7 +62,6 @@ public void testSearchProtocol() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -93,7 +91,7 @@ public void testdownload() {
String jsonString = client.target(urlbase)
.register(ProtocolServices.class)
.path("protocol/download")
.queryParam("fileId", "23178496")
.queryParam("fileId", "59768832")
.request("application/pdf")
.header("some-header", "true")
.get(String.class);
Expand All @@ -110,7 +108,6 @@ public void testSubmitProtocol() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -168,7 +165,6 @@ public void testSaveAccess() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -221,7 +217,6 @@ public void testDeleteAccess() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -262,7 +257,6 @@ public void testDeletePublication() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down Expand Up @@ -309,7 +303,6 @@ public void testSubmitForReview() {

final Client aClient = ClientBuilder.newBuilder()
.register(ObjectMapperProvider.class)
.register(JacksonFeature.class)
.build();

WebTarget webTarget = aClient.target("http://localhost:8080/caNanoLab/rest");
Expand Down
Loading

0 comments on commit f004178

Please sign in to comment.