mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
test: fix failed cases
This commit is contained in:
+1
-1
@@ -59,7 +59,7 @@ public class JettyHandlerAgentInjector implements ClassFileTransformer {
|
|||||||
public byte[] transform(final ClassLoader loader, String className, Class<?> classBeingRedefined,
|
public byte[] transform(final ClassLoader loader, String className, Class<?> classBeingRedefined,
|
||||||
ProtectionDomain protectionDomain, byte[] bytes) {
|
ProtectionDomain protectionDomain, byte[] bytes) {
|
||||||
if (TARGET_CLASSES.contains(className)) {
|
if (TARGET_CLASSES.contains(className)) {
|
||||||
String targetMethodName = "";
|
String targetMethodName = "doHandle";
|
||||||
if (className.contains("mortbay")) {
|
if (className.contains("mortbay")) {
|
||||||
targetMethodName = "handle";
|
targetMethodName = "handle";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ dependencies {
|
|||||||
testImplementation(libs.logback.classic)
|
testImplementation(libs.logback.classic)
|
||||||
testRuntimeOnly(libs.junit.platform.launcher)
|
testRuntimeOnly(libs.junit.platform.launcher)
|
||||||
testImplementation(libs.hamcrest)
|
testImplementation(libs.hamcrest)
|
||||||
testImplementation(libs.bundles.testcontainers)
|
testImplementation(libs.bundles.testcontainers) {
|
||||||
|
exclude(group = "net.java.dev.jna", module = "jna")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.test {
|
tasks.test {
|
||||||
|
|||||||
+3
-3
@@ -11,7 +11,7 @@ import org.junit.jupiter.api.AfterAll;
|
|||||||
import org.junit.jupiter.params.ParameterizedTest;
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
import org.junit.jupiter.params.provider.Arguments;
|
import org.junit.jupiter.params.provider.Arguments;
|
||||||
import org.junit.jupiter.params.provider.MethodSource;
|
import org.junit.jupiter.params.provider.MethodSource;
|
||||||
import org.testcontainers.containers.DockerComposeContainer;
|
import org.testcontainers.containers.ComposeContainer;
|
||||||
import org.testcontainers.junit.jupiter.Container;
|
import org.testcontainers.junit.jupiter.Container;
|
||||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||||
|
|
||||||
@@ -33,8 +33,8 @@ public class XxlJob220ContainerTest {
|
|||||||
public static final String imageName = "xxljob/xxljob220";
|
public static final String imageName = "xxljob/xxljob220";
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
public static final DockerComposeContainer<?> compose =
|
public static final ComposeContainer compose =
|
||||||
new DockerComposeContainer<>(new File("docker-compose/xxl-job/docker-compose-220.yaml"))
|
new ComposeContainer(new File("docker-compose/xxl-job/docker-compose-220.yaml"))
|
||||||
.withExposedService("executor", 9999);
|
.withExposedService("executor", 9999);
|
||||||
|
|
||||||
static Stream<Arguments> casesProvider() {
|
static Stream<Arguments> casesProvider() {
|
||||||
|
|||||||
+3
-3
@@ -11,7 +11,7 @@ import org.junit.jupiter.api.AfterAll;
|
|||||||
import org.junit.jupiter.params.ParameterizedTest;
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
import org.junit.jupiter.params.provider.Arguments;
|
import org.junit.jupiter.params.provider.Arguments;
|
||||||
import org.junit.jupiter.params.provider.MethodSource;
|
import org.junit.jupiter.params.provider.MethodSource;
|
||||||
import org.testcontainers.containers.DockerComposeContainer;
|
import org.testcontainers.containers.ComposeContainer;
|
||||||
import org.testcontainers.junit.jupiter.Container;
|
import org.testcontainers.junit.jupiter.Container;
|
||||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||||
|
|
||||||
@@ -33,8 +33,8 @@ public class XxlJob230ContainerTest {
|
|||||||
public static final String imageName = "xxljob/xxljob230";
|
public static final String imageName = "xxljob/xxljob230";
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
public static final DockerComposeContainer<?> compose =
|
public static final ComposeContainer compose =
|
||||||
new DockerComposeContainer<>(new File("docker-compose/xxl-job/docker-compose-230.yaml"))
|
new ComposeContainer(new File("docker-compose/xxl-job/docker-compose-230.yaml"))
|
||||||
.withExposedService("executor", 9999);
|
.withExposedService("executor", 9999);
|
||||||
|
|
||||||
static Stream<Arguments> casesProvider() {
|
static Stream<Arguments> casesProvider() {
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ public class Jetty12ee10ContainerTest {
|
|||||||
void testJDK() {
|
void testJDK() {
|
||||||
String url = getUrl(container);
|
String url = getUrl(container);
|
||||||
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
|
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
|
||||||
assertEquals("JRE|21.0.7|65", data);
|
assertEquals("JRE|21.0.9|65", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ public class Jetty12ee8ContainerTest {
|
|||||||
void testJDK() {
|
void testJDK() {
|
||||||
String url = getUrl(container);
|
String url = getUrl(container);
|
||||||
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
|
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
|
||||||
assertEquals("JRE|21.0.7|65", data);
|
assertEquals("JRE|21.0.9|65", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ public class Jetty12ee9ContainerTest {
|
|||||||
void testJDK() {
|
void testJDK() {
|
||||||
String url = getUrl(container);
|
String url = getUrl(container);
|
||||||
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
|
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
|
||||||
assertEquals("JRE|21.0.7|65", data);
|
assertEquals("JRE|21.0.9|65", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ public class SpringBoot2WebFluxContainerTest {
|
|||||||
void testJDK() {
|
void testJDK() {
|
||||||
String url = getUrlFromSpringBoot(container);
|
String url = getUrlFromSpringBoot(container);
|
||||||
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
|
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
|
||||||
assertEquals("JDK|1.8.0_342|52", data);
|
assertEquals("JDK|1.8.0_472|52", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ public class SpringBoot3WebFluxContainerTest {
|
|||||||
void testJDK() {
|
void testJDK() {
|
||||||
String url = getUrlFromSpringBoot(container);
|
String url = getUrlFromSpringBoot(container);
|
||||||
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
|
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
|
||||||
assertEquals("JDK|17.0.2|61", data);
|
assertEquals("JDK|17.0.17|61", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user