refactoring TestClass parameters
This commit is contained in:
parent
a6c9be2eaf
commit
e0c8834848
|
@ -29,7 +29,7 @@ public class DownloadsTest {
|
||||||
private String absoluteLocalPath;
|
private String absoluteLocalPath;
|
||||||
private String newFilePath="src/test/resources";
|
private String newFilePath="src/test/resources";
|
||||||
private IClient client;
|
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 serviceClass="JUnitTest";
|
||||||
private String serviceName="StorageManager";
|
private String serviceName="StorageManager";
|
||||||
private String NotExistingId="5a5c7d1d1b9b060285bbe2bd";
|
private String NotExistingId="5a5c7d1d1b9b060285bbe2bd";
|
||||||
|
@ -39,8 +39,8 @@ public class DownloadsTest {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void getClient() throws RemoteBackendException{
|
public void getClient() throws RemoteBackendException{
|
||||||
// ScopeProvider.instance.set(Costants.DEFAULT_SCOPE_STRING);
|
ScopeProvider.instance.set(Costants.DEFAULT_SCOPE_STRING);
|
||||||
ScopeProvider.instance.set(scope);
|
// ScopeProvider.instance.set(scope);
|
||||||
try {
|
try {
|
||||||
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();
|
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();
|
||||||
assertNotNull(client);
|
assertNotNull(client);
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class HLcheckTest {
|
||||||
private String absoluteLocalPath;
|
private String absoluteLocalPath;
|
||||||
private String newFilePath="src/test/resources";
|
private String newFilePath="src/test/resources";
|
||||||
private IClient client;
|
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 serviceClass="org.gcube.portlets.user";//"JUnitTest";
|
||||||
private String serviceName="home-library";//"test-home-library";//"StorageManager";
|
private String serviceName="home-library";//"test-home-library";//"StorageManager";
|
||||||
private String id;
|
private String id;
|
||||||
|
@ -38,10 +38,10 @@ public class HLcheckTest {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void getClient() throws RemoteBackendException{
|
public void getClient() throws RemoteBackendException{
|
||||||
// ScopeProvider.instance.set(Costants.DEFAULT_SCOPE_STRING);
|
ScopeProvider.instance.set(Costants.DEFAULT_SCOPE_STRING);
|
||||||
ScopeProvider.instance.set(scope);
|
// ScopeProvider.instance.set(scope);
|
||||||
try {
|
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);
|
assertNotNull(client);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
|
@ -87,12 +87,12 @@ public class HLcheckTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void downloadBySpecificIdOnlyForTest() throws RemoteBackendException{
|
public void downloadBySpecificIdOnlyForTest() throws RemoteBackendException{
|
||||||
// String idReturned=client.get().LFile(newFilePath).RFileById(id);
|
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 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(absoluteLocalPath).RFile("5f6a1f405b0bde3544cbd3be");
|
||||||
System.out.println("downloadById id: "+idReturned);
|
System.out.println("downloadById id: "+idReturned);
|
||||||
// File f =new File(newFilePath);
|
File f =new File(newFilePath);
|
||||||
File f =new File(file);
|
// File f =new File(file);
|
||||||
System.out.println("path new File downloaded: "+f.getAbsolutePath());
|
System.out.println("path new File downloaded: "+f.getAbsolutePath());
|
||||||
assertTrue(f.exists());
|
assertTrue(f.exists());
|
||||||
removeLocalFile();
|
removeLocalFile();
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class PropertiesTest {
|
||||||
private String absoluteLocalPath;
|
private String absoluteLocalPath;
|
||||||
private String newFilePath="src/test/resources";
|
private String newFilePath="src/test/resources";
|
||||||
private IClient client;
|
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 serviceClass="JUnitTest";
|
||||||
private String serviceName="StorageManager";
|
private String serviceName="StorageManager";
|
||||||
private String id;
|
private String id;
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.gcube.contentmanager.storageclient.wrapper.MemoryType;
|
||||||
public final class Costants {
|
public final class Costants {
|
||||||
|
|
||||||
public static final MemoryType DEFAULT_MEMORY_TYPE = MemoryType.PERSISTENT;
|
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";
|
public static final String DEFAULT_PASS_PHRASE="this is a phrasethis is a phrase";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue