added JUnit Test
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/uri-resolver-manager@100796 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
33a70cf6a1
commit
d4dd5d44e4
|
@ -38,7 +38,7 @@ public class UriResolverManager {
|
|||
* Instance a UriResolverManager
|
||||
* Precondition: set the scope provider {@link ScopeProvider.instance.get()}
|
||||
* The scope is used to look up the generic resource {@link UriResolverMapReader#URI_RESOLVER_MAP} available in the infrastructure to map ApplicationType with its Resolver
|
||||
* @param applicationType a key Application Type
|
||||
* @param applicationType a key Application Type {@link UriResolverManager#getApplicationTypes()}
|
||||
* @throws Exception
|
||||
*/
|
||||
public UriResolverManager(String applicationType) throws UriResolverMapException, IllegalArgumentException{
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.portlets.user.uriresolvermanager.UriResolverManager;
|
||||
import org.gcube.portlets.user.uriresolvermanager.exception.IllegalArgumentException;
|
||||
import org.gcube.portlets.user.uriresolvermanager.exception.UriResolverMapException;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* @Oct 20, 2014
|
||||
*
|
||||
*/
|
||||
public class UriResolverTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
try {
|
||||
ScopeProvider.instance.set("/gcube/devsec/devVRE");
|
||||
UriResolverManager resolver = new UriResolverManager("GIS");
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("gis-UUID", "eb1a1b63-f324-47ee-9522-b8f5803e19ec");
|
||||
params.put("scope", "/gcube/devsec/devVRE");
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue