2727import org .junit .Test ;
2828import org .junit .runner .RunWith ;
2929
30+ import org .springframework .boot .gradle .junit .GradleMultiDslSuite ;
31+ import org .springframework .boot .gradle .testkit .Dsl ;
3032import org .springframework .boot .gradle .testkit .GradleBuild ;
3133import org .springframework .util .FileCopyUtils ;
3234
@@ -44,18 +46,17 @@ public class PackagingDocumentationTests {
4446 @ Rule
4547 public GradleBuild gradleBuild ;
4648
47- public DSL dsl ;
49+ public Dsl dsl ;
4850
4951 @ Test
5052 public void warContainerDependencyEvaluatesSuccessfully () {
51- this .gradleBuild .script ("src/main/gradle/packaging/war-container-dependency"
52- + this . dsl . getExtension ()) .build ();
53+ this .gradleBuild .script ("src/main/gradle/packaging/war-container-dependency" )
54+ .build ();
5355 }
5456
5557 @ Test
5658 public void bootJarMainClass () throws IOException {
57- this .gradleBuild .script (
58- "src/main/gradle/packaging/boot-jar-main-class" + this .dsl .getExtension ())
59+ this .gradleBuild .script ("src/main/gradle/packaging/boot-jar-main-class" )
5960 .build ("bootJar" );
6061 File file = new File (this .gradleBuild .getProjectDir (),
6162 "build/libs/" + this .gradleBuild .getProjectDir ().getName () + ".jar" );
@@ -68,8 +69,8 @@ public void bootJarMainClass() throws IOException {
6869
6970 @ Test
7071 public void bootJarManifestMainClass () throws IOException {
71- this .gradleBuild .script ("src/main/gradle/packaging/boot-jar-manifest-main-class"
72- + this . dsl . getExtension ()) .build ("bootJar" );
72+ this .gradleBuild .script ("src/main/gradle/packaging/boot-jar-manifest-main-class" )
73+ .build ("bootJar" );
7374 File file = new File (this .gradleBuild .getProjectDir (),
7475 "build/libs/" + this .gradleBuild .getProjectDir ().getName () + ".jar" );
7576 assertThat (file ).isFile ();
@@ -81,8 +82,8 @@ public void bootJarManifestMainClass() throws IOException {
8182
8283 @ Test
8384 public void applicationPluginMainClass () throws IOException {
84- this .gradleBuild .script ("src/main/gradle/packaging/application-plugin-main-class"
85- + this . dsl . getExtension ()) .build ("bootJar" );
85+ this .gradleBuild .script ("src/main/gradle/packaging/application-plugin-main-class" )
86+ .build ("bootJar" );
8687 File file = new File (this .gradleBuild .getProjectDir (),
8788 "build/libs/" + this .gradleBuild .getProjectDir ().getName () + ".jar" );
8889 assertThat (file ).isFile ();
@@ -94,8 +95,8 @@ public void applicationPluginMainClass() throws IOException {
9495
9596 @ Test
9697 public void springBootDslMainClass () throws IOException {
97- this .gradleBuild .script ("src/main/gradle/packaging/spring-boot-dsl-main-class"
98- + this . dsl . getExtension ()) .build ("bootJar" );
98+ this .gradleBuild .script ("src/main/gradle/packaging/spring-boot-dsl-main-class" )
99+ .build ("bootJar" );
99100 File file = new File (this .gradleBuild .getProjectDir (),
100101 "build/libs/" + this .gradleBuild .getProjectDir ().getName () + ".jar" );
101102 assertThat (file ).isFile ();
@@ -109,8 +110,8 @@ public void springBootDslMainClass() throws IOException {
109110 public void bootWarIncludeDevtools () throws IOException {
110111 new File (this .gradleBuild .getProjectDir (),
111112 "spring-boot-devtools-1.2.3.RELEASE.jar" ).createNewFile ();
112- this .gradleBuild .script ("src/main/gradle/packaging/boot-war-include-devtools"
113- + this . dsl . getExtension ()) .build ("bootWar" );
113+ this .gradleBuild .script ("src/main/gradle/packaging/boot-war-include-devtools" )
114+ .build ("bootWar" );
114115 File file = new File (this .gradleBuild .getProjectDir (),
115116 "build/libs/" + this .gradleBuild .getProjectDir ().getName () + ".war" );
116117 assertThat (file ).isFile ();
@@ -122,8 +123,8 @@ public void bootWarIncludeDevtools() throws IOException {
122123
123124 @ Test
124125 public void bootJarRequiresUnpack () throws IOException {
125- this .gradleBuild .script ("src/main/gradle/packaging/boot-jar-requires-unpack"
126- + this . dsl . getExtension ()) .build ("bootJar" );
126+ this .gradleBuild .script ("src/main/gradle/packaging/boot-jar-requires-unpack" )
127+ .build ("bootJar" );
127128 File file = new File (this .gradleBuild .getProjectDir (),
128129 "build/libs/" + this .gradleBuild .getProjectDir ().getName () + ".jar" );
129130 assertThat (file ).isFile ();
@@ -136,8 +137,9 @@ public void bootJarRequiresUnpack() throws IOException {
136137
137138 @ Test
138139 public void bootJarIncludeLaunchScript () throws IOException {
139- this .gradleBuild .script ("src/main/gradle/packaging/boot-jar-include-launch-script"
140- + this .dsl .getExtension ()).build ("bootJar" );
140+ this .gradleBuild
141+ .script ("src/main/gradle/packaging/boot-jar-include-launch-script" )
142+ .build ("bootJar" );
141143 File file = new File (this .gradleBuild .getProjectDir (),
142144 "build/libs/" + this .gradleBuild .getProjectDir ().getName () + ".jar" );
143145 assertThat (file ).isFile ();
@@ -148,8 +150,7 @@ public void bootJarIncludeLaunchScript() throws IOException {
148150 @ Test
149151 public void bootJarLaunchScriptProperties () throws IOException {
150152 this .gradleBuild
151- .script ("src/main/gradle/packaging/boot-jar-launch-script-properties"
152- + this .dsl .getExtension ())
153+ .script ("src/main/gradle/packaging/boot-jar-launch-script-properties" )
153154 .build ("bootJar" );
154155 File file = new File (this .gradleBuild .getProjectDir (),
155156 "build/libs/" + this .gradleBuild .getProjectDir ().getName () + ".jar" );
@@ -164,8 +165,8 @@ public void bootJarCustomLaunchScript() throws IOException {
164165 "src/custom.script" );
165166 customScriptFile .getParentFile ().mkdirs ();
166167 FileCopyUtils .copy ("custom" , new FileWriter (customScriptFile ));
167- this .gradleBuild .script ("src/main/gradle/packaging/boot-jar-custom-launch-script"
168- + this . dsl . getExtension ()) .build ("bootJar" );
168+ this .gradleBuild .script ("src/main/gradle/packaging/boot-jar-custom-launch-script" )
169+ .build ("bootJar" );
169170 File file = new File (this .gradleBuild .getProjectDir (),
170171 "build/libs/" + this .gradleBuild .getProjectDir ().getName () + ".jar" );
171172 assertThat (file ).isFile ();
@@ -174,8 +175,8 @@ public void bootJarCustomLaunchScript() throws IOException {
174175
175176 @ Test
176177 public void bootWarPropertiesLauncher () throws IOException {
177- this .gradleBuild .script ("src/main/gradle/packaging/boot-war-properties-launcher"
178- + this . dsl . getExtension ()) .build ("bootWar" );
178+ this .gradleBuild .script ("src/main/gradle/packaging/boot-war-properties-launcher" )
179+ .build ("bootWar" );
179180 File file = new File (this .gradleBuild .getProjectDir (),
180181 "build/libs/" + this .gradleBuild .getProjectDir ().getName () + ".war" );
181182 assertThat (file ).isFile ();
@@ -187,8 +188,7 @@ public void bootWarPropertiesLauncher() throws IOException {
187188
188189 @ Test
189190 public void bootJarAndJar () {
190- this .gradleBuild .script (
191- "src/main/gradle/packaging/boot-jar-and-jar" + this .dsl .getExtension ())
191+ this .gradleBuild .script ("src/main/gradle/packaging/boot-jar-and-jar" )
192192 .build ("assemble" );
193193 File jar = new File (this .gradleBuild .getProjectDir (),
194194 "build/libs/" + this .gradleBuild .getProjectDir ().getName () + ".jar" );
0 commit comments