Remove testing support from the CLI

The testing support in the CLI has proven to be more trouble than
it's worth. Our recommendation is that, once an app gets to the stage
of requiring a test suite, it should be converted to a Maven or
Gradle project. This makes it easy to version, publish, deploy etc
using the vast ecosystems of the two build systems.

As part of this change, the dependency management for Spock has been
moved into spring-boot-parent, thereby making it "private". This
allows it to continue to manage the test-only Spock dependency in
spring-boot-test without also managing the version of Spring that is
used by a user's application.

Closes gh-9087
Fixes gh-9043
This commit is contained in:
Andy Wilkinson
2017-05-04 08:52:55 +01:00
parent acda8e647b
commit 329a950bd8
17 changed files with 28 additions and 700 deletions

View File

@@ -252,41 +252,6 @@ http://platform.spring.io/[Spring IO Platform], e.g.
[[cli-testing]]
=== Testing your code
The `test` command allows you to compile and run tests for your application. Typical
usage looks like this:
[indent=0]
----
$ spring test app.groovy tests.groovy
Total: 1, Success: 1, : Failures: 0
Passed? true
----
In this example, `tests.groovy` contains JUnit `@Test` methods or Spock `Specification`
classes. All the common framework annotations and static methods should be available to
you without having to `import` them.
Here is the `tests.groovy` file that we used above (with a JUnit test):
[source,groovy,indent=0]
----
class ApplicationTests {
@Test
void homeSaysHello() {
assertEquals("Hello World!", new WebApplication().home())
}
}
----
TIP: If you have more than one test source files, you might prefer to organize them
into a `test` directory.
[[cli-multiple-source-files]]
=== Applications with multiple source files
You can use "`shell globbing`" with all commands that accept file input. This allows you
@@ -297,14 +262,6 @@ to easily use multiple files from a single directory, e.g.
$ spring run *.groovy
----
This technique can also be useful if you want to segregate your "`test`" or "`spec`" code
from the main application code:
[indent=0]
----
$ spring test app/*.groovy test/*.groovy
----
[[cli-jar]]