uri-resolver/src/test/java/DetachedVREsTest.java

47 lines
1.2 KiB
Java
Raw Normal View History

2020-06-08 17:18:13 +02:00
import java.util.concurrent.ExecutionException;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
2020-06-10 14:46:02 +02:00
import org.gcube.common.scope.api.ScopeProvider;
2020-06-08 17:18:13 +02:00
import org.gcube.datatransfer.resolver.caches.LoadingMapOfDetachedVRE;
import org.gcube.infrastructure.detachedres.detachedreslibrary.shared.re.VRE;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
2020-06-10 14:46:02 +02:00
public class DetachedVREsTest {
2020-06-08 17:18:13 +02:00
2020-06-10 14:46:02 +02:00
public static Logger LOG = LoggerFactory.getLogger(DetachedVREsTest.class);
2020-06-08 17:18:13 +02:00
2020-06-10 14:46:02 +02:00
public static String TOKEN = "";
2020-06-08 17:18:13 +02:00
2020-06-10 14:46:02 +02:00
public static String detachedVREName = "BlueBridgeProject";
public static String rootScope = "/gcube";
//@Before
public void initCache() {
}
2020-06-08 17:18:13 +02:00
/**
* Storage hub test.
*
* @throws Exception the exception
*/
2020-06-10 14:46:02 +02:00
//@Test
2020-06-08 17:18:13 +02:00
public void testCacheOfDetachedVREs() throws Exception{
try {
2020-06-10 14:46:02 +02:00
ScopeProvider.instance.set(rootScope);
2020-06-08 17:18:13 +02:00
SecurityTokenProvider.instance.set(TOKEN);
2020-06-10 14:46:02 +02:00
//LoadingMapOfDetachedVRE cache = new LoadingMapOfDetachedVRE();
VRE theDetachedVRE = LoadingMapOfDetachedVRE.get(detachedVREName);
2020-06-08 17:18:13 +02:00
LOG.info("Detached VRE found {}", theDetachedVRE);
}catch (ExecutionException e) {
2020-06-10 14:46:02 +02:00
LOG.info("The Detached VRE for name {} not found",detachedVREName);
}catch (Exception e) {
2020-06-08 17:18:13 +02:00
e.printStackTrace();
}
}
}