Class GameTestConfiguration
java.lang.Object
org.spongepowered.gradle.plugin.config.GameTestConfiguration
Runs the plugin's gametests, the
@GameTest methods under src/test, through the test task:
the platform's gametest module is added to the test classpath, the Sponge runtime boots in the test JVM before
JUnit discovers anything, and the plugin's own output is handed to it to load. Every value has a working default.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.gradle.api.provider.Property<Boolean>Whether thetesttask runs gametests;sponge.gameTests { }turns it on.org.gradle.api.provider.SetProperty<String>Modules of the test 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 test 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<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) voidvoidvoidvoid
-
Constructor Details
-
GameTestConfiguration
@Inject public GameTestConfiguration(org.gradle.api.model.ObjectFactory factory)
-
-
Method Details
-
getEnabled
Whether thetesttask runs gametests;sponge.gameTests { }turns it on. -
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 test 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 test 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 test 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.
-