Jersey 2: Migrate exceptions
ProcessingException replaces ClientHandlerException.
WebApplicationException replaces UniformInterfaceException; and
WebApplicationException is only thrown when the response type *is not Response*
and the response status code is not in the 2xx range.
References:
https://jakartaee.github.io/rest/apidocs/2.1.6/javax/ws/rs/client/SyncInvoker.html#method(java.lang.String)
https://jakartaee.github.io/rest/apidocs/2.1.6/javax/ws/rs/client/SyncInvoker.html#method(java.lang.String,java.lang.Class)
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/ClientsHandler.java b/core/src/main/java/de/ids_mannheim/korap/web/ClientsHandler.java
index 8bf4d7f..4ae0a53 100644
--- a/core/src/main/java/de/ids_mannheim/korap/web/ClientsHandler.java
+++ b/core/src/main/java/de/ids_mannheim/korap/web/ClientsHandler.java
@@ -1,9 +1,9 @@
package de.ids_mannheim.korap.web;
-import com.sun.jersey.api.client.UniformInterfaceException;
import de.ids_mannheim.korap.exceptions.KustvaktException;
import de.ids_mannheim.korap.exceptions.StatusCodes;
+import javax.ws.rs.WebApplicationException;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
@@ -33,7 +33,7 @@
try {
return service.path(path).queryParam(key, value).request().get(String.class);
}
- catch (UniformInterfaceException e) {
+ catch (WebApplicationException e) {
throw new KustvaktException(StatusCodes.REQUEST_INVALID);
}
}
@@ -51,7 +51,7 @@
}
return resource.request().get(String.class);
}
- catch (UniformInterfaceException e) {
+ catch (WebApplicationException e) {
throw new KustvaktException(StatusCodes.REQUEST_INVALID);
}
}
diff --git a/full/src/test/java/de/ids_mannheim/korap/authentication/LdapOAuth2Test.java b/full/src/test/java/de/ids_mannheim/korap/authentication/LdapOAuth2Test.java
index ea19da9..638e8b9 100644
--- a/full/src/test/java/de/ids_mannheim/korap/authentication/LdapOAuth2Test.java
+++ b/full/src/test/java/de/ids_mannheim/korap/authentication/LdapOAuth2Test.java
@@ -20,8 +20,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.HttpHeaders;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.client.Entity;
import com.unboundid.ldap.sdk.LDAPException;
@@ -120,7 +119,7 @@
}
private void testRegisterPublicClient (String accessToken)
- throws ClientHandlerException, UniformInterfaceException,
+ throws ProcessingException,
KustvaktException {
OAuth2ClientJson json = new OAuth2ClientJson();
json.setName("LDAP test client");
@@ -144,7 +143,7 @@
}
private JsonNode testRegisterConfidentialClient (String accessToken)
- throws ClientHandlerException, UniformInterfaceException,
+ throws ProcessingException,
KustvaktException {
OAuth2ClientJson json = new OAuth2ClientJson();
json.setName("LDAP test client");
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/AvailabilityTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/AvailabilityTest.java
index a6b6e42..e2605ab 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/AvailabilityTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/AvailabilityTest.java
@@ -8,8 +8,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.HttpHeaders;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
@@ -147,7 +146,7 @@
private Response searchQueryWithIP (String collectionQuery, String ip)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
return target().path(API_VERSION).path("search").queryParam("q", "[orth=das]")
.queryParam("ql", "poliqarp").queryParam("cq", collectionQuery)
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/MultipleCorpusQueryTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/MultipleCorpusQueryTest.java
index 23fd917..911e716 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/MultipleCorpusQueryTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/MultipleCorpusQueryTest.java
@@ -6,8 +6,7 @@
import org.junit.Test;
import com.fasterxml.jackson.databind.JsonNode;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
@@ -44,7 +43,7 @@
@Test
public void testStatisticsWithMultipleCq ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION)
.path("statistics").queryParam("cq", "textType=Abhandlung")
@@ -65,7 +64,7 @@
@Test
public void testStatisticsWithMultipleCorpusQuery ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response =
target().path(API_VERSION).path("statistics")
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java
index 3464dfd..db29dec 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java
@@ -12,8 +12,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.HttpHeaders;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response.Status;
@@ -46,7 +45,7 @@
private Response updateClientPrivilege (String username,
Form form)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("oauth2")
.path("admin").path("client").path("privilege")
@@ -61,7 +60,7 @@
}
private void updateClientPriviledge (String clientId, boolean isSuper)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
form.param("client_id", clientId);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ClientControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ClientControllerTest.java
index f158fb6..a0655c6 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ClientControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ClientControllerTest.java
@@ -22,8 +22,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.HttpHeaders;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.client.Entity;
@@ -132,7 +131,7 @@
@Test
public void testRegisterClientNameTooShort ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
OAuth2ClientJson clientJson =
createOAuth2ClientJson("R", OAuth2ClientType.PUBLIC, null);
@@ -147,8 +146,8 @@
}
@Test
- public void testRegisterClientEmptyName () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testRegisterClientEmptyName ()
+ throws ProcessingException, KustvaktException {
OAuth2ClientJson clientJson =
createOAuth2ClientJson("", OAuth2ClientType.PUBLIC, null);
@@ -163,7 +162,7 @@
@Test
public void testRegisterClientMissingName ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
OAuth2ClientJson clientJson =
createOAuth2ClientJson(null, OAuth2ClientType.PUBLIC, null);
@@ -179,7 +178,7 @@
@Test
public void testRegisterClientMissingDescription ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
OAuth2ClientJson clientJson = createOAuth2ClientJson("R client",
OAuth2ClientType.PUBLIC, null);
@@ -195,7 +194,7 @@
@Test
public void testRegisterClientMissingType ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
OAuth2ClientJson clientJson =
createOAuth2ClientJson("R client", null, null);
@@ -211,7 +210,7 @@
@Test
public void testRegisterClientInvalidRedirectURI ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
// invalid hostname
String redirectUri = "https://test.public.client/redirect";
@@ -240,7 +239,7 @@
@Test
public void testRegisterPublicClientWithRefreshTokenExpiry ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
OAuth2ClientJson clientJson =
createOAuth2ClientJson("OAuth2PublicClient",
@@ -254,7 +253,7 @@
@Test
public void testRegisterConfidentialClientWithRefreshTokenExpiry ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
int expiry = 31535000;
OAuth2ClientJson clientJson =
@@ -272,7 +271,7 @@
@Test
public void testRegisterConfidentialClientWithInvalidRefreshTokenExpiry ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
OAuth2ClientJson clientJson = createOAuth2ClientJson(
"OAuth2 Confidential Client", OAuth2ClientType.CONFIDENTIAL,
@@ -289,7 +288,7 @@
@Test
public void testRegisterClientInvalidURL ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
// invalid hostname
String url = "https://test.public.client";
@@ -318,8 +317,8 @@
}
@Test
- public void testRegisterPublicClient () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testRegisterPublicClient ()
+ throws ProcessingException, KustvaktException {
String redirectUri = "https://public.client.com/redirect";
OAuth2ClientJson clientJson =
createOAuth2ClientJson("OAuth2PublicClient",
@@ -343,7 +342,7 @@
}
private void testRegisterClientUnauthorizedScope (String clientId)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
String userAuthHeader = HttpAuthorizationHandler
@@ -378,7 +377,7 @@
@Test
public void testRegisterClientUsingPlainJson ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException, IOException {
InputStream is = getClass().getClassLoader()
@@ -407,8 +406,8 @@
}
@Test
- public void testRegisterDesktopApp () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testRegisterDesktopApp ()
+ throws ProcessingException, KustvaktException {
OAuth2ClientJson clientJson = createOAuth2ClientJson(
"OAuth2DesktopClient", OAuth2ClientType.PUBLIC,
"This is a desktop test client.");
@@ -429,7 +428,7 @@
@Test
public void testRegisterMultipleDesktopApps ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
// First client
@@ -502,8 +501,8 @@
}
private void testDeregisterPublicClientMissingUserAuthentication (
- String clientId) throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ String clientId) throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("oauth2")
.path("client").path("deregister").path(clientId)
@@ -519,7 +518,7 @@
}
private void testDeregisterPublicClientMissingId ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("oauth2")
@@ -534,7 +533,7 @@
}
private void testDeregisterPublicClient (String clientId, String username)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("oauth2")
@@ -548,7 +547,7 @@
}
private void testResetPublicClientSecret (String clientId)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
form.param("client_id", clientId);
@@ -571,8 +570,8 @@
}
private String testResetConfidentialClientSecret (String clientId,
- String clientSecret) throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ String clientSecret) throws
+ ProcessingException, KustvaktException {
Form form = new Form();
form.param("client_id", clientId);
form.param("client_secret", clientSecret);
@@ -648,7 +647,7 @@
}
private void testListConfidentialClient (String username, String clientId)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
JsonNode node = listUserRegisteredClients(username);
assertEquals(1, node.size());
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2OpenIdControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2OpenIdControllerTest.java
index 01f70e1..b53b90d 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2OpenIdControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2OpenIdControllerTest.java
@@ -30,8 +30,7 @@
import com.nimbusds.jwt.JWTClaimsSet;
import com.nimbusds.jwt.SignedJWT;
import com.nimbusds.oauth2.sdk.GrantType;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.client.Entity;
@@ -78,7 +77,7 @@
@Test
public void testRequestAuthorizationCode ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2PluginTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2PluginTest.java
index c1cecb8..9d9a398 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2PluginTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2PluginTest.java
@@ -16,8 +16,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.HttpHeaders;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.client.Entity;
@@ -41,8 +40,8 @@
private InstalledPluginDao pluginDao;
@Test
- public void testRegisterPlugin () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testRegisterPlugin () throws
+ ProcessingException, KustvaktException {
JsonNode source = JsonUtils.readTree("{ \"plugin\" : \"source\"}");
int refreshTokenExpiry = TimeUtils.convertTimeToSeconds("90D");
@@ -101,8 +100,8 @@
}
private void testRetrievePluginInfo (String clientId,
- int refreshTokenExpiry) throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ int refreshTokenExpiry) throws
+ ProcessingException, KustvaktException {
JsonNode clientInfo = retrieveClientInfo(clientId, username);
assertEquals(clientId, clientInfo.at("/client_id").asText());
assertEquals("Plugin", clientInfo.at("/client_name").asText());
@@ -120,7 +119,7 @@
private void testListUserRegisteredPlugins (String username,
String clientId, String clientName, int refreshTokenExpiry)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
JsonNode node = listUserRegisteredClients(username);
@@ -138,7 +137,7 @@
@Test
public void testListPluginsUnauthorizedPublic ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
form.param("super_client_id", publicClientId);
@@ -147,7 +146,7 @@
@Test
public void testListPluginsUnauthorizedConfidential ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
form.param("super_client_id", confidentialClientId2);
@@ -157,7 +156,7 @@
@Test
public void testListPluginsMissingClientSecret ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
form.param("super_client_id", confidentialClientId);
@@ -181,7 +180,7 @@
private void testListPluginsClientUnauthorized (
Form form)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("plugins")
.request()
@@ -203,7 +202,7 @@
@Test
public void testListPluginsUserUnauthorized ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = getSuperClientForm();
@@ -223,8 +222,8 @@
}
@Test
- public void testListAllPlugins () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testListAllPlugins () throws
+ ProcessingException, KustvaktException {
JsonNode node = listPlugins(false);
assertEquals(2, node.size());
assertFalse(node.at("/0/client_id").isMissingNode());
@@ -240,7 +239,7 @@
}
private JsonNode listPlugins (boolean permitted_only)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = getSuperClientForm();
@@ -262,8 +261,8 @@
}
private void testInstallConfidentialPlugin (String superClientId,
- String clientId, String username) throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ String clientId, String username) throws
+ ProcessingException, KustvaktException {
Form form = getSuperClientForm();
form.param("client_id", clientId);
Response response = installPlugin(form);
@@ -284,8 +283,8 @@
}
@Test
- public void testInstallPublicPlugin () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testInstallPublicPlugin () throws
+ ProcessingException, KustvaktException {
Form form = getSuperClientForm();
form.param("client_id", publicClientId2);
Response response = installPlugin(form);
@@ -314,7 +313,7 @@
private void testInstallPluginRedundant (
Form form)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = installPlugin(form);
String entity = response.readEntity(String.class);
@@ -325,7 +324,7 @@
}
private void testInstallPluginNotPermitted (String clientId)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = getSuperClientForm();
form.param("client_id", clientId);
@@ -339,7 +338,7 @@
@Test
public void testInstallPluginMissingClientId ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = getSuperClientForm();
Response response = installPlugin(form);
@@ -352,7 +351,7 @@
@Test
public void testInstallPluginInvalidClientId ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = getSuperClientForm();
form.param("client_id", "unknown");
@@ -367,7 +366,7 @@
@Test
public void testInstallPluginMissingSuperClientSecret ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
form.param("super_client_id", superClientId);
@@ -385,7 +384,7 @@
@Test
public void testInstallPluginMissingSuperClientId ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
Response response = installPlugin(form);
@@ -401,7 +400,7 @@
@Test
public void testInstallPluginUnauthorizedClient ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
form.param("super_client_id", confidentialClientId);
@@ -416,7 +415,7 @@
}
private Response installPlugin (Form form)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
return target().path(API_VERSION).path("plugins").path("install")
.request()
@@ -428,7 +427,7 @@
}
private Response uninstallPlugin (String clientId, String username)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = getSuperClientForm();
@@ -457,7 +456,7 @@
@Test
public void testListUserInstalledPlugins ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException, IOException {
testInstallConfidentialPlugin(superClientId, confidentialClientId,
@@ -505,7 +504,7 @@
}
private void testUninstallNotInstalledPlugin ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response =
uninstallPlugin(confidentialClientId2, username);
@@ -518,7 +517,7 @@
private JsonNode retrieveUserInstalledPlugin (
Form form)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("plugins")
.path("installed")
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2TestBase.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2TestBase.java
index d1bd166..c12a921 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2TestBase.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2TestBase.java
@@ -21,8 +21,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.HttpHeaders;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
@@ -250,8 +249,8 @@
}
protected Response registerClient (String username,
- OAuth2ClientJson json) throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ OAuth2ClientJson json) throws
+ ProcessingException, KustvaktException {
return target().path(API_VERSION).path("oauth2").path("client")
.path("register")
.request()
@@ -278,7 +277,7 @@
}
protected void testConfidentialClientInfo (String clientId, String username)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
JsonNode clientInfo = retrieveClientInfo(clientId, username);
assertEquals(clientId, clientInfo.at("/client_id").asText());
@@ -300,8 +299,8 @@
}
protected void deregisterClient (String username,
- String clientId) throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ String clientId) throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("oauth2")
.path("client").path("deregister").path(clientId)
@@ -314,7 +313,7 @@
}
protected JsonNode retrieveClientInfo (String clientId, String username)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("oauth2")
.path("client").path(clientId)
@@ -405,7 +404,7 @@
}
protected JsonNode listUserRegisteredClients (String username)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = getSuperClientForm();
Response response = target().path(API_VERSION).path("oauth2")
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/QueryReferenceControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/QueryReferenceControllerTest.java
index 9b256c7..2e5ef40 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/QueryReferenceControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/QueryReferenceControllerTest.java
@@ -7,8 +7,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.HttpHeaders;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.client.Entity;
@@ -54,7 +53,7 @@
private void testUpdateQuery (String qName, String qCreator,
String username, ResourceType type)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
String json = "{\"query\": \"Sonne\""
+ ",\"queryLanguage\": \"poliqarp\"}";
@@ -360,15 +359,15 @@
}
@Test
- public void testListAvailableQueryForDory () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testListAvailableQueryForDory () throws
+ ProcessingException, KustvaktException {
JsonNode node = testListAvailableQuery("dory");
assertEquals(2, node.size());
}
@Test
public void testListAvailableQueryForPearl ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
JsonNode node = testListAvailableQuery("pearl");
@@ -384,7 +383,7 @@
}
private JsonNode testListAvailableQuery (String username)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("query")
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerAdminTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerAdminTest.java
index 617757c..07db0a2 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerAdminTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerAdminTest.java
@@ -8,8 +8,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.HttpHeaders;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.client.Entity;
@@ -32,7 +31,7 @@
private String testUser = "UserGroupControllerAdminTest";
private JsonNode listGroup (String username)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("group")
.request()
@@ -85,8 +84,8 @@
// same as list user-groups of the admin
@Test
- public void testListWithoutUsername () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testListWithoutUsername () throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("group")
.request()
.header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
@@ -100,8 +99,8 @@
}
@Test
- public void testListByStatusAll () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testListByStatusAll () throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("group")
.path("list").path("system-admin")
.request()
@@ -124,8 +123,8 @@
}
@Test
- public void testListByStatusHidden () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testListByStatusHidden () throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("group")
.path("list").path("system-admin")
.queryParam("status", "HIDDEN")
@@ -143,8 +142,8 @@
}
@Test
- public void testUserGroup () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testUserGroup () throws
+ ProcessingException, KustvaktException {
String groupName = "admin-test-group";
@@ -173,7 +172,7 @@
}
private void testMemberRole (String memberUsername, String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
// accept invitation
@@ -194,7 +193,7 @@
}
private void testAddMemberRoles (String groupName, String memberUsername)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
form.param("memberUsername", memberUsername);
@@ -227,7 +226,7 @@
}
private void testDeleteMemberRoles (String groupName, String memberUsername)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
form.param("memberUsername", memberUsername);
@@ -257,7 +256,7 @@
}
private JsonNode retrieveGroup (String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("group")
.path("@" + groupName)
@@ -275,7 +274,7 @@
}
private void testDeleteGroup (String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
// delete group
Response response = target().path(API_VERSION).path("group")
@@ -294,7 +293,7 @@
}
private void testDeleteMember (String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
// delete marlin from group
Response response = target().path(API_VERSION).path("group")
@@ -317,7 +316,7 @@
}
private void testInviteMember (String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
form.param("members", "marlin,nemo,darla");
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerTest.java
index b827408..f30baa9 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerTest.java
@@ -11,8 +11,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.HttpHeaders;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.client.Entity;
@@ -42,7 +41,7 @@
private String admin = "admin";
private JsonNode retrieveUserGroups (String username)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("group")
.request()
@@ -144,8 +143,8 @@
@Test
- public void testCreateGroupEmptyDescription () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testCreateGroupEmptyDescription () throws
+ ProcessingException, KustvaktException {
String groupName = "empty_group";
Response response = testCreateUserGroup(groupName,"");
assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
@@ -155,8 +154,8 @@
@Test
- public void testCreateGroupMissingDescription () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testCreateGroupMissingDescription () throws
+ ProcessingException, KustvaktException {
String groupName = "missing-desc-group";
Response response = testCreateGroupWithoutDescription(groupName);
@@ -165,7 +164,7 @@
}
private Response testCreateUserGroup (String groupName, String description)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
form.param("description", description);
@@ -182,7 +181,7 @@
}
private Response testCreateGroupWithoutDescription (String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("group")
.path("@"+groupName)
@@ -196,8 +195,8 @@
}
@Test
- public void testCreateGroupInvalidName () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testCreateGroupInvalidName () throws
+ ProcessingException, KustvaktException {
String groupName = "invalid-group-name$";
Response response = testCreateGroupWithoutDescription(groupName);
@@ -211,8 +210,8 @@
}
@Test
- public void testCreateGroupNameTooShort () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testCreateGroupNameTooShort () throws
+ ProcessingException, KustvaktException {
String groupName = "a";
Response response = testCreateGroupWithoutDescription(groupName);
@@ -226,8 +225,8 @@
}
@Test
- public void testUserGroup () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testUserGroup () throws
+ ProcessingException, KustvaktException {
String groupName = "new-user-group";
String description= "This is new-user-group.";
@@ -268,7 +267,7 @@
}
private void testUpdateUserGroup (String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
String description = "Description is updated.";
Response response = testCreateUserGroup(groupName, description);
@@ -280,7 +279,7 @@
}
private void testDeleteMember (String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
// delete darla from group
Response response = target().path(API_VERSION).path("group")
@@ -305,7 +304,7 @@
}
private void testDeleteMemberUnauthorized (String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
// nemo is a group member
Response response = target().path(API_VERSION).path("group")
@@ -327,8 +326,8 @@
}
// EM: same as cancel invitation
- private void testDeletePendingMember () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ private void testDeletePendingMember () throws
+ ProcessingException, KustvaktException {
// dory delete pearl
Response response = target().path(API_VERSION).path("group")
.path("@dory-group").path("~pearl")
@@ -346,8 +345,8 @@
}
@Test
- public void testDeleteDeletedMember () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testDeleteDeletedMember () throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("group")
.path("@dory-group").path("~pearl")
.request()
@@ -368,7 +367,7 @@
}
private void testDeleteGroup (String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
// delete group
Response response = target().path(API_VERSION).path("group")
@@ -407,8 +406,8 @@
}
@Test
- public void testDeleteGroupUnauthorized () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testDeleteGroupUnauthorized () throws
+ ProcessingException, KustvaktException {
// dory is a group admin in marlin-group
Response response = target().path(API_VERSION).path("group")
.path("@marlin-group")
@@ -429,8 +428,8 @@
}
@Test
- public void testDeleteDeletedGroup () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testDeleteDeletedGroup () throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("group")
.path("@deleted-group")
.request()
@@ -450,8 +449,8 @@
}
@Test
- public void testDeleteGroupOwner () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testDeleteGroupOwner () throws
+ ProcessingException, KustvaktException {
// delete marlin from marlin-group
// dory is a group admin in marlin-group
Response response = target().path(API_VERSION).path("group")
@@ -472,7 +471,7 @@
}
private void testInviteMember (String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
form.param("members", "darla");
@@ -507,8 +506,8 @@
assertEquals(0, node.at("/members/1/roles").size());
}
- private void testInviteDeletedMember () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ private void testInviteDeletedMember () throws
+ ProcessingException, KustvaktException {
Form form = new Form();
form.param("members", "marlin");
@@ -532,8 +531,8 @@
}
@Test
- public void testInviteDeletedMember2 () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testInviteDeletedMember2 () throws
+ ProcessingException, KustvaktException {
// pearl has status deleted in dory-group
Form form = new Form();
form.param("members", "pearl");
@@ -559,8 +558,8 @@
}
@Test
- public void testInvitePendingMember () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testInvitePendingMember () throws
+ ProcessingException, KustvaktException {
// marlin has status PENDING in dory-group
Form form = new Form();
form.param("members", "marlin");
@@ -587,8 +586,8 @@
}
@Test
- public void testInviteActiveMember () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testInviteActiveMember () throws
+ ProcessingException, KustvaktException {
// nemo has status active in dory-group
Form form = new Form();
form.param("members", "nemo");
@@ -617,7 +616,7 @@
@Test
public void testInviteMemberToDeletedGroup ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
form.param("members", "nemo");
@@ -753,7 +752,7 @@
}
private void testSubscribeToDeletedGroup (String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("group")
.path("@"+groupName).path("subscribe")
@@ -773,7 +772,7 @@
}
private void testUnsubscribeActiveMember (String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("group")
.path("@"+groupName).path("unsubscribe")
@@ -815,7 +814,7 @@
@Test
public void testUnsubscribeDeletedMember ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
// pearl unsubscribes from dory-group
Response response = target().path(API_VERSION).path("group")
@@ -839,7 +838,7 @@
@Test
public void testUnsubscribePendingMember ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
JsonNode node = retrieveUserGroups("marlin");
@@ -919,7 +918,7 @@
}
private void testUnsubscribeToDeletedGroup (String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("group")
@@ -940,8 +939,8 @@
}
@Test
- public void testAddSameMemberRole () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testAddSameMemberRole () throws
+ ProcessingException, KustvaktException {
Form form = new Form();
form.param("memberUsername", "dory");
form.param("roleId", "1");
@@ -961,8 +960,8 @@
}
@Test
- public void testDeleteAddMemberRole () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testDeleteAddMemberRole () throws
+ ProcessingException, KustvaktException {
Form form = new Form();
form.param("memberUsername", "dory");
form.param("roleId", "1");
@@ -984,8 +983,8 @@
}
@Test
- public void testEditMemberRoleEmpty () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testEditMemberRoleEmpty () throws
+ ProcessingException, KustvaktException {
Form form = new Form();
form.param("memberUsername", "dory");
@@ -1006,7 +1005,7 @@
}
private void testEditMemberRole ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Form form = new Form();
form.param("memberUsername", "dory");
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerAdminTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerAdminTest.java
index f15499a..24caf0b 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerAdminTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerAdminTest.java
@@ -9,8 +9,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.HttpHeaders;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.client.Entity;
@@ -31,8 +30,8 @@
private String username = "VirtualCorpusControllerAdminTest";
@Test
- public void testSearchPrivateVC () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testSearchPrivateVC () throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("~dory").path("dory-vc")
.request()
@@ -51,8 +50,8 @@
}
@Test
- public void testSearchProjectVC () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testSearchProjectVC () throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("~dory").path("group-vc")
@@ -72,8 +71,8 @@
}
@Test
- public void testListDoryVC () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testListDoryVC () throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.queryParam("username", "dory")
.request()
@@ -89,8 +88,8 @@
assertEquals(4, node.size());
}
- private JsonNode testListSystemVC () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ private JsonNode testListSystemVC () throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("list").path("system-admin").queryParam("type", "SYSTEM")
.queryParam("createdBy", "system")
@@ -129,7 +128,7 @@
}
private void testDeleteSystemVC (String vcCreator, String vcName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("~system").path(vcName)
@@ -146,8 +145,8 @@
}
@Test
- public void testPrivateVC () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testPrivateVC () throws
+ ProcessingException, KustvaktException {
String json = "{\"type\": \"PRIVATE\""
+ ",\"queryType\": \"VIRTUAL_CORPUS\""
+ ",\"corpusQuery\": \"corpusSigle=GOE\"}";
@@ -172,7 +171,7 @@
}
private JsonNode testListUserVC (String username)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("list").path("system-admin")
@@ -190,7 +189,7 @@
}
private void testEditPrivateVC (String vcCreator, String vcName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
String json = "{\"description\": \"edited vc\"}";
@@ -211,7 +210,7 @@
}
private void testDeletePrivateVC (String vcCreator, String vcName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("~"+vcCreator).path(vcName)
@@ -269,8 +268,8 @@
}
@Test
- public void testVCSharing () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testVCSharing () throws
+ ProcessingException, KustvaktException {
String vcCreator = "marlin";
String vcName = "marlin-vc";
String groupName = "marlin-group";
@@ -285,8 +284,8 @@
}
private void testCreateVCAccess (String vcCreator, String vcName,
- String groupName) throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ String groupName) throws
+ ProcessingException, KustvaktException {
Response response;
// share VC
response = target().path(API_VERSION).path("vc").path("~"+vcCreator)
@@ -302,7 +301,7 @@
}
private void testDeleteVCAccess (String accessId)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("vc")
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerTest.java
index ac0ed0a..dc92a5d 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerTest.java
@@ -17,8 +17,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.HttpHeaders;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Form;
import javax.ws.rs.core.Response.Status;
@@ -58,7 +57,7 @@
}
private JsonNode testListVC (String username)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.request()
@@ -74,7 +73,7 @@
}
private JsonNode testListOwnerVC (String username)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("~" + username)
@@ -118,8 +117,8 @@
}
@Test
- public void testRetrieveSystemVCInfo () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testRetrieveSystemVCInfo () throws
+ ProcessingException, KustvaktException {
JsonNode node = testSearchVC(testUser, "system", "system-vc");
assertEquals("system-vc", node.at("/name").asText());
@@ -131,8 +130,8 @@
}
@Test
- public void testRetrieveSystemVCGuest () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testRetrieveSystemVCGuest () throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("~system").path("system-vc")
@@ -150,7 +149,7 @@
@Test
public void testRetrieveOwnerPrivateVCInfo ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
JsonNode node = testSearchVC("dory", "dory", "dory-vc");
@@ -161,7 +160,7 @@
@Test
public void testRetrievePrivateVCInfoUnauthorized ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("~dory").path("dory-vc")
@@ -182,8 +181,8 @@
}
@Test
- public void testRetrieveProjectVCInfo () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testRetrieveProjectVCInfo () throws
+ ProcessingException, KustvaktException {
JsonNode node = testSearchVC("nemo", "dory", "group-vc");
assertEquals("group-vc", node.at("/name").asText());
@@ -193,7 +192,7 @@
@Test
public void testRetrieveProjectVCInfoByNonActiveMember ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("vc")
@@ -215,8 +214,8 @@
}
@Test
- public void testRetrievePublishedVCInfo () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testRetrievePublishedVCInfo () throws
+ ProcessingException, KustvaktException {
JsonNode node = testSearchVC("gill", "marlin", "published-vc");
assertEquals("published-vc", node.at("/name").asText());
@@ -242,31 +241,31 @@
}
@Test
- public void testListAvailableVCNemo () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testListAvailableVCNemo () throws
+ ProcessingException, KustvaktException {
JsonNode node = testListVC("nemo");
assertEquals(3, node.size());
}
@Test
- public void testListAvailableVCPearl () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testListAvailableVCPearl () throws
+ ProcessingException, KustvaktException {
JsonNode node = testListVC("pearl");
assertEquals(2, node.size());
}
@Test
- public void testListAvailableVCDory () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testListAvailableVCDory () throws
+ ProcessingException, KustvaktException {
JsonNode node = testListVC("dory");
assertEquals(4, node.size());
}
@Test
public void testListAvailableVCByOtherUser ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("~dory")
@@ -288,8 +287,8 @@
}
@Test
- public void testListAvailableVCByGuest () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testListAvailableVCByGuest () throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.request()
.get();
@@ -401,7 +400,7 @@
}
private JsonNode testCheckHiddenGroup (String groupName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("group")
.path("@"+groupName)
@@ -755,8 +754,8 @@
}
@Test
- public void testEditCorpusQuery () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testEditCorpusQuery () throws
+ ProcessingException, KustvaktException {
JsonNode node = testRetrieveKoralQuery("dory", "dory-vc");
assertEquals("koral:docGroup", node.at("/collection/@type").asText());
assertEquals("operation:and", node.at("/collection/operation").asText());
@@ -781,7 +780,7 @@
}
private JsonNode testRetrieveKoralQuery (String username, String vcName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("koralQuery").path("~" + username).path(vcName)
@@ -931,8 +930,8 @@
}
@Test
- public void testCreateDeleteAccess () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testCreateDeleteAccess () throws
+ ProcessingException, KustvaktException {
String vcName = "marlin-vc";
String groupName = "marlin-group";
@@ -977,8 +976,8 @@
}
private Response testShareVCByCreator (String vcCreator,
- String vcName, String groupName) throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ String vcName, String groupName) throws
+ ProcessingException, KustvaktException {
return target().path(API_VERSION).path("vc").path("~"+vcCreator)
.path(vcName).path("share").path("@"+groupName)
@@ -990,8 +989,8 @@
}
private void testShareVCNonUniqueAccess (String vcCreator, String vcName,
- String groupName) throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ String groupName) throws
+ ProcessingException, KustvaktException {
Response response =
testShareVCByCreator(vcCreator, vcName, groupName);
JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
@@ -1006,8 +1005,8 @@
}
@Test
- public void testShareUnknownVC () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testShareUnknownVC () throws
+ ProcessingException, KustvaktException {
Response response = testShareVCByCreator("marlin",
"non-existing-vc", "marlin group");
JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
@@ -1017,8 +1016,8 @@
}
@Test
- public void testShareUnknownGroup () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testShareUnknownGroup () throws
+ ProcessingException, KustvaktException {
Response response = testShareVCByCreator("marlin", "marlin-vc",
"non-existing-group");
JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
@@ -1028,8 +1027,8 @@
}
@Test
- public void testShareVCByVCAAdmin () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testShareVCByVCAAdmin () throws
+ ProcessingException, KustvaktException {
// dory is VCA in marlin group
Response response = target().path(API_VERSION).path("vc")
@@ -1051,8 +1050,8 @@
}
@Test
- public void testShareVCByNonVCAAdmin () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testShareVCByNonVCAAdmin () throws
+ ProcessingException, KustvaktException {
// nemo is not VCA in marlin group
Response response = target().path(API_VERSION).path("vc")
@@ -1073,7 +1072,7 @@
}
private Response testDeleteAccess (String username, String accessId)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("access").path(accessId)
@@ -1087,7 +1086,7 @@
}
private void testDeleteAccessUnauthorized (String accessId)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("access").path(accessId)
@@ -1108,8 +1107,8 @@
}
@Test
- public void testDeleteNonExistingAccess () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ public void testDeleteNonExistingAccess () throws
+ ProcessingException, KustvaktException {
Response response = testDeleteAccess("dory", "100");
assertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusFieldTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusFieldTest.java
index e75e700..fb44266 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusFieldTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusFieldTest.java
@@ -10,8 +10,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.HttpHeaders;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
@@ -34,8 +33,8 @@
private QueryDao dao;
private JsonNode testRetrieveField (String username, String vcName,
- String field) throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ String field) throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("field").path("~" + username).path(vcName)
.queryParam("fieldName", field)
@@ -52,8 +51,8 @@
}
private void testRetrieveProhibitedField (String username, String vcName,
- String field) throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ String field) throws
+ ProcessingException, KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("field").path("~" + username).path(vcName)
.queryParam("fieldName", field)
@@ -103,8 +102,8 @@
deleteVcFromDB("named-vc1");
}
- private void testRetrieveUnknownTokens () throws UniformInterfaceException,
- ClientHandlerException, KustvaktException {
+ private void testRetrieveUnknownTokens () throws
+ ProcessingException, KustvaktException {
JsonNode n = testRetrieveField("system", "named-vc1", "unknown");
assertEquals("unknown", n.at("/corpus/key").asText());
assertEquals(0, n.at("/corpus/value").size());
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusTestBase.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusTestBase.java
index 403ee7c..c712030 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusTestBase.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusTestBase.java
@@ -6,8 +6,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.HttpHeaders;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.client.Entity;
@@ -22,7 +21,7 @@
public abstract class VirtualCorpusTestBase extends SpringJerseyTest{
protected JsonNode testSearchVC (String username, String vcCreator, String vcName)
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("vc")
.path("~"+vcCreator).path(vcName)
diff --git a/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteMultipleCorpusQueryTest.java b/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteMultipleCorpusQueryTest.java
index 0ae5fb1..08ae5ad 100644
--- a/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteMultipleCorpusQueryTest.java
+++ b/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteMultipleCorpusQueryTest.java
@@ -6,9 +6,8 @@
import org.junit.Test;
import com.fasterxml.jackson.databind.JsonNode;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.UniformInterfaceException;
+import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
@@ -45,7 +44,7 @@
@Test
public void testStatisticsWithMultipleCq ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("statistics")
.queryParam("cq", "textType=Abhandlung")
@@ -66,7 +65,7 @@
@Test
public void testStatisticsWithMultipleCorpusQuery ()
- throws UniformInterfaceException, ClientHandlerException,
+ throws ProcessingException,
KustvaktException {
Response response = target().path(API_VERSION).path("statistics")
.queryParam("corpusQuery", "textType=Autobiographie")