From 8664d1a3049a4dd40cf62e717de694d0ebcd9da4 Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Fri, 24 Oct 2014 12:30:07 +0000 Subject: [PATCH] updated test git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/uri-resolver-manager@100961 82a268e6-3cf1-43bd-a215-b396298e98cf --- src/test/java/UriResolverTest.java | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/test/java/UriResolverTest.java b/src/test/java/UriResolverTest.java index 71fb03d..eb050bd 100644 --- a/src/test/java/UriResolverTest.java +++ b/src/test/java/UriResolverTest.java @@ -19,7 +19,7 @@ import org.junit.Test; public class UriResolverTest { @Test - public void test() { + public void testGIS() { try { ScopeProvider.instance.set("/gcube/devsec/devVRE"); @@ -38,6 +38,27 @@ public class UriResolverTest { } } + @Test + public void testSMP() { + + try { + ScopeProvider.instance.set("/gcube/devsec/devVRE"); + UriResolverManager resolver = new UriResolverManager("SMP"); + Map params = new HashMap(); + params.put("smp-uri","smp://Wikipedia_logo_silver.png?5ezvFfBOLqaqBlwCEtAvz4ch5BUu1ag3yftpCvV+gayz9bAtSsnO1/sX6pemTKbDe0qbchLexXeWgGcJlskYE8td9QSDXSZj5VSl9kdN9SN0/LRYaWUZuP4Q1J7lEiwkU4GKPsiD6PDRVcT4QAqTEy5hSIbr6o4Y"); + params.put("fileName", "wikipediaLogo"); + params.put("contentType", "image/jpeg"); //true, link is shorted otherwise none + String shortLink = resolver.getLink(params, true); + System.out.println(shortLink); + } catch (UriResolverMapException e) { + e.printStackTrace(); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + }catch (Exception e) { + e.printStackTrace(); + } + } + /** * Thread safe */