From ef12d844c1e9ba0443e0096bbc07f2da45b29fa8 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Wed, 24 Mar 2021 14:36:53 +0100 Subject: [PATCH] Refs #21013: Migrate accounting-manager to postgresql persistence Updated Test Files --- .classpath | 6 +- .settings/org.eclipse.wst.common.component | 5 +- pom.xml | 4 +- .../TestAccountingMananger.java | 50 ------------- .../TestAccountingManangerCache.java | 74 ------------------- 5 files changed, 9 insertions(+), 130 deletions(-) delete mode 100644 src/test/java/org/gcube/portlets/admin/accountingmanager/TestAccountingMananger.java delete mode 100644 src/test/java/org/gcube/portlets/admin/accountingmanager/TestAccountingManangerCache.java diff --git a/.classpath b/.classpath index cef8a86..ad2ee60 100644 --- a/.classpath +++ b/.classpath @@ -1,12 +1,12 @@ - + - + @@ -45,5 +45,5 @@ - + diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 344149c..d27af28 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,9 +1,12 @@ - + + + uses + diff --git a/pom.xml b/pom.xml index 8fe88aa..d1c3c7f 100644 --- a/pom.xml +++ b/pom.xml @@ -257,7 +257,7 @@ - + org.gcube.accounting accounting-analytics-persistence-postgresql @@ -401,7 +401,7 @@ - + org.apache.maven.plugins maven-surefire-plugin diff --git a/src/test/java/org/gcube/portlets/admin/accountingmanager/TestAccountingMananger.java b/src/test/java/org/gcube/portlets/admin/accountingmanager/TestAccountingMananger.java deleted file mode 100644 index 7faf1e9..0000000 --- a/src/test/java/org/gcube/portlets/admin/accountingmanager/TestAccountingMananger.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * - */ -package org.gcube.portlets.admin.accountingmanager; - -import junit.framework.TestCase; - -import org.gcube.portlets.admin.accountingmanager.server.is.EnableTabsJAXB; -import org.gcube.portlets.admin.accountingmanager.server.is.InformationSystemUtils; -import org.gcube.portlets.admin.accountingmanager.shared.Constants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Giancarlo Panichi - * - * - */ -public class TestAccountingMananger extends TestCase { - - private static Logger logger = LoggerFactory - .getLogger(TestAccountingMananger.class); - - - public void testAccountingManagerResource() { - if (Constants.TEST_ENABLE) { - logger.debug("Test Enabled"); - - try { - logger.debug("Scope: " + Constants.DEFAULT_SCOPE); - EnableTabsJAXB enableTabs = InformationSystemUtils - .retrieveEnableTab(Constants.DEFAULT_SCOPE); - logger.debug("EnableTabs: " + enableTabs); - assertTrue(true); - - } catch (Exception e) { - assertTrue("Error searching the resource!", false); - e.printStackTrace(); - } - - } else { - logger.debug("Test Disabled"); - assertTrue(true); - } - } - - - -} diff --git a/src/test/java/org/gcube/portlets/admin/accountingmanager/TestAccountingManangerCache.java b/src/test/java/org/gcube/portlets/admin/accountingmanager/TestAccountingManangerCache.java deleted file mode 100644 index 9fcf1b4..0000000 --- a/src/test/java/org/gcube/portlets/admin/accountingmanager/TestAccountingManangerCache.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * - */ -package org.gcube.portlets.admin.accountingmanager; - -import junit.framework.TestCase; - -import org.gcube.portlets.admin.accountingmanager.server.amservice.cache.AccountingCache; -import org.gcube.portlets.admin.accountingmanager.shared.Constants; -import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesResponse; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Giancarlo Panichi - * - * - */ -public class TestAccountingManangerCache extends TestCase { - - private static Logger logger = LoggerFactory - .getLogger(TestAccountingManangerCache.class); - - public void testAccountingManagerCache() { - if (Constants.TEST_ENABLE) { - logger.debug("Test Enabled"); - - try { - AccountingCache accountingCache = new AccountingCache(); - SeriesResponse s = new SeriesResponse(); - for (int i = 0; i < 1000000; i++) { - accountingCache.putSeries("key" + i, s); - } - Thread.sleep(180000); - - accountingCache.finalize(); - assertTrue(true); - - } catch (Throwable e) { - logger.error(e.getLocalizedMessage(), e); - assertTrue("Error in cache!", false); - - } - - } else { - logger.debug("Test Disabled"); - assertTrue(true); - } - } - - - public void testAccountingManagerCacheRemoveAll() { - if (Constants.TEST_ENABLE) { - logger.debug("Test Enabled"); - - try { - AccountingCache accountingCache = new AccountingCache(); - accountingCache.finalize(); - assertTrue(true); - - } catch (Throwable e) { - logger.error(e.getLocalizedMessage(), e); - assertTrue("Error in cache!", false); - - } - - } else { - logger.debug("Test Disabled"); - assertTrue(true); - } - } - -}