accounting-manager/src/test/java/org/gcube/portlets/admin/accountingmanager/TestAccountingManangerCache...

53 lines
1.2 KiB
Java
Raw Normal View History

/**
*
*/
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" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TestAccountingManangerCache extends TestCase {
private static Logger logger = LoggerFactory
.getLogger(TestAccountingManangerCache.class);
public void testAccountingManagerResource() {
if (Constants.TEST_ENABLE) {
logger.debug("Test Enabled");
try {
AccountingCache accountingCache=new AccountingCache();
SeriesResponse s=new SeriesResponse();
accountingCache.put("scope","key", s);
accountingCache.finalize();
assertTrue(true);
} catch (Throwable e) {
logger.error(e.getLocalizedMessage(),e);
assertTrue("Error in cache!", false);
}
} else {
logger.debug("Test Disabled");
assertTrue(true);
}
}
}