refs #200: Create accouting-lib library

https://support.d4science.org/issues/200
Fixing tests

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@115784 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-07-02 10:09:39 +00:00
parent 7d69ed0851
commit 3f897db4ff
1 changed files with 9 additions and 2 deletions

View File

@ -63,18 +63,25 @@ public abstract class Persistence {
continue;
}
try {
logger.debug(String.format("Testing %s", persistence.getClass().getSimpleName()));
logger.debug(String.format("Testing %s", foundPersistence.getClass().getSimpleName()));
foundPersistence.prepareConnection();
/*
* Uncomment the following line of code if you want to try
* to create a test UsageRecord before setting the
* foundPersistence as default
*
* foundPersistence.accountWithFallback(TestUsageRecord.createTestServiceUsageRecord());
*/
persistence = foundPersistence;
break;
} catch (Exception e) {
logger.debug(String.format("%s not initialized correctly. It will not be used", foundPersistence.getClass().getSimpleName()));
}
}
if(persistence==null){
persistence = fallback;
}
//persistence.accountWithFallback(TestUsageRecord.createTestServiceUsageRecord());
} catch(Exception e){
logger.error("Unable to instance a Persistence Implementation. Using fallback as default",
e.getCause());