|
22 | 22 | import static org.assertj.core.api.Assertions.assertThat;
|
23 | 23 |
|
24 | 24 | /**
|
25 |
| - * Integration tests of Spring Boot's launch script with launching via shell. |
| 25 | + * Integration tests of Spring Boot's launch script when executing the jar directly. |
26 | 26 | *
|
27 | 27 | * @author Alexey Vinogradov
|
| 28 | + * @author Andy Wilkinson |
28 | 29 | */
|
29 |
| -class ShellLaunchScriptIT extends AbstractLaunchScriptIT { |
| 30 | +class JarLaunchScriptIT extends AbstractLaunchScriptIT { |
| 31 | + |
| 32 | + JarLaunchScriptIT() { |
| 33 | + super("jar/"); |
| 34 | + } |
30 | 35 |
|
31 | 36 | @ParameterizedTest(name = "{0} {1}")
|
32 | 37 | @MethodSource("parameters")
|
33 | 38 | void basicLaunch(String os, String version) throws Exception {
|
34 |
| - doLaunch(os, version, "jar/basic-launch.sh"); |
| 39 | + doLaunch(os, version, "basic-launch.sh"); |
35 | 40 | }
|
36 | 41 |
|
37 | 42 | @ParameterizedTest(name = "{0} {1}")
|
38 | 43 | @MethodSource("parameters")
|
39 | 44 | void launchWithDebugEnv(String os, String version) throws Exception {
|
40 |
| - final String output = doTest(os, version, "jar/launch-with-debug.sh"); |
| 45 | + final String output = doTest(os, version, "launch-with-debug.sh"); |
41 | 46 | assertThat(output).contains("++ pwd");
|
42 | 47 | }
|
43 | 48 |
|
44 | 49 | @ParameterizedTest(name = "{0} {1}")
|
45 | 50 | @MethodSource("parameters")
|
46 | 51 | void launchWithDifferentJarFileEnv(String os, String version) throws Exception {
|
47 |
| - final String output = doTest(os, version, "jar/launch-with-jarfile.sh"); |
| 52 | + final String output = doTest(os, version, "launch-with-jarfile.sh"); |
48 | 53 | assertThat(output).contains("app-another.jar");
|
49 | 54 | assertThat(output).doesNotContain("spring-boot-launch-script-tests.jar");
|
50 | 55 | }
|
51 | 56 |
|
52 | 57 | @ParameterizedTest(name = "{0} {1}")
|
53 | 58 | @MethodSource("parameters")
|
54 |
| - void launchWithDifferentAppName(String os, String version) throws Exception { |
55 |
| - final String output = doTest(os, version, "jar/launch-with-app-name.sh"); |
56 |
| - assertThat(output).contains("All tests are passed."); |
| 59 | + void launchWithSingleCommandLineArgument(String os, String version) throws Exception { |
| 60 | + doLaunch(os, version, "launch-with-single-command-line-argument.sh"); |
| 61 | + } |
| 62 | + |
| 63 | + @ParameterizedTest(name = "{0} {1}") |
| 64 | + @MethodSource("parameters") |
| 65 | + void launchWithMultipleCommandLineArguments(String os, String version) throws Exception { |
| 66 | + doLaunch(os, version, "launch-with-multiple-command-line-arguments.sh"); |
| 67 | + } |
| 68 | + |
| 69 | + @ParameterizedTest(name = "{0} {1}") |
| 70 | + @MethodSource("parameters") |
| 71 | + void launchWithSingleRunArg(String os, String version) throws Exception { |
| 72 | + doLaunch(os, version, "launch-with-single-run-arg.sh"); |
| 73 | + } |
| 74 | + |
| 75 | + @ParameterizedTest(name = "{0} {1}") |
| 76 | + @MethodSource("parameters") |
| 77 | + void launchWithMultipleRunArgs(String os, String version) throws Exception { |
| 78 | + doLaunch(os, version, "launch-with-multiple-run-args.sh"); |
| 79 | + } |
| 80 | + |
| 81 | + @ParameterizedTest(name = "{0} {1}") |
| 82 | + @MethodSource("parameters") |
| 83 | + void launchWithSingleJavaOpt(String os, String version) throws Exception { |
| 84 | + doLaunch(os, version, "launch-with-single-java-opt.sh"); |
57 | 85 | }
|
58 | 86 |
|
59 | 87 | @ParameterizedTest(name = "{0} {1}")
|
60 | 88 | @MethodSource("parameters")
|
61 |
| - void launchInInitdDir(String os, String version) throws Exception { |
62 |
| - final String output = doTest(os, version, "jar/launch-in-init.d-dir.sh"); |
63 |
| - assertThat(output).contains("Usage: ./some_app {start|stop|force-stop|restart|force-reload|status|run}"); |
| 89 | + void launchWithMultipleJavaOpts(String os, String version) throws Exception { |
| 90 | + doLaunch(os, version, "launch-with-multiple-java-opts.sh"); |
64 | 91 | }
|
65 | 92 |
|
66 | 93 | }
|
0 commit comments