Class GameTestConfiguration

java.lang.Object
org.spongepowered.gradle.plugin.config.GameTestConfiguration

public abstract class GameTestConfiguration extends Object
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
    Constructor
    Description
    GameTestConfiguration(org.gradle.api.model.ObjectFactory factory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    exclude(String... modules)
     
    org.gradle.api.provider.Property<Boolean>
    Whether the test task runs gametests; sponge.gameTests { } turns it on.
    org.gradle.api.provider.SetProperty<String>
    Modules of the test runtime classpath kept out of the libraries, as group:module or a whole group: 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.ConfigurableFileCollection
    What Sponge loads beside the plugin as game-layer libraries, each its own module.
    org.gradle.api.file.ConfigurableFileCollection
    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.
    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.DirectoryProperty
    Where the game test server runs; build/gametest-run by default, with the EULA accepted.
    void
    launchTarget(String launchTarget)
     
    void
    libraries(Object... paths)
     
    void
    plugin(Object... paths)
     
    void
    pluginId(String pluginId)
     
    void
    version(String version)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GameTestConfiguration

      @Inject public GameTestConfiguration(org.gradle.api.model.ObjectFactory factory)
  • Method Details

    • getEnabled

      public org.gradle.api.provider.Property<Boolean> getEnabled()
      Whether the test task runs gametests; sponge.gameTests { } turns it on.
    • getVersion

      public org.gradle.api.provider.Property<String> getVersion()
      The version of the platform's gametest module, org.spongepowered:<platform>-gametest. Defaults to the version of the Sponge runtime runServer resolves, so the two always match.
    • version

      public void version(String version)
    • getLaunchTarget

      public org.gradle.api.provider.Property<String> getLaunchTarget()
      The launch target the Sponge runtime boots with; the headless game test server by default.
    • launchTarget

      public void launchTarget(String launchTarget)
    • getPluginId

      public org.gradle.api.provider.Property<String> 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

      public void pluginId(String 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

      public void plugin(Object... paths)
    • 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

      public void libraries(Object... paths)
    • getExcludes

      public org.gradle.api.provider.SetProperty<String> getExcludes()
      Modules of the test runtime classpath kept out of the libraries, as group:module or a whole group: what another platform's module brings along, or a test-only dependency the game should not see.
    • exclude

      public void exclude(String... modules)
    • getWorkingDirectory

      public org.gradle.api.file.DirectoryProperty getWorkingDirectory()
      Where the game test server runs; build/gametest-run by default, with the EULA accepted.