From 386a0948b4a019d37a2f4dfc003369614b3c0d23 Mon Sep 17 00:00:00 2001 From: noear Date: Mon, 15 May 2023 14:08:36 +0800 Subject: [PATCH] =?UTF-8?q?solon=20=E5=8D=87=E4=B8=BA=202.2.19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- src/test/java/com/cym/TestUtils.java | 41 +++++++++++++++++----------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index f378a498..4cd7663e 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.noear solon-parent - 2.2.14 + 2.2.19 diff --git a/src/test/java/com/cym/TestUtils.java b/src/test/java/com/cym/TestUtils.java index 5d090ffd..50b9eb12 100644 --- a/src/test/java/com/cym/TestUtils.java +++ b/src/test/java/com/cym/TestUtils.java @@ -1,29 +1,38 @@ package com.cym; +import java.io.IOException; import java.util.HashMap; import java.util.Map; -import cn.hutool.core.io.FileUtil; -import cn.hutool.http.HttpUtil; - -public class TestUtils { - - public static void main(String[] args) { - - String pass = "abcde12345"; - for (int i = 0; i < 100000; i++) { - pass += "abcde12345"; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.noear.solon.test.HttpTester; +import org.noear.solon.test.SolonJUnit4ClassRunner; +import org.noear.solon.test.SolonTest; + +@RunWith(SolonJUnit4ClassRunner.class) +@SolonTest(NginxWebUI.class) +public class TestUtils extends HttpTester { + @Test + public void test() throws Exception { + + StringBuilder pass = new StringBuilder(1000); + for (int i = 0; i < 2000000; i++) { + pass.append("abcde12345"); } - - FileUtil.writeString(pass, "d:\\1.txt", "UTF-8"); Map map = new HashMap<>(); map.put("name", "admin"); - map.put("pass", pass); + map.put("pass", pass.toString()); - String rs = HttpUtil.post("http://127.0.0.1:8080/adminPage/login/login", map); + System.out.println("pass.length: " + pass.length()); - System.err.println(rs); + try { + String rs = path("/adminPage/login/login").data(map).post(); + System.err.println(rs); + assert false; + } catch (IOException e) { + assert true; + } } - } -- Gitee