diff --git a/easyexcel-test/pom.xml b/easyexcel-test/pom.xml
index 23da290a..840d3f61 100644
--- a/easyexcel-test/pom.xml
+++ b/easyexcel-test/pom.xml
@@ -40,11 +40,6 @@
spring-boot-starter-test
2.7.11
-
- junit
- junit
- 4.13.2
-
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationDataListener.java
index 222d83b5..a7249bfb 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationDataListener.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationDataListener.java
@@ -4,16 +4,16 @@ import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
-import org.junit.Assert;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.exception.ExcelCommonException;
import com.alibaba.excel.util.DateUtils;
import com.alibaba.fastjson2.JSON;
+import org.junit.jupiter.api.Assertions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* @author Jiaju Zhuang
*/
@@ -28,14 +28,14 @@ public class AnnotationDataListener extends AnalysisEventListener dataStyle() throws Exception {
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameDataListener.java
index ea091f23..eaa73f99 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameDataListener.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameDataListener.java
@@ -3,14 +3,14 @@ package com.alibaba.easyexcel.test.core.annotation;
import java.util.ArrayList;
import java.util.List;
-import org.junit.Assert;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson2.JSON;
+import org.junit.jupiter.api.Assertions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* @author Jiaju Zhuang
*/
@@ -25,12 +25,12 @@ public class AnnotationIndexAndNameDataListener extends AnalysisEventListener> headMap, AnalysisContext context) {
String head = headMap.get(0).getStringValue();
- Assert.assertEquals("姓名", head);
+ Assertions.assertEquals("姓名", head);
}
@Override
@@ -82,10 +77,10 @@ public class BomDataTest {
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
- Assert.assertEquals(dataList.size(), 10);
+ Assertions.assertEquals(dataList.size(), 10);
BomData bomData = dataList.get(0);
- Assert.assertEquals("姓名0", bomData.getName());
- Assert.assertEquals(20, (long)bomData.getAge());
+ Assertions.assertEquals("姓名0", bomData.getName());
+ Assertions.assertEquals(20, (long)bomData.getAge());
}
})
.charset(charset)
@@ -100,7 +95,7 @@ public class BomDataTest {
@Override
public void invokeHead(Map> headMap, AnalysisContext context) {
String head = headMap.get(0).getStringValue();
- Assert.assertEquals("姓名", head);
+ Assertions.assertEquals("姓名", head);
}
@Override
@@ -110,10 +105,10 @@ public class BomDataTest {
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
- Assert.assertEquals(dataList.size(), 10);
+ Assertions.assertEquals(dataList.size(), 10);
BomData bomData = dataList.get(0);
- Assert.assertEquals("姓名0", bomData.getName());
- Assert.assertEquals(20L, (long)bomData.getAge());
+ Assertions.assertEquals("姓名0", bomData.getName());
+ Assertions.assertEquals(20L, (long)bomData.getAge());
}
}).sheet().doRead();
}
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/cache/CacheDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/cache/CacheDataTest.java
index 10cb15d0..b1c242b3 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/cache/CacheDataTest.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/cache/CacheDataTest.java
@@ -21,16 +21,16 @@ import com.alibaba.excel.util.ClassUtils;
import com.alibaba.excel.util.FieldUtils;
import lombok.extern.slf4j.Slf4j;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.MethodOrderer;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestMethodOrder;
/**
* @author Jiaju Zhuang
*/
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+@TestMethodOrder(MethodOrderer.MethodName.class)
@Slf4j
public class CacheDataTest {
@@ -40,7 +40,7 @@ public class CacheDataTest {
private static File fileCacheInvokeMemory;
private static File fileCacheInvokeMemory2;
- @BeforeClass
+ @BeforeAll
public static void init() {
file07 = TestFileUtil.createNewFile("cache/cache.xlsx");
fileCacheInvoke = TestFileUtil.createNewFile("cache/fileCacheInvoke.xlsx");
@@ -54,14 +54,14 @@ public class CacheDataTest {
Field field = FieldUtils.getField(ClassUtils.class, "FIELD_THREAD_LOCAL", true);
ThreadLocal
*
- * @param cell
- * The cell
+ * @param cell The cell
* @return the formatted cell value as a String
*/
public String formatCellValue(Cell cell) {
@@ -924,10 +927,8 @@ public class DataFormatter1 implements Observer {
* String will be returned. The caller is responsible for setting the currentRow on the evaluator
*
*
- * @param cell
- * The cell (can be null)
- * @param evaluator
- * The FormulaEvaluator (can be null)
+ * @param cell The cell (can be null)
+ * @param evaluator The FormulaEvaluator (can be null)
* @return a string value of the cell
*/
public String formatCellValue(Cell cell, FormulaEvaluator evaluator) {
@@ -953,12 +954,9 @@ public class DataFormatter1 implements Observer {
* The two evaluators should be from the same context, to avoid inconsistencies in cached values.
*
*
- * @param cell
- * The cell (can be null)
- * @param evaluator
- * The FormulaEvaluator (can be null)
- * @param cfEvaluator
- * ConditionalFormattingEvaluator (can be null)
+ * @param cell The cell (can be null)
+ * @param evaluator The FormulaEvaluator (can be null)
+ * @param cfEvaluator ConditionalFormattingEvaluator (can be null)
* @return a string value of the cell
*/
public String formatCellValue(Cell cell, FormulaEvaluator evaluator, ConditionalFormattingEvaluator cfEvaluator) {
@@ -978,10 +976,10 @@ public class DataFormatter1 implements Observer {
switch (cellType) {
case NUMERIC:
-// if (DateUtil.isCellDateFormatted(cell, cfEvaluator)) {
- return getFormattedDateString(cell, cfEvaluator);
-// }
-// return getFormattedNumberString(cell, cfEvaluator);
+ // if (DateUtil.isCellDateFormatted(cell, cfEvaluator)) {
+ return getFormattedDateString(cell, cfEvaluator);
+ // }
+ // return getFormattedNumberString(cell, cfEvaluator);
case STRING:
return cell.getRichStringCellValue().getString();
@@ -1009,8 +1007,7 @@ public class DataFormatter1 implements Observer {
* Number
value.
*
*
- * @param format
- * A Format instance to be used as a default
+ * @param format A Format instance to be used as a default
* @see java.text.Format#format
*/
public void setDefaultNumberFormat(Format format) {
@@ -1030,10 +1027,8 @@ public class DataFormatter1 implements Observer {
* Number
value.
*
*
- * @param excelFormatStr
- * The data format string
- * @param format
- * A Format instance
+ * @param excelFormatStr The data format string
+ * @param format A Format instance
*/
public void addFormat(String excelFormatStr, Format format) {
formats.put(excelFormatStr, format);
@@ -1061,10 +1056,8 @@ public class DataFormatter1 implements Observer {
/**
* Enables custom rounding mode on the given Decimal Format.
*
- * @param format
- * DecimalFormat
- * @param roundingMode
- * RoundingMode
+ * @param format DecimalFormat
+ * @param roundingMode RoundingMode
*/
public static void setExcelStyleRoundingMode(DecimalFormat format, RoundingMode roundingMode) {
format.setRoundingMode(roundingMode);
@@ -1086,17 +1079,13 @@ public class DataFormatter1 implements Observer {
/**
* Update formats when locale has been changed
*
- * @param observable
- * usually this is our own Observable instance
- * @param localeObj
- * only reacts on Locale objects
+ * @param observable usually this is our own Observable instance
+ * @param localeObj only reacts on Locale objects
*/
public void update(Observable observable, Object localeObj) {
- if (!(localeObj instanceof Locale))
- return;
+ if (!(localeObj instanceof Locale)) {return;}
Locale newLocale = (Locale)localeObj;
- if (!localeIsAdapting || newLocale.equals(locale))
- return;
+ if (!localeIsAdapting || newLocale.equals(locale)) {return;}
locale = newLocale;
@@ -1141,7 +1130,9 @@ public class DataFormatter1 implements Observer {
// enforce singleton
}
- /** Format a number as an SSN */
+ /**
+ * Format a number as an SSN
+ */
public static String format(Number num) {
String result = df.format(num);
return result.substring(0, 3) + '-' + result.substring(3, 5) + '-' + result.substring(5, 9);
@@ -1172,7 +1163,9 @@ public class DataFormatter1 implements Observer {
// enforce singleton
}
- /** Format a number as Zip + 4 */
+ /**
+ * Format a number as Zip + 4
+ */
public static String format(Number num) {
String result = df.format(num);
return result.substring(0, 5) + '-' + result.substring(5, 9);
@@ -1203,7 +1196,9 @@ public class DataFormatter1 implements Observer {
// enforce singleton
}
- /** Format a number as a phone number */
+ /**
+ * Format a number as a phone number
+ */
public static String format(Number num) {
String result = df.format(num);
StringBuilder sb = new StringBuilder();
@@ -1243,7 +1238,6 @@ public class DataFormatter1 implements Observer {
*
* This format is used to simulate Excel's handling of a format string of all # when the value is 0. Excel will
* output "", Java will output "0".
- *
*/
@SuppressWarnings("serial")
private static final class ConstantStringFormat extends Format {
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/fill/FillTempTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/fill/FillTempTest.java
index 2c201863..352e4600 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/fill/FillTempTest.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/fill/FillTempTest.java
@@ -16,16 +16,15 @@ import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.alibaba.excel.write.metadata.fill.FillWrapper;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
/**
* 写的填充写法
*
- * @since 2.1.1
* @author Jiaju Zhuang
+ * @since 2.1.1
*/
-@Ignore
+
public class FillTempTest {
/**
* 最简单的填充
@@ -35,7 +34,7 @@ public class FillTempTest {
@Test
public void simpleFill() {
// 模板注意 用{} 来表示你要用的变量 如果本来就有"{","}" 特殊字符 用"\{","\}"代替
- String templateFileName ="/Users/zhuangjiaju/Downloads/simple.xlsx";
+ String templateFileName = "/Users/zhuangjiaju/Downloads/simple.xlsx";
// 方案1 根据对象填充
String fileName = TestFileUtil.getPath() + "simpleFill" + System.currentTimeMillis() + ".xlsx";
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Issue1662Test.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Issue1662Test.java
index cea7e5ee..466227fe 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Issue1662Test.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Issue1662Test.java
@@ -7,10 +7,8 @@ import java.util.List;
import com.alibaba.easyexcel.test.util.TestFileUtil;
import com.alibaba.excel.EasyExcel;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-@Ignore
public class Issue1662Test {
@Test
public void test1662() {
@@ -19,7 +17,6 @@ public class Issue1662Test {
EasyExcel.write(fileName).head(head()).sheet("模板").doWrite(dataList());
}
-
private List> head() {
List> list = new ArrayList>();
List head0 = new ArrayList();
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue1663/FillTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue1663/FillTest.java
index 7f89621c..f9c2a2b4 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue1663/FillTest.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue1663/FillTest.java
@@ -15,13 +15,11 @@ import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.alibaba.excel.write.metadata.fill.FillWrapper;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-@Ignore
public class FillTest {
@Test
- public void TestFillNullPoint(){
+ public void TestFillNullPoint() {
String templateFileName =
TestFileUtil.getPath() + "temp/issue1663" + File.separator + "template.xlsx";
@@ -37,8 +35,10 @@ public class FillTest {
excelWriter.fill(map, writeSheet);
excelWriter.finish();
}
+
private List data() {
- List list = new ArrayList();
+ List list
+ = new ArrayList();
for (int i = 0; i < 10; i++) {
com.alibaba.easyexcel.test.demo.fill.FillData fillData = new FillData();
list.add(fillData);
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue2443/Issue2443Test.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue2443/Issue2443Test.java
index b9e2c965..d23f9fb8 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue2443/Issue2443Test.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue2443/Issue2443Test.java
@@ -1,19 +1,20 @@
package com.alibaba.easyexcel.test.temp.issue2443;
+import java.io.File;
+import java.text.ParseException;
+
import com.alibaba.easyexcel.test.util.TestFileUtil;
-import com.alibaba.excel.metadata.property.ExcelContentProperty;
-import com.alibaba.excel.util.NumberUtils;
import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.alibaba.excel.read.listener.PageReadListener;
+import com.alibaba.excel.util.NumberUtils;
import com.alibaba.fastjson2.JSON;
+
import lombok.extern.slf4j.Slf4j;
-import org.junit.Ignore;
-import org.junit.Test;
-import static org.junit.Assert.*;
-import java.io.File;
-import java.text.ParseException;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
-@Ignore
@Slf4j
public class Issue2443Test {
//CS304 (manually written) Issue link: https://github.com/alibaba/easyexcel/issues/2443
@@ -26,6 +27,7 @@ public class Issue2443Test {
}
})).sheet().doRead();
}
+
//CS304 (manually written) Issue link: https://github.com/alibaba/easyexcel/issues/2443
@Test
public void IssueTest2() {
@@ -41,16 +43,16 @@ public class Issue2443Test {
public void parseIntegerTest1() throws ParseException {
String string = "1.00";
ExcelContentProperty contentProperty = null;
- int Int = NumberUtils.parseInteger(string,contentProperty);
- assertEquals(1, Int);
+ int Int = NumberUtils.parseInteger(string, contentProperty);
+ Assertions.assertEquals(1, Int);
}
@Test
public void parseIntegerTest2() throws ParseException {
String string = "2.00";
ExcelContentProperty contentProperty = null;
- int Int = NumberUtils.parseInteger(string,contentProperty);
- assertEquals(2, Int);
+ int Int = NumberUtils.parseInteger(string, contentProperty);
+ Assertions.assertEquals(2, Int);
}
}
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/LargeDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/LargeDataListener.java
index 25176101..b62ee1f6 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/LargeDataListener.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/LargeDataListener.java
@@ -1,12 +1,12 @@
package com.alibaba.easyexcel.test.temp.large;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson2.JSON;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* @author Jiaju Zhuang
*/
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/NoModelLargeDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/NoModelLargeDataListener.java
index 2d532bb2..5e180624 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/NoModelLargeDataListener.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/NoModelLargeDataListener.java
@@ -2,13 +2,13 @@ package com.alibaba.easyexcel.test.temp.large;
import java.util.Map;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson2.JSON;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* @author Jiaju Zhuang
*/
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/TempLargeDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/TempLargeDataTest.java
index 934b62f5..b88bf06e 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/TempLargeDataTest.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/TempLargeDataTest.java
@@ -19,17 +19,16 @@ 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.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Jiaju Zhuang
*/
-@Ignore
+
public class TempLargeDataTest {
private static final Logger LOGGER = LoggerFactory.getLogger(LargeDataTest.class);
@@ -42,7 +41,7 @@ public class TempLargeDataTest {
private static File fileWriteTemp07;
private static File fileWritePoi07;
- @BeforeClass
+ @BeforeAll
public static void init() {
fileFill07 = TestFileUtil.createNewFile("largefill07.xlsx");
fileWrite07 = TestFileUtil.createNewFile("large" + File.separator + "fileWrite07.xlsx");
@@ -124,7 +123,7 @@ public class TempLargeDataTest {
long costPoi = System.currentTimeMillis() - start;
LOGGER.info("poi write cost:{}", System.currentTimeMillis() - start);
LOGGER.info("{} vs {}", cost, costPoi);
- Assert.assertTrue(costPoi * 2 > cost);
+ Assertions.assertTrue(costPoi * 2 > cost);
}
@Test
@@ -167,9 +166,9 @@ public class TempLargeDataTest {
for (int j = 0; j < 25; j++) {
String str = "str-" + j + "-" + i;
//if (i + 10000 == j) {
- SXSSFCell cell = row.createCell(j);
- cell.setCellValue(str);
- //System.out.println(str);
+ SXSSFCell cell = row.createCell(j);
+ cell.setCellValue(str);
+ //System.out.println(str);
//}
}
if (i % 5000 == 0) {
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi2Test.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi2Test.java
index 6e1933ab..a2567e11 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi2Test.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi2Test.java
@@ -8,8 +8,7 @@ import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -18,7 +17,7 @@ import org.slf4j.LoggerFactory;
*
* @author Jiaju Zhuang
**/
-@Ignore
+
public class Poi2Test {
private static final Logger LOGGER = LoggerFactory.getLogger(Poi2Test.class);
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi3Test.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi3Test.java
index 4eb7714c..b9cac73f 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi3Test.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi3Test.java
@@ -4,6 +4,8 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
+import com.alibaba.easyexcel.test.util.TestFileUtil;
+
import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.openxml4j.opc.OPCPackage;
@@ -12,19 +14,16 @@ import org.apache.poi.poifs.crypt.EncryptionInfo;
import org.apache.poi.poifs.crypt.EncryptionMode;
import org.apache.poi.poifs.crypt.Encryptor;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.alibaba.easyexcel.test.util.TestFileUtil;
-
/**
* 测试poi
*
* @author Jiaju Zhuang
**/
-@Ignore
+
public class Poi3Test {
private static final Logger LOGGER = LoggerFactory.getLogger(Poi3Test.class);
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiEncryptTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiEncryptTest.java
index 67b6cfc7..5484a614 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiEncryptTest.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiEncryptTest.java
@@ -17,28 +17,24 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
/**
* TODO
*
* @author Jiaju Zhuang
*/
-@Ignore
+
public class PoiEncryptTest {
@Test
public void encrypt() throws Exception {
-
-
XSSFWorkbook workbook = new XSSFWorkbook();
SXSSFWorkbook sxssfWorkbook = new SXSSFWorkbook(workbook);
Sheet sheet = sxssfWorkbook.createSheet("sheet1");
sheet.createRow(0).createCell(0).setCellValue("T2");
-
POIFSFileSystem fs = new POIFSFileSystem();
EncryptionInfo info = new EncryptionInfo(EncryptionMode.agile);
@@ -62,7 +58,7 @@ public class PoiEncryptTest {
@Test
public void encryptExcel() throws Exception {
EasyExcel.write(TestFileUtil.createNewFile("encryptv2" + System.currentTimeMillis() + ".xlsx"),
- EncryptData.class).password("123456")
+ EncryptData.class).password("123456")
.sheet().doWrite(data());
}
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiFormatTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiFormatTest.java
index b20004a9..4dfef5b1 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiFormatTest.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiFormatTest.java
@@ -11,8 +11,7 @@ import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -21,7 +20,7 @@ import org.slf4j.LoggerFactory;
*
* @author Jiaju Zhuang
**/
-@Ignore
+
public class PoiFormatTest {
private static final Logger LOGGER = LoggerFactory.getLogger(PoiFormatTest.class);
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiTest.java
index e27136d4..6c3f229a 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiTest.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiTest.java
@@ -28,8 +28,7 @@ import org.apache.poi.xssf.usermodel.XSSFFont;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -38,7 +37,7 @@ import org.slf4j.LoggerFactory;
*
* @author Jiaju Zhuang
**/
-@Ignore
+
public class PoiTest {
private static final Logger LOGGER = LoggerFactory.getLogger(PoiTest.class);
@@ -84,7 +83,6 @@ public class PoiTest {
LOGGER.info("bbb:{}", cellStyle1.getFont().getBold());
LOGGER.info("bbb:{}", cellStyle1.getFont().getFontName());
-
XSSFFont xssfFont = xssfWorkbook.createFont();
xssfFont.setColor(myColor);
@@ -94,7 +92,6 @@ public class PoiTest {
cellStyle1.setFont(xssfFont);
cellStyle1.setFillForegroundColor(IndexedColors.PINK.getIndex());
-
LOGGER.info("aaa:{}", cellStyle1.getFont().getColor());
row.getCell(1).setCellStyle(cellStyle1);
@@ -118,7 +115,6 @@ public class PoiTest {
xssfWorkbook.close();
}
-
@Test
public void lastRowNumXSSFv22() throws IOException {
@@ -142,7 +138,6 @@ public class PoiTest {
LOGGER.info("bbb:{}", cellStyle1.getFont(xssfWorkbook).getColor());
-
HSSFFont xssfFont = xssfWorkbook.createFont();
xssfFont.setColor(cellStyle1.getFont(xssfWorkbook).getColor());
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiWriteTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiWriteTest.java
index 7ce3f587..98e7509a 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiWriteTest.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiWriteTest.java
@@ -14,8 +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.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -24,7 +23,7 @@ import org.slf4j.LoggerFactory;
*
* @author Jiaju Zhuang
**/
-@Ignore
+
public class PoiWriteTest {
private static final Logger LOGGER = LoggerFactory.getLogger(PoiWriteTest.class);
@@ -110,11 +109,12 @@ public class PoiWriteTest {
@Test
public void part4() throws IOException {
//URL url=new URL("http://120.55.161.4/group1/M00/00/00/i8QJ8WFfwMiAXKYrAAACqC1MFiY641.png");
- URL url=new URL("https://img-blog.csdn.net/20160729002743309?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center");
+ URL url = new URL(
+ "https://img-blog.csdn.net/20160729002743309?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T"
+ + "/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center");
InputStream in = new BufferedInputStream(url.openStream());
-
}
}
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/CommentTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/CommentTest.java
index 780b1ce4..b05fd540 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/CommentTest.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/CommentTest.java
@@ -4,21 +4,20 @@ import java.io.File;
import java.util.List;
import java.util.Map;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.metadata.data.CellData;
import com.alibaba.fastjson2.JSON;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* 临时测试
*
* @author Jiaju Zhuang
**/
-@Ignore
+
public class CommentTest {
private static final Logger LOGGER = LoggerFactory.getLogger(CommentTest.class);
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HDListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HDListener.java
index 7ee174d9..094c58f5 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HDListener.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HDListener.java
@@ -2,13 +2,13 @@ package com.alibaba.easyexcel.test.temp.read;
import java.util.Map;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson2.JSON;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* 模板的读取类
*
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadListener.java
index 711e5b9b..4d1eb8ba 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadListener.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadListener.java
@@ -2,13 +2,13 @@ package com.alibaba.easyexcel.test.temp.read;
import java.util.Map;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson2.JSON;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* 模板的读取类
*
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadData.java
index 90a721a2..a942763f 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadData.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadData.java
@@ -15,7 +15,7 @@ import lombok.Setter;
@Setter
@EqualsAndHashCode
public class HeadReadData {
- @ExcelProperty({"主标题","数据1"})
+ @ExcelProperty({"主标题", "数据1"})
private String h1;
@ExcelProperty({"主标题", "数据2"})
private String h2;
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java
index 6649c2fe..ab004258 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java
@@ -6,8 +6,7 @@ import com.alibaba.easyexcel.test.util.TestFileUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.cache.Ehcache;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -16,7 +15,7 @@ import org.slf4j.LoggerFactory;
*
* @author Jiaju Zhuang
**/
-@Ignore
+
public class HeadReadTest {
private static final Logger LOGGER = LoggerFactory.getLogger(HeadReadTest.class);
@@ -38,5 +37,4 @@ public class HeadReadTest {
EasyExcel.read(file, HeadReadData.class, new HDListener()).readCache(new Ehcache(20)).sheet(0).doRead();
}
-
}
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java
index fcb75f11..4e1f40c5 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java
@@ -6,27 +6,27 @@ import java.io.InputStream;
import java.net.URL;
import java.util.List;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson2.JSON;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* 测试poi
*
* @author Jiaju Zhuang
**/
-@Ignore
+
public class HgTest {
private static final Logger LOGGER = LoggerFactory.getLogger(HgTest.class);
@Test
public void hh() throws IOException {
List list =
- EasyExcel.read(new FileInputStream("D:\\test\\201909301017rule.xlsx")).headRowNumber(2).sheet().doReadSync();
+ EasyExcel.read(new FileInputStream("D:\\test\\201909301017rule.xlsx")).headRowNumber(2).sheet()
+ .doReadSync();
for (Object data : list) {
LOGGER.info("返回数据:{}", JSON.toJSONString(data));
}
@@ -34,7 +34,11 @@ public class HgTest {
@Test
public void hh5() throws IOException {
- URL url = new URL("http://hotelcontractfil.oss-cn-beijing.aliyuncs.com/2019/%E5%98%89%E6%83%A0-%E4%B8%AD%E4%BA%A4%E5%BB%BA_2019-09-01_2019-09-30_1569055677522.xlsx?Expires=1884415681&OSSAccessKeyId=LTAIGZDkqZfPArBr&Signature=Rf0gbO8vl3l%2Brj1KdyzHHMsUhCE%3D");
+ URL url = new URL(
+ "http://hotelcontractfil.oss-cn-beijing.aliyuncs"
+ + ".com/2019/%E5%98%89%E6%83%A0-%E4%B8%AD%E4%BA%A4%E5%BB%BA_2019-09-01_2019-09-30_1569055677522"
+ + ".xlsx?Expires=1884415681&OSSAccessKeyId=LTAIGZDkqZfPArBr&Signature=Rf0gbO8vl3l%2Brj1KdyzHHMsUhCE"
+ + "%3D");
InputStream is = url.openStream();
List list =
EasyExcel.read(is).headRowNumber(0).sheet().doReadSync();
@@ -45,7 +49,8 @@ public class HgTest {
@Test
public void hh2() throws IOException {
- EasyExcel.read(new FileInputStream("D:\\test\\商户不匹配工单信息收集表格.xlsx")).registerReadListener(new HgListener())
+ EasyExcel.read(new FileInputStream("D:\\test\\商户不匹配工单信息收集表格.xlsx")).registerReadListener(
+ new HgListener())
.headRowNumber(0).sheet().doRead();
}
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/RepeatListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/RepeatListener.java
index eab1e1ae..6755c94d 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/RepeatListener.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/RepeatListener.java
@@ -3,15 +3,15 @@ package com.alibaba.easyexcel.test.temp.simple;
import java.util.ArrayList;
import java.util.List;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.alibaba.easyexcel.test.demo.read.DemoDataListener;
import com.alibaba.easyexcel.test.temp.LockData;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson2.JSON;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* 模板的读取类
*
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/RepeatTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/RepeatTest.java
index d7cf0080..e1e669e4 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/RepeatTest.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/RepeatTest.java
@@ -3,22 +3,21 @@ package com.alibaba.easyexcel.test.temp.simple;
import java.io.FileInputStream;
import java.io.IOException;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.alibaba.easyexcel.test.temp.LockData;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.read.metadata.ReadSheet;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* 测试poi
*
* @author Jiaju Zhuang
**/
-@Ignore
+
public class RepeatTest {
private static final Logger LOGGER = LoggerFactory.getLogger(RepeatTest.class);
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/Write.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/Write.java
index d9b59a52..760a638e 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/Write.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/Write.java
@@ -16,8 +16,7 @@ import com.alibaba.excel.write.metadata.WriteTable;
import com.alibaba.fastjson2.JSON;
import lombok.extern.slf4j.Slf4j;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -26,7 +25,7 @@ import org.slf4j.LoggerFactory;
*
* @author Jiaju Zhuang
**/
-@Ignore
+
@Slf4j
public class Write {
private static final Logger LOGGER = LoggerFactory.getLogger(Write.class);
@@ -68,8 +67,9 @@ public class Write {
String fileName = TestFileUtil.getPath() + "t33" + System.currentTimeMillis() + ".xlsx";
// 这里 需要指定写用哪个class去读,然后写到第一个sheet,名字为模板 然后文件流会自动关闭
// 如果这里想使用03 则 传入excelType参数即可
- EasyExcel.write(fileName).head(head()).inMemory(true).sheet("模板").registerWriteHandler(new WriteCellHandler()).doWrite(
- data1());
+ EasyExcel.write(fileName).head(head()).inMemory(true).sheet("模板").registerWriteHandler(new WriteCellHandler())
+ .doWrite(
+ data1());
}
@Test
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteData.java
index d9a035ce..f4ced8cb 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteData.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteData.java
@@ -15,8 +15,8 @@ import lombok.Setter;
@Setter
@EqualsAndHashCode
public class WriteData {
-// @ContentStyle(locked = true)
+ // @ContentStyle(locked = true)
private Date dd;
-// @ContentStyle(locked = false)
+ // @ContentStyle(locked = false)
private float f1;
}
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/write/TempWriteTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/write/TempWriteTest.java
index a8603f12..8c75deab 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/write/TempWriteTest.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/write/TempWriteTest.java
@@ -1,34 +1,20 @@
package com.alibaba.easyexcel.test.temp.write;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import com.alibaba.easyexcel.test.demo.read.CustomStringStringConverter;
-import com.alibaba.easyexcel.test.demo.write.DemoData;
-import com.alibaba.easyexcel.test.demo.write.ImageDemoData;
import com.alibaba.easyexcel.test.util.TestFileUtil;
import com.alibaba.excel.EasyExcel;
-import com.alibaba.excel.ExcelWriter;
-import com.alibaba.excel.enums.CellDataTypeEnum;
-import com.alibaba.excel.metadata.data.ImageData;
-import com.alibaba.excel.metadata.data.ImageData.ImageType;
-import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.util.BeanMapUtils;
import com.alibaba.excel.util.FileUtils;
import com.alibaba.excel.util.ListUtils;
-import com.alibaba.excel.write.metadata.WriteSheet;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.ClientAnchor;
import org.apache.poi.ss.usermodel.CreationHelper;
-import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.Picture;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.streaming.SXSSFCell;
@@ -36,17 +22,10 @@ import org.apache.poi.xssf.streaming.SXSSFDrawing;
import org.apache.poi.xssf.streaming.SXSSFRow;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
-import org.apache.poi.xssf.usermodel.XSSFCellStyle;
-import org.apache.poi.xssf.usermodel.XSSFColor;
-import org.apache.poi.xssf.usermodel.XSSFFont;
-import org.apache.poi.xssf.usermodel.XSSFRow;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.springframework.cglib.beans.BeanMap;
-@Ignore
@Slf4j
public class TempWriteTest {
@@ -166,7 +145,8 @@ public class TempWriteTest {
public void large() throws Exception {
String file = "/Users/zhuangjiaju/test/imagetest" + System.currentTimeMillis() + ".xlsx";
SXSSFWorkbook workbook = new SXSSFWorkbook(new XSSFWorkbook(
- new File("/Users/zhuangjiaju/IdeaProjects/easyexcel/easyexcel-test/src/test/resources/large/large07.xlsx")));
+ new File(
+ "/Users/zhuangjiaju/IdeaProjects/easyexcel/easyexcel-test/src/test/resources/large/large07.xlsx")));
SXSSFSheet sheet = workbook.createSheet("测试");
SXSSFRow row = sheet.createRow(500000);
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/util/TestFileUtil.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/util/TestFileUtil.java
index b0ab7ebb..0e89f275 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/util/TestFileUtil.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/util/TestFileUtil.java
@@ -1,14 +1,13 @@
package com.alibaba.easyexcel.test.util;
-import org.springframework.util.CollectionUtils;
-
import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
-public class TestFileUtil {
+import org.springframework.util.CollectionUtils;
+public class TestFileUtil {
public static InputStream getResourcesFileInputStream(String fileName) {
return Thread.currentThread().getContextClassLoader().getResourceAsStream("" + fileName);
@@ -42,7 +41,6 @@ public class TestFileUtil {
return new File(System.getProperty("user.home") + File.separator + pathName);
}
-
/**
* build to test file path
**/
@@ -75,5 +73,4 @@ public class TestFileUtil {
}
-
}
diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/util/TestUtil.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/util/TestUtil.java
index 8246f5b9..02077f3a 100644
--- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/util/TestUtil.java
+++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/util/TestUtil.java
@@ -1,7 +1,5 @@
package com.alibaba.easyexcel.test.util;
-import java.io.File;
-import java.io.InputStream;
import java.text.ParseException;
import java.time.LocalDate;
import java.time.LocalDateTime;
@@ -10,7 +8,6 @@ import java.util.Date;
import com.alibaba.excel.util.DateUtils;
import lombok.extern.slf4j.Slf4j;
-import org.junit.Assert;
/**
* test util