Skip to content

Commit

Permalink
Add a test for running with application plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Pepper Lebeck-Jobe committed Jun 22, 2017
1 parent e9477d0 commit 16d8bb3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/groovy/org/gradle/java/JigsawPluginSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class JigsawPluginSpec extends Specification {
def buildFile = tmpDir.newFile("build.gradle")
buildFile << """
plugins {
id 'application'
id 'org.gradle.java.experimental-jigsaw' version '0.1.0'
}
Expand All @@ -44,6 +45,7 @@ dependencies {
}
javaModule.name = 'test.module'
mainClassName = 'io.example.AClass'
"""
def settingsFile = tmpDir.newFile("settings.gradle")
settingsFile << """
Expand Down Expand Up @@ -121,4 +123,16 @@ public class AClassTest {
then:
result.task(":test").outcome == SUCCESS
}

@IgnoreIf({NOT_JAVA_9})
def "can run with a module"() {
when:
def result = GradleRunner.create()
.withProjectDir(tmpDir.root)
.withArguments("run")
.withPluginClasspath().build()

then:
result.output.contains("Hello World!")
}
}

0 comments on commit 16d8bb3

Please sign in to comment.