Commit bee7b31f authored by Stefan Funk's avatar Stefan Funk
Browse files

Merge branch 'release/3.6.0'

parents 34c6346a 1835ed2d
......@@ -7,7 +7,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.5.5</version>
<version>3.6.0</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>cli-tools</artifactId>
......
......@@ -7,7 +7,7 @@
<parent>
<artifactId>common</artifactId>
<groupId>info.textgrid.middleware</groupId>
<version>3.5.5</version>
<version>3.6.0</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>confclient</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.5.5</version>
<version>3.6.0</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>const</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.5.5</version>
<version>3.6.0</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>dariah-storage-client</artifactId>
......
......@@ -32,7 +32,7 @@ import javax.ws.rs.core.Response.Status;
import org.apache.commons.io.IOUtils;
/**
* @version 2021-03-17
* @version 2021-04-30
*/
public class DariahStorageClient implements Serializable {
......@@ -59,7 +59,6 @@ public class DariahStorageClient implements Serializable {
private static final String LOG = " ";
private static final String STORAGE_SAYS = "Storage says: ";
private static final String ERROR_READING = "Error reading file! " + STORAGE_SAYS;
private static final String ERROR_CREATING = "Error creating file! " + STORAGE_SAYS;
private static final String ERROR_UPDATING = "Error updating file! " + STORAGE_SAYS;
private static final String ERROR_DELETING = "Error deleting file! " + STORAGE_SAYS;
......@@ -197,9 +196,8 @@ public class DariahStorageClient implements Serializable {
* @param token
* @param logID
* @return
* @throws IOException
*/
public Response readResponse(String id, String token, String logID) throws IOException {
public Response readResponse(String id, String token, String logID) {
Response result = null;
......@@ -213,13 +211,6 @@ public class DariahStorageClient implements Serializable {
this.defaultLogger.log(Level.INFO, logID + id + LOG + result.getStatus());
if (result.getStatus() != Status.OK.getStatusCode()) {
String message = logID + id + LOG + ERROR_READING + result.getStatus() + " "
+ result.getStatusInfo().getReasonPhrase();
this.defaultLogger.log(Level.SEVERE, message);
throw new IOException(message);
}
return result;
}
......
......@@ -54,6 +54,8 @@ import info.textgrid.middleware.common.TextGridMimetypes;
**
* CHANGELOG
*
* 2020-04-30 - Funk - Adapt to non-exception readResponse storage client method.
*
* 2019-04-24 - Funk - More tests added for list resources methods.
*
* 2019-03-06 - Funk - Added online tests for new Storage API V2.0 methods.
......@@ -67,7 +69,7 @@ import info.textgrid.middleware.common.TextGridMimetypes;
* </p>
*
* @author Stefan E. Funk, SUB Göttingen
* @version 2021-03-16
* @version 2021-04-30
* @since 2018-04-23
*/
@Ignore
......@@ -354,20 +356,12 @@ public class TestDariahStorageClientONLINE {
System.out.print("\t#READ (" + id + ")" + ARR);
t = String.valueOf(System.currentTimeMillis());
try {
Response response = ownStorageClient.readResponse(id, token, logID + t);
Response response = ownStorageClient.readResponse(id, token, logID + t);
int statusCode = response.getStatus();
if (statusCode != Status.NOT_FOUND.getStatusCode()) {
assertTrue(false);
}
} catch (IOException e) {
System.out.println(e.getMessage() + ARR + OK);
return;
int statusCode = response.getStatus();
if (statusCode != Status.NOT_FOUND.getStatusCode()) {
assertTrue(false);
}
// No exception.
assertTrue(false);
}
/**
......@@ -544,27 +538,23 @@ public class TestDariahStorageClientONLINE {
// Test #READ (no token)
System.out.print("\t#READ NOTOK (" + id + ")" + ARR);
try {
Response response = ownStorageClient.readResponse(id, null, log);
System.out.println(
OK + ": " + response.getStatus() + " " + response.getStatusInfo().getReasonPhrase());
} catch (IOException e) {
System.out.println(ERROR + ": " + e.getMessage() + ARR + OK);
Response response = ownStorageClient.readResponse(id, null, log);
String responseString = response.getStatus() + " " + response.getStatusInfo().getReasonPhrase();
if (response.getStatus() == Status.OK.getStatusCode()) {
System.out.println(OK + ": " + responseString);
} else {
System.out.println(ERROR + ": " + responseString);
}
// Test #READ (invalid token)
System.out.print("\t#READ INVTOK (" + id + ")" + ARR);
try {
Response response = ownStorageClient.readResponse(id, invalidToken, log);
System.out.println(
OK + ": " + response.getStatus() + " " + response.getStatusInfo().getReasonPhrase());
} catch (IOException e) {
System.out.println(ERROR + ": " + e.getMessage() + ARR + OK);
response = ownStorageClient.readResponse(id, invalidToken, log);
responseString = response.getStatus() + " " + response.getStatusInfo().getReasonPhrase();
if (response.getStatus() == Status.OK.getStatusCode()) {
System.out.println(OK + ": " + responseString);
} else {
System.out.println(ERROR + ": " + responseString);
}
// TEST #PUBLISH
......@@ -605,30 +595,24 @@ public class TestDariahStorageClientONLINE {
// Test #READ (no token)
System.out.print("\t#READ NOTOK (" + id + ")" + ARR);
try {
Response response = ownStorageClient.readResponse(id, null, log);
System.out.println(
OK + ": " + response.getStatus() + " " + response.getStatusInfo().getReasonPhrase());
} catch (IOException e) {
System.out.println(ERROR + ": " + e.getMessage());
response = ownStorageClient.readResponse(id, null, log);
responseString = response.getStatus() + " " + response.getStatusInfo().getReasonPhrase();
if (response.getStatus() == Status.OK.getStatusCode()) {
System.out.println(OK + ": " + responseString);
} else {
System.out.println(ERROR + ": " + responseString);
assertTrue(false);
}
// Test #READ (invalid token)
System.out.print("\t#READ INVTOK (" + id + ")" + ARR);
try {
Response response = ownStorageClient.readResponse(id, invalidToken, log);
System.out.println(
OK + ": " + response.getStatus() + " " + response.getStatusInfo().getReasonPhrase());
} catch (IOException e) {
System.out.println(ERROR + ": " + e.getMessage());
response = ownStorageClient.readResponse(id, invalidToken, log);
responseString = response.getStatus() + " " + response.getStatusInfo().getReasonPhrase();
if (response.getStatus() == Status.OK.getStatusCode()) {
System.out.println(OK + ": " + responseString);
} else {
System.out.println(ERROR + ": " + responseString);
assertTrue(false);
}
......@@ -665,19 +649,19 @@ public class TestDariahStorageClientONLINE {
// Test #READ (again with no token)
System.out.print("\t#READ NOTOK (" + id + ")" + ARR);
try {
ownStorageClient.readResponse(id, null, log);
} catch (IOException e) {
System.out.println(OK + ": " + e.getMessage());
response = ownStorageClient.readResponse(id, null, log);
if (response.getStatus() != Status.OK.getStatusCode()) {
System.out.println(
OK + ": " + response.getStatus() + " " + response.getStatusInfo().getReasonPhrase());
}
// Test #READ (again with invalid token)
System.out.print("\t#READ INVTOK (" + id + ")" + ARR);
try {
ownStorageClient.readResponse(id, invalidToken, log);
} catch (IOException e) {
System.out.println(OK + ": " + e.getMessage());
response = ownStorageClient.readResponse(id, invalidToken, log);
if (response.getStatus() != Status.OK.getStatusCode()) {
System.out.println(
OK + ": " + response.getStatus() + " " + response.getStatusInfo().getReasonPhrase());
}
// TEST #CHECKACCESS/DELETE
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.5.5</version>
<version>3.6.0</version>
</parent>
<groupId>info.textgrid.utils</groupId>
<artifactId>esutils</artifactId>
......
......@@ -7,7 +7,7 @@
<parent>
<artifactId>common</artifactId>
<groupId>info.textgrid.middleware</groupId>
<version>3.5.5</version>
<version>3.6.0</version>
</parent>
<groupId>info.textgrid.utils</groupId>
<artifactId>httpclients</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.5.5</version>
<version>3.6.0</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>jpairtree</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.5.5</version>
<version>3.6.0</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>ltputils</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>common</artifactId>
<groupId>info.textgrid.middleware</groupId>
<version>3.5.5</version>
<version>3.6.0</version>
</parent>
<groupId>info.textgrid.namespaces</groupId>
<artifactId>metadata-core-jaxb</artifactId>
......
......@@ -6,12 +6,12 @@
<artifactId>common</artifactId>
<groupId>info.textgrid.middleware</groupId>
<name>DARIAHDE :: Common Tools and Packages</name>
<version>3.5.5</version>
<version>3.6.0</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<felix.version>2.3.4</felix.version>
<cxf.version>3.3.6</cxf.version>
<cxf.version>3.3.10</cxf.version>
<commons-io.version>2.6</commons-io.version>
<junit.version>4.12</junit.version>
<java-compiler.version>1.8</java-compiler.version>
......@@ -54,8 +54,8 @@
<modules>
<module>metadata-core-jaxb</module>
<module>httpclients</module>
<module>confclient</module>
<module>const</module>
<module>confclient</module>
<module>const</module>
<module>projectfile-jaxb</module>
<module>portalconfig-jaxb</module>
<module>esutils</module>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>common</artifactId>
<groupId>info.textgrid.middleware</groupId>
<version>3.5.5</version>
<version>3.6.0</version>
</parent>
<groupId>info.textgrid.namespaces</groupId>
<artifactId>portalconfig-jaxb</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>common</artifactId>
<groupId>info.textgrid.middleware</groupId>
<version>3.5.5</version>
<version>3.6.0</version>
</parent>
<groupId>info.textgrid.namespaces</groupId>
<artifactId>projectfile-jaxb</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.5.5</version>
<version>3.6.0</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>rdfutils</artifactId>
......
......@@ -7,7 +7,7 @@
<parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>common</artifactId>
<version>3.5.5</version>
<version>3.6.0</version>
</parent>
<groupId>info.textgrid.middleware.clients</groupId>
<artifactId>textgrid-clients</artifactId>
......
Supports Markdown
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