feat: support tomcat upgrade
Dev Deploy / Build Jar (push) Has been cancelled
Dev Deploy / Docker Push (push) Has been cancelled
Dev Deploy / Deploy to Maven Central (push) Has been cancelled
Dev Deploy / Deploy to Northflank (push) Has been cancelled
MemShell IntegrationTest / xxljob (push) Has been cancelled
MemShell IntegrationTest / springwebmvc (push) Has been cancelled
MemShell IntegrationTest / springwebflux (push) Has been cancelled
MemShell IntegrationTest / tomcat (push) Has been cancelled
MemShell IntegrationTest / glassfish (push) Has been cancelled
MemShell IntegrationTest / jbosseap (push) Has been cancelled
MemShell IntegrationTest / jetty (push) Has been cancelled
MemShell IntegrationTest / payara (push) Has been cancelled
MemShell IntegrationTest / wildfly (push) Has been cancelled
MemShell IntegrationTest / jbossas (push) Has been cancelled
MemShell IntegrationTest / resin (push) Has been cancelled
MemShell IntegrationTest / weblogic (push) Has been cancelled
MemShell IntegrationTest / websphere7 (push) Has been cancelled
MemShell IntegrationTest / websphere (push) Has been cancelled
Probe IntegrationTest / springwebmvc (push) Has been cancelled
Probe IntegrationTest / springwebflux (push) Has been cancelled
Probe IntegrationTest / tomcat (push) Has been cancelled
Probe IntegrationTest / glassfish (push) Has been cancelled
Probe IntegrationTest / jbosseap (push) Has been cancelled
Probe IntegrationTest / jetty (push) Has been cancelled
Probe IntegrationTest / payara (push) Has been cancelled
Probe IntegrationTest / wildfly (push) Has been cancelled
Probe IntegrationTest / jbossas (push) Has been cancelled
Probe IntegrationTest / resin (push) Has been cancelled
Probe IntegrationTest / weblogic (push) Has been cancelled
Probe IntegrationTest / websphere7 (push) Has been cancelled
Probe IntegrationTest / websphere (push) Has been cancelled
Unit-Test / UniteTest (push) Has been cancelled

This commit is contained in:
ReaJason
2025-12-06 18:42:46 +08:00
parent 1a35067dd2
commit b42998317a
18 changed files with 418 additions and 1 deletions
@@ -14,6 +14,7 @@ import com.reajason.javaweb.packer.Packers;
import com.reajason.javaweb.packer.jar.*;
import com.reajason.javaweb.packer.translet.XalanAbstractTransletPacker;
import com.reajason.javaweb.suo5.Suo5Manager;
import com.reajason.javaweb.utils.CommonUtil;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import net.bytebuddy.jar.asm.Opcodes;
@@ -206,7 +207,27 @@ public class ShellAssertion {
godzillaIsOk(shellUrl, ((GodzillaConfig) generateResult.getShellToolConfig()));
break;
case Command:
commandIsOk(shellUrl, shellType, ((CommandConfig) generateResult.getShellToolConfig()).getParamName(), "id");
String paramName = ((CommandConfig) generateResult.getShellToolConfig()).getParamName();
if (ShellType.UPGRADE.equals(shellType)) {
String shellClassName = generateResult.getShellClassName();
OkHttpClient okHttpClient = new OkHttpClient();
HttpUrl url = Objects.requireNonNull(HttpUrl.parse(shellUrl))
.newBuilder()
.addQueryParameter(paramName, "id")
.build();
Request request = new Request.Builder()
.header("Connection", "Upgrade")
.header("Upgrade", shellClassName)
.url(url)
.get().build();
try (Response response = okHttpClient.newCall(request).execute()) {
String res = response.body().string();
System.out.println(res.trim());
assertTrue(res.contains("uid="));
}
} else {
commandIsOk(shellUrl, shellType, paramName, "id");
}
break;
case Behinder:
behinderIsOk(shellUrl, ((BehinderConfig) generateResult.getShellToolConfig()));
@@ -60,6 +60,7 @@ public class Tomcat10ContainerTest {
ShellType.JAKARTA_VALVE,
ShellType.JAKARTA_PROXY_VALVE,
ShellType.JAKARTA_WEBSOCKET,
ShellType.UPGRADE,
ShellType.AGENT_FILTER_CHAIN,
ShellType.CATALINA_AGENT_CONTEXT_VALVE
);
@@ -61,6 +61,7 @@ public class Tomcat11ContainerTest {
ShellType.JAKARTA_VALVE,
ShellType.JAKARTA_PROXY_VALVE,
ShellType.JAKARTA_WEBSOCKET,
ShellType.UPGRADE,
ShellType.AGENT_FILTER_CHAIN,
ShellType.CATALINA_AGENT_CONTEXT_VALVE
);
@@ -61,6 +61,7 @@ public class Tomcat8ContainerTest {
ShellType.VALVE,
ShellType.PROXY_VALVE,
ShellType.WEBSOCKET,
ShellType.UPGRADE,
ShellType.AGENT_FILTER_CHAIN,
ShellType.CATALINA_AGENT_CONTEXT_VALVE);
List<Packers> testPackers = List.of(Packers.BigInteger, Packers.AgentJarWithJREAttacher);
@@ -59,6 +59,7 @@ public class Tomcat9ContainerTest {
ShellType.VALVE,
ShellType.PROXY_VALVE,
ShellType.WEBSOCKET,
ShellType.UPGRADE,
ShellType.AGENT_FILTER_CHAIN,
ShellType.CATALINA_AGENT_CONTEXT_VALVE
);