|
|
|
@ -30,7 +30,7 @@ public class HLcheckTest {
|
|
|
|
|
private String absoluteLocalPath;
|
|
|
|
|
private String newFilePath="src/test/resources";
|
|
|
|
|
private IClient client;
|
|
|
|
|
private String scope="/d4science.research-infrastructures.eu";//"/d4science.research-infrastructures.eu";//Costants.DEFAULT_SCOPE_STRING;//"/gcube/devsec";//"/d4science.research-infrastructures.eu";//"/d4science.research-infrastructures.eu";//"/d4science.research-infrastructures.eu";//"/d4science.research-infrastructures.eu";// //"/CNR.it";// ///gcube/devsec/devVRE"; //"/CNR.it/ISTI";//"/gcube/devsec/devVRE"; // /d4science.research-infrastructures.eu"; //"/d4science.research-infrastructures.eu"; //"/CNR.it/ISTI";//
|
|
|
|
|
// private String scope="/d4science.research-infrastructures.eu";//"/d4science.research-infrastructures.eu";//Costants.DEFAULT_SCOPE_STRING;//"/gcube/devsec";//"/d4science.research-infrastructures.eu";//"/d4science.research-infrastructures.eu";//"/d4science.research-infrastructures.eu";//"/d4science.research-infrastructures.eu";// //"/CNR.it";// ///gcube/devsec/devVRE"; //"/CNR.it/ISTI";//"/gcube/devsec/devVRE"; // /d4science.research-infrastructures.eu"; //"/d4science.research-infrastructures.eu"; //"/CNR.it/ISTI";//
|
|
|
|
|
private String serviceClass="org.gcube.portlets.user";//"JUnitTest";
|
|
|
|
|
private String serviceName="home-library";//"test-home-library";//"StorageManager";
|
|
|
|
|
private String id;
|
|
|
|
@ -38,10 +38,10 @@ public class HLcheckTest {
|
|
|
|
|
|
|
|
|
|
@Before
|
|
|
|
|
public void getClient() throws RemoteBackendException{
|
|
|
|
|
// ScopeProvider.instance.set(Costants.DEFAULT_SCOPE_STRING);
|
|
|
|
|
ScopeProvider.instance.set(scope);
|
|
|
|
|
ScopeProvider.instance.set(Costants.DEFAULT_SCOPE_STRING);
|
|
|
|
|
// ScopeProvider.instance.set(scope);
|
|
|
|
|
try {
|
|
|
|
|
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, scope, false).getClient();
|
|
|
|
|
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_SCOPE_STRING, false).getClient();
|
|
|
|
|
assertNotNull(client);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
@ -87,12 +87,12 @@ public class HLcheckTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void downloadBySpecificIdOnlyForTest() throws RemoteBackendException{
|
|
|
|
|
// String idReturned=client.get().LFile(newFilePath).RFileById(id);
|
|
|
|
|
String file="/home/rcirillo-pc/Downloads/ce1159aa-a87f-4074-a3f9-36fe26d62f87-d4science.research-infrastructures.eu-gCubeApps-DESCRAMBLE.zip";
|
|
|
|
|
String idReturned=client.get().LFile(file).RFile("5f6a1f405b0bde3544cbd3be");
|
|
|
|
|
String idReturned=client.get().LFile(newFilePath).RFileById(id);
|
|
|
|
|
// String file="/home/rcirillo-pc/Downloads/ce1159aa-a87f-4074-a3f9-36fe26d62f87-d4science.research-infrastructures.eu-gCubeApps-DESCRAMBLE.zip";
|
|
|
|
|
// String idReturned=client.get().LFile(absoluteLocalPath).RFile("5f6a1f405b0bde3544cbd3be");
|
|
|
|
|
System.out.println("downloadById id: "+idReturned);
|
|
|
|
|
// File f =new File(newFilePath);
|
|
|
|
|
File f =new File(file);
|
|
|
|
|
File f =new File(newFilePath);
|
|
|
|
|
// File f =new File(file);
|
|
|
|
|
System.out.println("path new File downloaded: "+f.getAbsolutePath());
|
|
|
|
|
assertTrue(f.exists());
|
|
|
|
|
removeLocalFile();
|
|
|
|
|