Class GameTestConfiguration
java.lang.Object
org.spongepowered.gradle.plugin.config.GameTestConfiguration
Runs the plugin's gametests, the
@GameTest methods under src/gametest, through the gametest test
suite and its task, or another one, see getSuite(): the platform's gametest module is added to the suite's
classpath, the Sponge runtime boots in its JVM before JUnit discovers anything, and the plugin's own output is handed to
it to load. Unless gametests are put in test, it is left alone, so unit tests run without a game. Every value
has a working default.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.gradle.api.provider.Property<Boolean>Whether thegametestsuite is set up;sponge.gameTests { }turns it on.org.gradle.api.provider.SetProperty<String>Modules of the gametest runtime classpath kept out of the libraries, asgroup:moduleor a wholegroup: what another platform's module brings along, or a test-only dependency the game should not see.org.gradle.api.provider.Property<String>The launch target the Sponge runtime boots with; the headless game test server by default.org.gradle.api.file.ConfigurableFileCollectionWhat Sponge loads beside the plugin as game-layer libraries, each its own module.org.gradle.api.file.ConfigurableFileCollectionWhat Sponge loads as the plugin under test, as one plugin resource: by default the main and gametest outputs and the jars of the projects this one depends on, a multi-module plugin's other parts.org.gradle.api.provider.Property<String>The plugin the tests belong to, which prefixes their names:<plugin id>.<group>.<method_name>.org.gradle.api.provider.Property<Boolean>Whether failing gametests fail the build, the default.org.gradle.api.provider.Property<String>getSuite()The JVM test suite the gametests run in, with its source set and task of the same name;gametestby default.org.gradle.api.provider.Property<String>The version of the platform's gametest module,org.spongepowered:<platform>-gametest.org.gradle.api.file.DirectoryPropertyWhere the game test server runs;build/gametest-runby default, with the EULA accepted.voidlaunchTarget(String launchTarget) voidvoidvoidvoidrequired(boolean required) voidvoid
-
Constructor Details
-
GameTestConfiguration
@Inject public GameTestConfiguration(org.gradle.api.model.ObjectFactory factory)
-
-
Method Details
-
getEnabled
Whether thegametestsuite is set up;sponge.gameTests { }turns it on. -
getRequired
Whether failing gametests fail the build, the default. Thegametesttask always runs as part ofcheck;required(false)makes it an optional check, whose failures are reported without failing the build. -
required
public void required(boolean required) -
getSuite
The JVM test suite the gametests run in, with its source set and task of the same name;gametestby default. A suite of that name that exists already is used as it is, astestis withsuite("test"), which runs the gametests insrc/testthrough thetesttask alongside any unit tests. Otherwise the plugin creates it, on top of the plugin's own classes and dependencies, oncesponge.gameTestsis configured. -
suite
-
getVersion
The version of the platform's gametest module,org.spongepowered:<platform>-gametest. Defaults to the version of the Sponge runtimerunServerresolves, so the two always match. -
version
-
getLaunchTarget
The launch target the Sponge runtime boots with; the headless game test server by default. -
launchTarget
-
getPluginId
The plugin the tests belong to, which prefixes their names:<plugin id>.<group>.<method_name>. Defaults to the plugin this project declares, when it declares exactly one; a module whose metadata another module writes names it here. -
pluginId
-
getPluginFiles
public org.gradle.api.file.ConfigurableFileCollection getPluginFiles()What Sponge loads as the plugin under test, as one plugin resource: by default the main and gametest outputs and the jars of the projects this one depends on, a multi-module plugin's other parts. A built jar can stand in, e.g.plugin(tasks.named("shadowJar")). Jars are listed before directories, since Sponge reads the manifest from the last path. -
plugin
-
getLibraries
public org.gradle.api.file.ConfigurableFileCollection getLibraries()What Sponge loads beside the plugin as game-layer libraries, each its own module. The modules on the gametest runtime classpath are there by default, less JUnit and anything the game loads itself: Minecraft and the API with their dependencies, and the libraries the Sponge runtime installs.libraries(...)adds to that: a file dependency, a configuration, a task's jar. -
libraries
-
getExcludes
Modules of the gametest runtime classpath kept out of the libraries, asgroup:moduleor a wholegroup: what another platform's module brings along, or a test-only dependency the game should not see. -
exclude
-
getWorkingDirectory
public org.gradle.api.file.DirectoryProperty getWorkingDirectory()Where the game test server runs;build/gametest-runby default, with the EULA accepted.
-