Browse Source

refactoring TestClass parameters

master
Roberto Cirillo 1 year ago
parent
commit
e0c8834848
  1. 6
      src/test/java/org/gcube/contentmanager/storageclient/test/DownloadsTest.java
  2. 18
      src/test/java/org/gcube/contentmanager/storageclient/test/HLcheckTest.java
  3. 2
      src/test/java/org/gcube/contentmanager/storageclient/test/PropertiesTest.java
  4. 2
      src/test/java/org/gcube/contentmanager/storageclient/test/utils/Costants.java

6
src/test/java/org/gcube/contentmanager/storageclient/test/DownloadsTest.java

@ -29,7 +29,7 @@ public class DownloadsTest {
private String absoluteLocalPath;
private String newFilePath="src/test/resources";
private IClient client;
private String scope="/d4science.research-infrastructures.eu"; //"/gcube";//"/gcube";//"/d4science.research-infrastructures.eu"; //"/gcube/devsec";//"/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"; //"/gcube";//"/gcube";//"/d4science.research-infrastructures.eu"; //"/gcube/devsec";//"/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="JUnitTest";
private String serviceName="StorageManager";
private String NotExistingId="5a5c7d1d1b9b060285bbe2bd";
@ -39,8 +39,8 @@ public class DownloadsTest {
@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, Costants.DEFAULT_MEMORY_TYPE).getClient();
assertNotNull(client);

18
src/test/java/org/gcube/contentmanager/storageclient/test/HLcheckTest.java

@ -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();

2
src/test/java/org/gcube/contentmanager/storageclient/test/PropertiesTest.java

@ -26,7 +26,7 @@ public class PropertiesTest {
private String absoluteLocalPath;
private String newFilePath="src/test/resources";
private IClient client;
private String scope="/gcube/devsec"; //"/d4science.research-infrastructures.eu"; ///gcube/devsec/devVRE"; //"/CNR.it/ISTI";//"/gcube/devsec/devVRE"; // /d4science.research-infrastructures.eu"; //"/d4science.research-infrastructures.eu"; //"/CNR.it/ISTI";//
// private String scope="/gcube/devsec"; //"/d4science.research-infrastructures.eu"; ///gcube/devsec/devVRE"; //"/CNR.it/ISTI";//"/gcube/devsec/devVRE"; // /d4science.research-infrastructures.eu"; //"/d4science.research-infrastructures.eu"; //"/CNR.it/ISTI";//
private String serviceClass="JUnitTest";
private String serviceName="StorageManager";
private String id;

2
src/test/java/org/gcube/contentmanager/storageclient/test/utils/Costants.java

@ -14,7 +14,7 @@ import org.gcube.contentmanager.storageclient.wrapper.MemoryType;
public final class Costants {
public static final MemoryType DEFAULT_MEMORY_TYPE = MemoryType.PERSISTENT;
public static final String DEFAULT_SCOPE_STRING="/gcube/devsec";
public static final String DEFAULT_SCOPE_STRING="/gcube";
public static final String DEFAULT_PASS_PHRASE="this is a phrasethis is a phrase";
}

Loading…
Cancel
Save