Skip to content

Commit edb931b

Browse files
committed
test: add SpringBoot3 Tomcat test cases
1 parent 7597924 commit edb931b

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

integration-test/src/test/java/com/reajason/javaweb/integration/ShellAssertionTool.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.reajason.javaweb.suo5.Suo5Manager;
1010
import lombok.SneakyThrows;
1111
import lombok.extern.slf4j.Slf4j;
12+
import net.bytebuddy.jar.asm.Opcodes;
1213
import okhttp3.HttpUrl;
1314
import okhttp3.OkHttpClient;
1415
import okhttp3.Request;
@@ -230,6 +231,7 @@ public static GenerateResult generate(String urlPattern, Server server, String s
230231
.shellTool(shellTool)
231232
.shellType(shellType)
232233
.targetJreVersion(targetJdkVersion)
234+
.byPassJavaModule(targetJdkVersion >= Opcodes.V9)
233235
.debug(true)
234236
.shrink(true)
235237
.build();

integration-test/src/test/java/com/reajason/javaweb/integration/springmvc/SpringBoot3ContainerTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,22 @@ public static String getUrl(GenericContainer<?> container) {
8080
log.info("container started, app url is : {}", url);
8181
return url;
8282
}
83+
84+
static Stream<Arguments> tomcatCasesProvider() {
85+
Server server = Server.Tomcat;
86+
List<String> supportedShellTypes = List.of(
87+
ShellType.JAKARTA_FILTER,
88+
// ShellType.LISTENER,
89+
ShellType.JAKARTA_VALVE,
90+
ShellType.JAKARTA_WEBSOCKET
91+
);
92+
List<Packers> testPackers = List.of(Packers.Base64);
93+
return TestCasesProvider.getTestCases(imageName, server, supportedShellTypes, testPackers);
94+
}
95+
96+
@ParameterizedTest(name = "{0}|{1}{2}|{3}")
97+
@MethodSource("tomcatCasesProvider")
98+
void testTomcat(String imageName, String shellType, ShellTool shellTool, Packers packer) {
99+
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V17, packer, container, python);
100+
}
83101
}

0 commit comments

Comments
 (0)