Improved test
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/private/luca.frosini/infrastructure-tests@161983 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
53a47e7eb9
commit
92e0101d0f
|
@ -53,7 +53,7 @@ public class PersistenceBackendMonitorTest extends ScopedTest {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}, 3);
|
||||||
|
|
||||||
logger.debug(" START -----------------------------------------------");
|
logger.debug(" START -----------------------------------------------");
|
||||||
logger.debug("Flushing the buffered records");
|
logger.debug("Flushing the buffered records");
|
||||||
|
@ -61,21 +61,32 @@ public class PersistenceBackendMonitorTest extends ScopedTest {
|
||||||
logger.debug(" END -----------------------------------------------");
|
logger.debug(" END -----------------------------------------------");
|
||||||
|
|
||||||
PersistenceBackend persistenceBackend = PersistenceBackendFactory.getPersistenceBackend(ScopedTest.getCurrentContext());
|
PersistenceBackend persistenceBackend = PersistenceBackendFactory.getPersistenceBackend(ScopedTest.getCurrentContext());
|
||||||
persistenceBackend.setFallback((FallbackPersistenceBackend) persistenceBackend);
|
|
||||||
FallbackMonitor temporalDataPersistenceBackendMonitor = new FallbackMonitor(persistenceBackend);
|
|
||||||
|
|
||||||
temporalDataPersistenceBackendMonitor.run();
|
if(persistenceBackend instanceof FallbackPersistenceBackend) {
|
||||||
|
/* This line has no sense in real scenario is only used to avoid null pointer exception in test because
|
||||||
|
* the test has no time to get the real persistence
|
||||||
|
*/
|
||||||
|
persistenceBackend.setFallback((FallbackPersistenceBackend) persistenceBackend);
|
||||||
|
}
|
||||||
|
|
||||||
|
FallbackMonitor fallbackMonitor = new FallbackMonitor(persistenceBackend, false);
|
||||||
|
fallbackMonitor.run();
|
||||||
|
|
||||||
|
logger.debug("{} finished", FallbackMonitor.class.getSimpleName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void singleParsingTest() throws Exception {
|
public void singleParsingTest() throws Exception {
|
||||||
PersistenceBackendFactory.setFallbackLocation(null);
|
PersistenceBackendFactory.setFallbackLocation(null);
|
||||||
PersistenceBackend persistenceBackend = PersistenceBackendFactory.getPersistenceBackend(ScopedTest.getCurrentContext());
|
PersistenceBackend persistenceBackend = PersistenceBackendFactory.getPersistenceBackend(ScopedTest.getCurrentContext());
|
||||||
//persistenceBackend.setFallback((FallbackPersistenceBackend) persistenceBackend);
|
if(persistenceBackend instanceof FallbackPersistenceBackend) {
|
||||||
FallbackMonitor temporalDataPersistenceBackendMonitor = new FallbackMonitor(persistenceBackend);
|
/* This line has no sense in real scenario is only used to avoid null pointer exception in test because
|
||||||
|
* the test has no time to get the real persistence
|
||||||
temporalDataPersistenceBackendMonitor.run();
|
*/
|
||||||
|
persistenceBackend.setFallback((FallbackPersistenceBackend) persistenceBackend);
|
||||||
|
}
|
||||||
|
FallbackMonitor fallbackMonitor = new FallbackMonitor(persistenceBackend);
|
||||||
|
fallbackMonitor.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue