From 51a8c73b7b5ac6c290c9f18cf32000013f2c7b61 Mon Sep 17 00:00:00 2001 From: aohana Date: Thu, 19 Sep 2019 16:21:49 +0300 Subject: [PATCH] Test custom comment prefix with one that does not work by default See gh-18285 --- .../quartz/QuartzDataSourceInitializerTests.java | 4 ++-- .../quartz/{tables_h2.sql => tables_**_comments.sql} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/{tables_h2.sql => tables_**_comments.sql} (51%) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzDataSourceInitializerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzDataSourceInitializerTests.java index 4f99845e82e..1a3db88368c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzDataSourceInitializerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzDataSourceInitializerTests.java @@ -50,8 +50,8 @@ public class QuartzDataSourceInitializerTests { @Test public void commentPrefixCanBeCustomized() { this.contextRunner.withUserConfiguration(TestConfiguration.class).withPropertyValues( - "spring.quartz.jdbc.comment-prefix=##", - "spring.quartz.jdbc.schema=classpath:org/springframework/boot/autoconfigure/quartz/tables_@@platform@@.sql") + "spring.quartz.jdbc.comment-prefix=**", + "spring.quartz.jdbc.schema=classpath:org/springframework/boot/autoconfigure/quartz/tables_**_comments.sql") .run((context) -> { JdbcTemplate jdbcTemplate = context.getBean(JdbcTemplate.class); assertThat(jdbcTemplate.queryForObject("SELECT COUNT(*) FROM QRTZ_TEST_TABLE", Integer.class)) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_h2.sql b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_**_comments.sql similarity index 51% rename from spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_h2.sql rename to spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_**_comments.sql index 7df6a7840bc..b9f5428cf2a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_h2.sql +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_**_comments.sql @@ -1,10 +1,10 @@ -## This is a test script to check custom comment prefix is taken into account +** This is a test script to check ** is treated as a comment prefix when prefix is customized CREATE TABLE QRTZ_TEST_TABLE ( SCHED_NAME VARCHAR(120) NOT NULL, CALENDAR_NAME VARCHAR (200) NOT NULL ); -## Another comment +** Another comment COMMIT;