Commit 661d57f7 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Added test module with jar generated from documentation

parent bf83e2b3
...@@ -9,4 +9,5 @@ ...@@ -9,4 +9,5 @@
/drip-component_example/target/ /drip-component_example/target/
/deleteme/target/ /deleteme/target/
/drip-api/nbproject/ /drip-api/nbproject/
/drip-tests/nbproject/ /drip-tests/nbproject/
\ No newline at end of file /drip-tests/target/
\ No newline at end of file
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
</parent> </parent>
<artifactId>drip-tests</artifactId> <artifactId>drip-tests</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
...@@ -36,8 +39,25 @@ ...@@ -36,8 +39,25 @@
<scope>test</scope> <scope>test</scope>
<type>jar</type> <type>jar</type>
</dependency> </dependency>
<dependency>
<groupId>nl.uva.sne.drip</groupId>
<artifactId>drip-api-json-client</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${basedir}/../docs/apidocs/drip-api-json-client.jar</systemPath>
</dependency>
</dependencies> </dependencies>
<build>
<plugins>
</plugins>
</build>
<properties> <properties>
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
......
...@@ -24,16 +24,14 @@ import org.junit.BeforeClass; ...@@ -24,16 +24,14 @@ import org.junit.BeforeClass;
import javax.ws.rs.client.Entity; import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation; import javax.ws.rs.client.Invocation;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import nl.uva.sne.drip.data.v1.external.CloudCredentials;
import org.junit.Test;
/** /**
* *
* @author S. Koulouzis. * @author S. Koulouzis.
*/ */
public class CloudCredentialsController { public class TestCloudCredentialsController {
public CloudCredentialsController() {
}
@BeforeClass @BeforeClass
public static void setUpClass() { public static void setUpClass() {
...@@ -51,14 +49,15 @@ public class CloudCredentialsController { ...@@ -51,14 +49,15 @@ public class CloudCredentialsController {
public void tearDown() { public void tearDown() {
} }
// TODO add test methods here. @Test
// The methods must be annotated with annotation @Test. For example: public void hello() {
// System.err.println("");
// @Test CloudCredentials cc = new CloudCredentials();
// public void hello() {} cc.setAccessKeyId("");
}
private void post(String lcmId, String metadataId, String storageId, int expected) {
private void post(String lcmId, String metadataId, String storageId, int expected) {
// String payload = "{\"local-storage-id\" : \"" + storageId + "\"}"; // String payload = "{\"local-storage-id\" : \"" + storageId + "\"}";
// Entity<String> entity = Entity.entity(payload, "application/json"); // Entity<String> entity = Entity.entity(payload, "application/json");
// Response resp = getWebTarget().path(TRIGGER_PATH).path(lcmId).path("metadata").path(metadataId) // Response resp = getWebTarget().path(TRIGGER_PATH).path(lcmId).path("metadata").path(metadataId)
...@@ -66,7 +65,6 @@ public class CloudCredentialsController { ...@@ -66,7 +65,6 @@ public class CloudCredentialsController {
// .header(BasicAuthenticationManager.BASIC_AUTHENTICATION_HEADER, basicAuthTokenAdmin) // .header(BasicAuthenticationManager.BASIC_AUTHENTICATION_HEADER, basicAuthTokenAdmin)
// .post(entity); // .post(entity);
// assertEquals(expected, resp.getStatus()); // assertEquals(expected, resp.getStatus());
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment