From 4e4aeead8e35825be5890f978b152f89bf1f3e66 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Thu, 21 Oct 2021 20:30:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B5=8B=E8=AF=95=E6=A1=88?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alibaba/easyexcel/test/core/large/LargeDataTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java b/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java index 15720c3f..3da8500d 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java @@ -14,6 +14,7 @@ import org.apache.poi.xssf.streaming.SXSSFCell; import org.apache.poi.xssf.streaming.SXSSFRow; import org.apache.poi.xssf.streaming.SXSSFSheet; import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.junit.Assert; import org.junit.BeforeClass; import org.junit.FixMethodOrder; import org.junit.Test; @@ -92,7 +93,8 @@ public class LargeDataTest { LOGGER.info("{} write success.", j); } excelWriter.finish(); - LOGGER.info("write cost:{}", System.currentTimeMillis() - start); + long cost = System.currentTimeMillis() - start; + LOGGER.info("write cost:{}", cost); start = System.currentTimeMillis(); try (FileOutputStream fileOutputStream = new FileOutputStream(fileWritePoi07)) { SXSSFWorkbook workbook = new SXSSFWorkbook(); @@ -111,8 +113,9 @@ public class LargeDataTest { workbook.dispose(); workbook.close(); } - + long costPoi = System.currentTimeMillis() - start; LOGGER.info("poi write cost:{}", System.currentTimeMillis() - start); + Assert.assertTrue(costPoi * 3 > cost); } private List data() {