Skip to content

Commit be6bdb0

Browse files
committed
HBX-3080: Refactor the Gradle integration tests to factor out common code
- Make 'RunSqlTest' extend 'TestTemplate' - Rewrite 'RunSqlTest#testRunSql()' to account for new superclass Signed-off-by: Koen Aers <[email protected]>
1 parent 3ecb2bc commit be6bdb0

File tree

1 file changed

+5
-6
lines changed
  • gradle/plugin/src/functionalTest/java/org/hibernate/tool/gradle

1 file changed

+5
-6
lines changed

gradle/plugin/src/functionalTest/java/org/hibernate/tool/gradle/RunSqlTest.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,18 @@
2727

2828
class RunSqlTest extends TestTemplate {
2929

30-
private static final String HIBERNATE_TOOLS_EXTENSION_SECTION =
31-
"hibernateTools {\n" +
32-
" sqlToRun = 'create table foo (id int not null primary key, baz varchar(256))'\n" +
33-
"}\n";
34-
3530
@BeforeEach
3631
public void beforeEach() {
3732
setGradleTaskToPerform("runSql");
3833
}
3934

4035
@Test
4136
void testRunSql() throws Exception {
42-
setHibernateToolsExtensionSection(HIBERNATE_TOOLS_EXTENSION_SECTION);
37+
setHibernateToolsExtensionSection(
38+
"hibernateTools {\n" +
39+
" sqlToRun = 'create table foo (id int not null primary key, baz varchar(256))'\n" +
40+
"}\n"
41+
);
4342
assertNull(getDatabaseFile());
4443
createProjectAndExecuteGradleCommand();
4544
assertTrue(getBuildResult().getOutput().contains("Running SQL: create table foo (id int not null primary key, baz varchar(256))"));

0 commit comments

Comments
 (0)