2
0
Fork 0
mirror of https://github.com/ethauvin/rife2.git synced 2025-05-01 02:58:12 -07:00

Added sleeps in template tests with db resource finders to ensure that changes are detected.

This commit is contained in:
Geert Bevin 2023-01-16 16:18:57 -05:00
parent e6c7cf582f
commit 1c6f187b47

View file

@ -1370,6 +1370,13 @@ public class TestTemplateFactory {
"a block with value 3" +
"a block with value 4", template.getContent());
// wait a second
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
fail(ExceptionUtils.getExceptionStackTrace(e));
}
resources.updateResource("db_template_name.txt", "{{b block1}}another block with value {{v value1/}}{{/b}}{{v value3/}}");
template = factory.get("db_template_name");
@ -1399,7 +1406,7 @@ public class TestTemplateFactory {
@ParameterizedTest
@ArgumentsSource(TestDatasources.class)
public void testOtherResourceFinderCommonFactory(Datasource datasource) {
public void testOtherResourceFinderCommonFactory(Datasource datasource) throws Exception {
var resources = DatabaseResourcesFactory.instance(datasource);
var previous = TemplateFactory.HTML.getResourceFinder();
TemplateFactory.HTML.setResourceFinder(resources);
@ -1424,6 +1431,13 @@ public class TestTemplateFactory {
"a block with value 3" +
"a block with value 4", template.getContent());
// wait a second
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
fail(ExceptionUtils.getExceptionStackTrace(e));
}
resources.updateResource("db_template_name.html", "<!--b block1-->another block with value <!--v value1/--><!--/b--><!--v value3/-->");
template = TemplateFactory.HTML.get("db_template_name");