Refs #21013: Migrate accounting-manager to postgresql persistence

Updated Test Files
This commit is contained in:
Giancarlo Panichi 2021-03-24 14:36:53 +01:00
parent 5cde253fbb
commit ef12d844c1
5 changed files with 9 additions and 130 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/accounting-manager-1.12.2-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/accounting-manager-1.13.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/accounting-manager-1.12.2-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<classpathentry excluding="**" kind="src" output="target/accounting-manager-1.13.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@ -45,5 +45,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/accounting-manager-1.12.2-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/accounting-manager-1.13.0-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="accounting-manager-1.12.2-SNAPSHOT">
<wb-module deploy-name="accounting-manager-1.13.0-SNAPSHOT">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="accounting-manager-theme-1.3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/accounting-manager-theme/accounting-manager-theme">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/accounting-manager/target/accounting-manager-1.3.0-SNAPSHOT/WEB-INF/classes"/>
<property name="context-root" value="accounting-manager"/>
</wb-module>

View File

@ -257,7 +257,7 @@
</dependency>
<!-- Accounting Persistence-CouchBase -->
<!-- Accounting Persistence -->
<dependency>
<groupId>org.gcube.accounting</groupId>
<artifactId>accounting-analytics-persistence-postgresql</artifactId>

View File

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

View File

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