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
This commit is contained in:
Francesco Mangiacrapa 2014-10-24 12:30:07 +00:00
parent 29d3baded1
commit 8664d1a304
1 changed files with 22 additions and 1 deletions

View File

@ -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<String, String> params = new HashMap<String, String>();
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
*/