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:
parent
7d69ed0851
commit
3f897db4ff
|
@ -63,18 +63,25 @@ public abstract class Persistence {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
logger.debug(String.format("Testing %s", persistence.getClass().getSimpleName()));
|
logger.debug(String.format("Testing %s", foundPersistence.getClass().getSimpleName()));
|
||||||
foundPersistence.prepareConnection();
|
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;
|
persistence = foundPersistence;
|
||||||
break;
|
break;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.debug(String.format("%s not initialized correctly. It will not be used", foundPersistence.getClass().getSimpleName()));
|
logger.debug(String.format("%s not initialized correctly. It will not be used", foundPersistence.getClass().getSimpleName()));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(persistence==null){
|
if(persistence==null){
|
||||||
persistence = fallback;
|
persistence = fallback;
|
||||||
}
|
}
|
||||||
//persistence.accountWithFallback(TestUsageRecord.createTestServiceUsageRecord());
|
|
||||||
} catch(Exception e){
|
} catch(Exception e){
|
||||||
logger.error("Unable to instance a Persistence Implementation. Using fallback as default",
|
logger.error("Unable to instance a Persistence Implementation. Using fallback as default",
|
||||||
e.getCause());
|
e.getCause());
|
||||||
|
|
Loading…
Reference in New Issue