Fixed boolean return transformation

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry-publisher@142349 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2017-02-07 16:29:28 +00:00
parent d33bbbca7c
commit 7277239d6b
2 changed files with 19 additions and 19 deletions

View File

@ -190,12 +190,12 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
}
class ResourceRegistryCall<C> implements Call<EndpointReference, C> {
class ResourceRegistryPublisherCall<C> implements Call<EndpointReference, C> {
protected final Class<C> clazz;
protected final HTTPInputs httpInputs;
public ResourceRegistryCall(Class<C> clazz, HTTPInputs httpInputs) {
public ResourceRegistryPublisherCall(Class<C> clazz, HTTPInputs httpInputs) {
this.clazz = clazz;
this.httpInputs = httpInputs;
}
@ -280,7 +280,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
logger.trace("Server returned content : {}", res);
if(Boolean.class.isAssignableFrom(clazz)){
return (C) ((Boolean) Boolean.getBoolean(res)) ;
return (C) ((Boolean) Boolean.valueOf(res)) ;
}else if(ISManageable.class.isAssignableFrom(clazz)){
return (C) ISMapper.unmarshal((Class<ISManageable>) clazz, res);
}
@ -308,7 +308,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
HTTPMETHOD.PUT, null, body);
ResourceRegistryCall<F> call = new ResourceRegistryCall<>(
ResourceRegistryPublisherCall<F> call = new ResourceRegistryPublisherCall<>(
facetClass, httpInputs);
F f = delegate.make(call);
@ -336,7 +336,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
HTTPMETHOD.POST, null, body);
ResourceRegistryCall<F> call = new ResourceRegistryCall<>(
ResourceRegistryPublisherCall<F> call = new ResourceRegistryPublisherCall<>(
facetClass, httpInputs);
F f = delegate.make(call);
@ -363,7 +363,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
HTTPMETHOD.DELETE, null);
ResourceRegistryCall<Boolean> call = new ResourceRegistryCall<>(
ResourceRegistryPublisherCall<Boolean> call = new ResourceRegistryPublisherCall<>(
Boolean.class, httpInputs);
boolean deleted = delegate.make(call);
@ -394,7 +394,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
HTTPMETHOD.PUT, null, body);
ResourceRegistryCall<R> call = new ResourceRegistryCall<>(
ResourceRegistryPublisherCall<R> call = new ResourceRegistryPublisherCall<>(
resourceClass, httpInputs);
R r = delegate.make(call);
@ -424,7 +424,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
HTTPMETHOD.POST, null, body);
ResourceRegistryCall<R> call = new ResourceRegistryCall<>(
ResourceRegistryPublisherCall<R> call = new ResourceRegistryPublisherCall<>(
resourceClass, httpInputs);
R r = delegate.make(call);
@ -451,7 +451,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
HTTPMETHOD.DELETE, null);
ResourceRegistryCall<Boolean> call = new ResourceRegistryCall<>(
ResourceRegistryPublisherCall<Boolean> call = new ResourceRegistryPublisherCall<>(
Boolean.class, httpInputs);
boolean deleted = delegate.make(call);
@ -492,7 +492,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
HTTPMETHOD.PUT, null, body);
ResourceRegistryCall<C> call = new ResourceRegistryCall<>(
ResourceRegistryPublisherCall<C> call = new ResourceRegistryPublisherCall<>(
consistsOfClass, httpInputs);
C c = delegate.make(call);
@ -520,7 +520,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
HTTPMETHOD.DELETE, null);
ResourceRegistryCall<Boolean> call = new ResourceRegistryCall<>(
ResourceRegistryPublisherCall<Boolean> call = new ResourceRegistryPublisherCall<>(
Boolean.class, httpInputs);
boolean deleted = delegate.make(call);
@ -562,7 +562,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
HTTPMETHOD.PUT, null, body);
ResourceRegistryCall<I> call = new ResourceRegistryCall<>(
ResourceRegistryPublisherCall<I> call = new ResourceRegistryPublisherCall<>(
isRelatedToClass, httpInputs);
I i = delegate.make(call);
@ -590,7 +590,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
HTTPMETHOD.DELETE, null);
ResourceRegistryCall<Boolean> call = new ResourceRegistryCall<>(
ResourceRegistryPublisherCall<Boolean> call = new ResourceRegistryPublisherCall<>(
Boolean.class, httpInputs);
boolean deleted = delegate.make(call);
@ -625,7 +625,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
HTTPMETHOD.POST, null);
ResourceRegistryCall<Boolean> call = new ResourceRegistryCall<>(
ResourceRegistryPublisherCall<Boolean> call = new ResourceRegistryPublisherCall<>(
Boolean.class, httpInputs);
boolean added = delegate.make(call);
@ -668,7 +668,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
HTTPMETHOD.POST, null);
ResourceRegistryCall<Boolean> call = new ResourceRegistryCall<>(
ResourceRegistryPublisherCall<Boolean> call = new ResourceRegistryPublisherCall<>(
Boolean.class, httpInputs);
boolean added = delegate.make(call);
@ -713,7 +713,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
HTTPMETHOD.POST, null);
ResourceRegistryCall<Boolean> call = new ResourceRegistryCall<>(
ResourceRegistryPublisherCall<Boolean> call = new ResourceRegistryPublisherCall<>(
Boolean.class, httpInputs);
boolean removed = delegate.make(call);
@ -757,7 +757,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(),
HTTPMETHOD.POST, null);
ResourceRegistryCall<Boolean> call = new ResourceRegistryCall<>(
ResourceRegistryPublisherCall<Boolean> call = new ResourceRegistryPublisherCall<>(
Boolean.class, httpInputs);
boolean removed = delegate.make(call);

View File

@ -59,8 +59,8 @@ public class ScopedTest {
GCUBE_DEVSEC = properties.getProperty(GCUBE_DEVSEC_VARNAME);
GCUBE_DEVSEC_DEVVRE = properties.getProperty(GCUBE_DEVSEC_DEVVRE_VARNAME);
DEFAULT_TEST_SCOPE = GCUBE_DEVSEC;
ALTERNATIVE_TEST_SCOPE = GCUBE_DEVSEC_DEVVRE;
DEFAULT_TEST_SCOPE = GCUBE_DEVNEXT;
ALTERNATIVE_TEST_SCOPE = GCUBE_DEVNEXT_NEXTNEXT;
}
public static String getCurrentScope(String token) throws ObjectNotFound, Exception{