From 3dcafc7c05fe4806a99275bfee38c65afd2aee55 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Tue, 3 Sep 2024 17:25:46 +0200 Subject: [PATCH] Fixed test --- .../org/gcube/storagehub/ContextTest.java | 7 +++-- .../storagehub/StorageHubManagementTest.java | 30 ++++++++++++++----- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/test/java/org/gcube/storagehub/ContextTest.java b/src/test/java/org/gcube/storagehub/ContextTest.java index 75f8a44..7f2908c 100644 --- a/src/test/java/org/gcube/storagehub/ContextTest.java +++ b/src/test/java/org/gcube/storagehub/ContextTest.java @@ -37,8 +37,8 @@ public class ContextTest { public static final String DEVSEC; public static final String DEVVRE; - private static final String ROOT_PROD; - private static final String ROOT_PRE; + public static final String ROOT_PRE; + public static final String ROOT_PROD; protected static final Properties properties; @@ -54,8 +54,9 @@ public class ContextTest { DEVSEC = GCUBE + "/devsec"; DEVVRE = DEVSEC + "/devVRE"; - ROOT_PROD = "/d4science.research-infrastructures.eu"; ROOT_PRE = "/pred4s"; + ROOT_PROD = "/d4science.research-infrastructures.eu"; + DEFAULT_TEST_SCOPE = DEVVRE; diff --git a/src/test/java/org/gcube/storagehub/StorageHubManagementTest.java b/src/test/java/org/gcube/storagehub/StorageHubManagementTest.java index f2e6a3d..13e8c8b 100644 --- a/src/test/java/org/gcube/storagehub/StorageHubManagementTest.java +++ b/src/test/java/org/gcube/storagehub/StorageHubManagementTest.java @@ -14,6 +14,7 @@ import org.gcube.common.storagehub.client.dsl.OpenResolver; import org.gcube.common.storagehub.model.Metadata; import org.gcube.common.storagehub.model.items.Item; import org.gcube.common.storagehub.model.service.Version; +import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,19 +46,19 @@ public class StorageHubManagementTest extends ContextTest { */ } + @Ignore @Test public void testPublicLink() throws Exception { + @SuppressWarnings("unused") String urlString = "https://data.dev.d4science.org/shub/E_WE9XM3Vad1orRGNhZVJJY0NybkFQR1BzRzZKUndPeVdLYTk4b1Y2MmVhVE9oZFYvM2hBb1JKRkluT1JQR1RZdQ=="; - } - //@Ignore + @Ignore @Test public void listFolders() throws Exception { - String c = "/pred4s/preprod/GRSF_Pre"; - c = "/gcube"; - c = "/d4science.research-infrastructures.eu/FARM/GRSF_Pre"; - //ContextTest.setContextByName(c); + String c = "/gcube"; +// c = "/pred4s/preprod/GRSF_Pre"; +// c = "/d4science.research-infrastructures.eu/FARM/GRSF_Pre"; List contexts = new ArrayList<>(); contexts.add(c); @@ -83,15 +84,28 @@ public class StorageHubManagementTest extends ContextTest { logger.info("Catalogue folder found"); storageHubManagement.tree((FolderContainer) itemContainer); // if(name.compareTo("service-account-grsf-publisher")==0) { -// itemContainer.delete(); +// // itemContainer.delete(); +// storageHubManagement.tree((FolderContainer) itemContainer); // } }else { - storageHubManagement.logItem(itemContainer); + // storageHubManagement.logItem(itemContainer); // storageHubManagement.tree((FolderContainer) itemContainer); } } } } + + } + + @Ignore + @Test + public void emptyTrash() throws Exception { + String c = GCUBE; +// c = ContextTest.ROOT_PRE; +// c = ContextTest.ROOT_PROD; + ContextTest.setContextByName(c); + StorageHubManagement storageHubManagement = new StorageHubManagement(); + storageHubManagement.getStorageHubClient().emptyTrash(); } @Test