From 8a2a463d46b3dce73015462c9f6a2a258dd25f5b Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期五, 25 二月 2022 11:40:11 +0800
Subject: [PATCH] 优化diamante
---
java110-core/src/test/java/com/java110/AppTest.java | 47 +++++++++++++++++++++++++++++++++++------------
1 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/java110-core/src/test/java/com/java110/AppTest.java b/java110-core/src/test/java/com/java110/AppTest.java
old mode 100644
new mode 100755
index f007402..44c3760
--- a/java110-core/src/test/java/com/java110/AppTest.java
+++ b/java110-core/src/test/java/com/java110/AppTest.java
@@ -3,36 +3,59 @@
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.ibatis.ognl.Ognl;
+import org.apache.ibatis.ognl.OgnlContext;
+
+import java.util.HashMap;
+import java.util.Map;
/**
* Unit test for simple App.
*/
-public class AppTest
- extends TestCase
-{
+public class AppTest
+ extends TestCase {
/**
* Create the test case
*
* @param testName name of the test case
*/
- public AppTest( String testName )
- {
- super( testName );
+ public AppTest(String testName) {
+ super(testName);
}
/**
* @return the suite of tests being tested
*/
- public static Test suite()
- {
- return new TestSuite( AppTest.class );
+ public static Test suite() {
+ return new TestSuite(AppTest.class);
}
/**
* Rigourous Test :-)
*/
- public void testApp()
- {
- assertTrue( true );
+ public void testApp() {
+ assertTrue(true);
+ }
+
+ public void testOgnl() throws Exception{
+
+ //鍒涘缓涓�涓狾gnl涓婁笅鏂囧璞�
+ OgnlContext context = new OgnlContext();
+
+ Map user = new HashMap();
+ user.put("id", "123213");
+ user.put("name", "寮犱笁");
+
+ context.putAll(user);
+
+ Object node = Ognl.parseExpression("id != null and name != null");
+
+ Object value = Ognl.getValue(node,context);
+
+ System.out.printf("value : " + value);
+
+
+
+
}
}
--
Gitblit v1.8.0