test: use method parameters

This commit is contained in:
ReaJason
2024-12-05 22:40:01 +08:00
parent 3a2e0392da
commit a9ded0670e
12 changed files with 283 additions and 194 deletions
@@ -28,15 +28,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
@Slf4j
public class CommandShellTool {
@Test
@Disabled
void testGenerate() {
String content = generate(Server.TOMCAT, CommandShellConfig.builder().paramName("cmd").build(), TomcatShell.JAKARTA_FILTER, Opcodes.V11, Packer.INSTANCE.ScriptEngine);
System.out.println(content);
}
public static String generate(Server server, CommandShellConfig config, String shellType, int targetJdkVersion, Packer.INSTANCE packer) {
ShellTool shellTool = ShellTool.COMMAND;
ShellTool shellTool = ShellTool.Command;
GenerateResult generateResult = GeneratorMain.generate(server, shellTool, shellType, config, targetJdkVersion);
return new String(packer.getPacker().pack(generateResult));
}