test: test compile error

This commit is contained in:
ReaJason
2025-02-26 20:13:53 +08:00
parent 8aa1e1a773
commit 7927611c92
7 changed files with 0 additions and 129 deletions
@@ -1,17 +0,0 @@
import com.googlecode.aviator.AviatorEvaluator;
import com.googlecode.aviator.AviatorEvaluatorInstance;
import org.junit.jupiter.api.Test;
/**
* @author ReaJason
* @since 2025/1/29
*/
class AviatorServletTest {
@Test
void test() {
String exp = "use org.springframework.cglib.core.*;use org.springframework.util.*;ReflectionUtils.invokeMethod(ClassUtils.getMethod(Class.forName('java.lang.Thread'), 'getContextClassLoader', nil), Thread.currentThread())";
AviatorEvaluatorInstance evaluator = AviatorEvaluator.newInstance();
System.out.println(evaluator.execute(exp));
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,18 +0,0 @@
import org.apache.commons.jexl2.Expression;
import org.junit.jupiter.api.Test;
/**
* @author ReaJason
* @since 2025/1/29
*/
class JEXL2ServletTest {
@Test
void test() {
System.out.println(System.getProperty("java.version"));
org.apache.commons.jexl2.JexlEngine jexl = new org.apache.commons.jexl2.JexlEngine();
Expression e = jexl.createExpression("''.getClass().forName('javax.script.ScriptEngineManager').newInstance().getEngineByName('js')");
org.apache.commons.jexl2.MapContext jc = new org.apache.commons.jexl2.MapContext();
System.out.println(e.evaluate(jc));
}
}
@@ -1,18 +0,0 @@
import org.apache.commons.jexl3.*;
import org.junit.jupiter.api.Test;
/**
* @author ReaJason
* @since 2025/1/29
*/
class JEXL3ServletTest {
@Test
void test() {
System.out.println(System.getProperty("java.version"));
JexlEngine jexl = new JexlBuilder().create();
JexlExpression e = jexl.createExpression("''.getClass().forName('javax.script.ScriptEngineManager').newInstance().getEngineByName('js')");
JexlContext jc = new MapContext();
System.out.println(e.evaluate(jc));
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long