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:
parent
e6c7cf582f
commit
1c6f187b47
1 changed files with 15 additions and 1 deletions
|
@ -1370,6 +1370,13 @@ public class TestTemplateFactory {
|
||||||
"a block with value 3" +
|
"a block with value 3" +
|
||||||
"a block with value 4", template.getContent());
|
"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/}}");
|
resources.updateResource("db_template_name.txt", "{{b block1}}another block with value {{v value1/}}{{/b}}{{v value3/}}");
|
||||||
|
|
||||||
template = factory.get("db_template_name");
|
template = factory.get("db_template_name");
|
||||||
|
@ -1399,7 +1406,7 @@ public class TestTemplateFactory {
|
||||||
|
|
||||||
@ParameterizedTest
|
@ParameterizedTest
|
||||||
@ArgumentsSource(TestDatasources.class)
|
@ArgumentsSource(TestDatasources.class)
|
||||||
public void testOtherResourceFinderCommonFactory(Datasource datasource) {
|
public void testOtherResourceFinderCommonFactory(Datasource datasource) throws Exception {
|
||||||
var resources = DatabaseResourcesFactory.instance(datasource);
|
var resources = DatabaseResourcesFactory.instance(datasource);
|
||||||
var previous = TemplateFactory.HTML.getResourceFinder();
|
var previous = TemplateFactory.HTML.getResourceFinder();
|
||||||
TemplateFactory.HTML.setResourceFinder(resources);
|
TemplateFactory.HTML.setResourceFinder(resources);
|
||||||
|
@ -1424,6 +1431,13 @@ public class TestTemplateFactory {
|
||||||
"a block with value 3" +
|
"a block with value 3" +
|
||||||
"a block with value 4", template.getContent());
|
"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/-->");
|
resources.updateResource("db_template_name.html", "<!--b block1-->another block with value <!--v value1/--><!--/b--><!--v value3/-->");
|
||||||
|
|
||||||
template = TemplateFactory.HTML.get("db_template_name");
|
template = TemplateFactory.HTML.get("db_template_name");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue