Fixed test

This commit is contained in:
Luca Frosini 2024-09-12 15:56:06 +02:00
parent cfe1f37fb8
commit 3a5fefd2fe
1 changed files with 21 additions and 7 deletions

View File

@ -30,6 +30,7 @@ public class StorageHubManagementTest extends ContextTest {
logger.debug("Context Folder ID : {} - Name : {}", contextFolder.getId(), contextFolder.get().getName());
}
@Ignore
@Test
public void test() throws Exception {
StorageHubManagement storageHubManagement = new StorageHubManagement();
@ -59,6 +60,8 @@ public class StorageHubManagementTest extends ContextTest {
String c = "/gcube";
// c = "/pred4s/preprod/GRSF_Pre";
// c = "/d4science.research-infrastructures.eu/FARM/GRSF_Pre";
// c = "/d4science.research-infrastructures.eu/FARM/GRSF_Admin";
// c = "/d4science.research-infrastructures.eu/FARM/GRSF";
List<String> contexts = new ArrayList<>();
contexts.add(c);
@ -80,16 +83,25 @@ public class StorageHubManagementTest extends ContextTest {
String name = item.getName();
ContainerType containerType = itemContainer.getType();
if(containerType==ContainerType.FOLDER) {
if(item.isHidden()) {
storageHubManagement.logItem(itemContainer);
}
if(name.compareTo(".catalogue")==0 || name.compareTo("service-account-gcat")==0 || name.compareTo("service-account-grsf-publisher")==0) {
logger.info("Catalogue folder found");
storageHubManagement.tree((FolderContainer) itemContainer);
// if(name.compareTo("service-account-grsf-publisher")==0) {
// // itemContainer.delete();
// storageHubManagement.tree((FolderContainer) itemContainer);
// }
}else {
// storageHubManagement.logItem(itemContainer);
storageHubManagement.logItem(itemContainer);
// storageHubManagement.tree((FolderContainer) itemContainer);
if(name.compareTo(".catalogue")==0) {
// storageHubManagement.tree((FolderContainer) itemContainer);
// itemContainer.forceDelete();
}
if(name.compareTo("service-account-grsf-publisher")==0) {
// storageHubManagement.tree((FolderContainer) itemContainer);
// itemContainer.forceDelete();
}
if(name.compareTo("service-account-gcat")==0) {
// storageHubManagement.tree((FolderContainer) itemContainer);
// itemContainer.forceDelete();
}
}
}
}
@ -108,6 +120,7 @@ public class StorageHubManagementTest extends ContextTest {
storageHubManagement.getStorageHubClient().emptyTrash();
}
@Ignore
@Test
public void getFileInfo() throws Exception {
StorageHubManagement storageHubManagement = new StorageHubManagement();
@ -134,6 +147,7 @@ public class StorageHubManagementTest extends ContextTest {
}
}
@Ignore
@Test
public void getFileInfoViaDirectoryListing() throws Exception {
StorageHubManagement storageHubManagement = new StorageHubManagement();