diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9da457d..41f76926 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,6 @@ jobs: - name: Chmod run: chmod +x mvnw - name: Maven Build - run: ./mvnw install -B -V -Dmaven.test.skip=true + run: ./mvnw install -B -V -Dmaven.test.skip=false - name: Java Doc run: ./mvnw javadoc:javadoc diff --git a/README.md b/README.md index 5896b6e5..ca1c4c36 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ EasyExcel [钉钉3群(已满): 33797247](https://qr.dingtalk.com/action/joingroup?code=v1,k1,3UGlEScTGQaHpW2cIRo+gkxJ9EVZ5fz26M6nW3uFP30=&_dt_no_comment=1&origin=11) [钉钉4群(已满): 33491624](https://qr.dingtalk.com/action/joingroup?code=v1,k1,V14Pb65Too70rQkEaJ9ohb6lZBZbtp6jIL/q9EWh9vA=&_dt_no_comment=1&origin=11) [钉钉5群(已满): 32134498](https://h5.dingtalk.com/circle/healthCheckin.html?dtaction=os&corpId=dingb9fa1325d9dccc3ecac589edd02f1650&5233a=71a83&cbdbhh=qwertyuiop) -[钉钉6群: 34707941](https://h5.dingtalk.com/circle/healthCheckin.html?dtaction=os&corpId=dingcf68008a1d443ac012d5427bdb061b7a&6ae36c3d-0c80-4=22398493-6c2a-4&cbdbhh=qwertyuiop) +[钉钉6群(已满): 34707941](https://h5.dingtalk.com/circle/healthCheckin.html?dtaction=os&corpId=dingcf68008a1d443ac012d5427bdb061b7a&6ae36c3d-0c80-4=22398493-6c2a-4&cbdbhh=qwertyuiop) +[钉钉7群: 35235427](https://h5.dingtalk.com/circle/healthCheckin.html?dtaction=os&corpId=ding532b9018c06c7fc8660273c4b78e6440&167fb=ed003&cbdbhh=qwertyuiop) [官方网站: https://yuque.com/easyexcel](https://www.yuque.com/easyexcel/doc/easyexcel) [常见问题](https://www.yuque.com/easyexcel/faq) diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/analysis/v03/handlers/FormulaRecordHandler.java b/easyexcel-core/src/main/java/com/alibaba/excel/analysis/v03/handlers/FormulaRecordHandler.java index f5d7ff0a..09188cb2 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/analysis/v03/handlers/FormulaRecordHandler.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/analysis/v03/handlers/FormulaRecordHandler.java @@ -64,6 +64,7 @@ public class FormulaRecordHandler extends AbstractXlsRecordHandler implements Ig dataFormatData.setFormat(BuiltinFormats.getBuiltinFormat(dataFormatData.getIndex(), xlsReadContext.xlsReadWorkbookHolder().getFormatTrackingHSSFListener().getFormatString(frec), xlsReadContext.readSheetHolder().getGlobalConfiguration().getLocale())); + tempCellData.setDataFormatData(dataFormatData); cellMap.put((int)frec.getColumn(), tempCellData); break; case ERROR: diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/util/NumberUtils.java b/easyexcel-core/src/main/java/com/alibaba/excel/util/NumberUtils.java index c467762c..4646c396 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/util/NumberUtils.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/util/NumberUtils.java @@ -75,7 +75,7 @@ public class NumberUtils { */ public static Short parseShort(String string, ExcelContentProperty contentProperty) throws ParseException { if (!hasFormat(contentProperty)) { - return Short.valueOf(string); + return new BigDecimal(string).shortValue(); } return parse(string, contentProperty).shortValue(); } @@ -89,21 +89,21 @@ public class NumberUtils { */ public static Long parseLong(String string, ExcelContentProperty contentProperty) throws ParseException { if (!hasFormat(contentProperty)) { - return Long.valueOf(string); + return new BigDecimal(string).longValue(); } return parse(string, contentProperty).longValue(); } /** - * parse + * parse Integer from string * - * @param string - * @param contentProperty - * @return + * @param string An integer read in string format + * @param contentProperty Properties of the content read in + * @return An integer converted from a string */ public static Integer parseInteger(String string, ExcelContentProperty contentProperty) throws ParseException { if (!hasFormat(contentProperty)) { - return Integer.valueOf(string); + return new BigDecimal(string).intValue(); } return parse(string, contentProperty).intValue(); } @@ -117,7 +117,7 @@ public class NumberUtils { */ public static Float parseFloat(String string, ExcelContentProperty contentProperty) throws ParseException { if (!hasFormat(contentProperty)) { - return Float.valueOf(string); + return new BigDecimal(string).floatValue(); } return parse(string, contentProperty).floatValue(); } @@ -146,7 +146,7 @@ public class NumberUtils { */ public static Byte parseByte(String string, ExcelContentProperty contentProperty) throws ParseException { if (!hasFormat(contentProperty)) { - return Byte.valueOf(string); + return new BigDecimal(string).byteValue(); } return parse(string, contentProperty).byteValue(); } @@ -160,7 +160,7 @@ public class NumberUtils { */ public static Double parseDouble(String string, ExcelContentProperty contentProperty) throws ParseException { if (!hasFormat(contentProperty)) { - return Double.valueOf(string); + return new BigDecimal(string).doubleValue(); } return parse(string, contentProperty).doubleValue(); } diff --git a/easyexcel-test/README.md b/easyexcel-test/README.md new file mode 100644 index 00000000..299588a0 --- /dev/null +++ b/easyexcel-test/README.md @@ -0,0 +1,3 @@ +# easyexcel-test + +测试案例 \ No newline at end of file diff --git a/easyexcel-test/pom.xml b/easyexcel-test/pom.xml new file mode 100644 index 00000000..e1f265e1 --- /dev/null +++ b/easyexcel-test/pom.xml @@ -0,0 +1,64 @@ + + + 4.0.0 + + + com.alibaba + easyexcel-parent + ${revision} + ../pom.xml + + + jar + easyexcel-test + + + true + + + + + com.alibaba + easyexcel-core + test + + + ch.qos.logback + logback-classic + test + + + com.alibaba + fastjson + test + + + org.springframework.boot + spring-boot-starter-web + test + + + junit + junit + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + com/alibaba/easyexcel/test/core/**/*.java + + true + + + + + + diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/StyleTestUtils.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/StyleTestUtils.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/StyleTestUtils.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/StyleTestUtils.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameData.java diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationIndexAndNameDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationStyleData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationStyleData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationStyleData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationStyleData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataReadData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataReadData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataReadData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataReadData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataWriteData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataWriteData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataWriteData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/celldata/CellDataWriteData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterDataTest.java similarity index 90% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterDataTest.java index b2943522..e7418601 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterDataTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterDataTest.java @@ -61,17 +61,17 @@ public class ConverterDataTest { @Test public void t11ReadAllConverter07() { - readAllConverter("converter" + File.separator + "converter07.xlsx"); + readAllConverter("easyexcel-test/test/resources/converter" + File.separator + "converter07.xlsx"); } @Test public void t12ReadAllConverter03() { - readAllConverter("converter" + File.separator + "converter03.xls"); + readAllConverter("easyexcel-test/test/resources/converter" + File.separator + "converter03.xls"); } @Test public void t13ReadAllConverterCsv() { - readAllConverter("converter" + File.separator + "converterCsv.csv"); + readAllConverter("easyexcel-test/test/resources/converter" + File.separator + "converterCsv.csv"); } @Test @@ -90,7 +90,7 @@ public class ConverterDataTest { List list = new ArrayList<>(); ImageData imageData = new ImageData(); list.add(imageData); - String imagePath = TestFileUtil.getPath() + "converter" + File.separator + "img.jpg"; + String imagePath = TestFileUtil.getPath() + "easyexcel-test/test/resources/converter" + File.separator + "img.jpg"; imageData.setByteArray(FileUtils.readFileToByteArray(new File(imagePath))); imageData.setFile(new File(imagePath)); imageData.setString(imagePath); diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterReadData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterReadData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterReadData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterReadData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterWriteData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterWriteData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterWriteData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterWriteData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ImageData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ImageData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ImageData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ImageData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/dataformat/DateFormatData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/dataformat/DateFormatData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/dataformat/DateFormatData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/dataformat/DateFormatData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/dataformat/DateFormatTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/dataformat/DateFormatTest.java similarity index 91% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/dataformat/DateFormatTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/dataformat/DateFormatTest.java index 27494f29..7bd7bf8c 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/dataformat/DateFormatTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/dataformat/DateFormatTest.java @@ -26,8 +26,8 @@ public class DateFormatTest { @BeforeClass public static void init() { - file07 = TestFileUtil.readFile("dataformat" + File.separator + "dataformat.xlsx"); - file03 = TestFileUtil.readFile("dataformat" + File.separator + "dataformat.xls"); + file07 = TestFileUtil.readFile("easyexcel-test/test/resources/dataformat" + File.separator + "dataformat.xlsx"); + file03 = TestFileUtil.readFile("easyexcel-test/test/resources/dataformat" + File.separator + "dataformat.xls"); } @Test diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/encrypt/EncryptDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionThrowDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionThrowDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionThrowDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/exception/ExceptionThrowDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/excludeorinclude/ExcludeOrIncludeData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/excludeorinclude/ExcludeOrIncludeData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/excludeorinclude/ExcludeOrIncludeData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/excludeorinclude/ExcludeOrIncludeData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/excludeorinclude/ExcludeOrIncludeDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/excludeorinclude/ExcludeOrIncludeDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/excludeorinclude/ExcludeOrIncludeDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/excludeorinclude/ExcludeOrIncludeDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraDataTest.java similarity index 81% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraDataTest.java index cf7418d5..5f80abc1 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraDataTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/extra/ExtraDataTest.java @@ -22,8 +22,8 @@ public class ExtraDataTest { @BeforeClass public static void init() { - file03 = TestFileUtil.readFile("extra" + File.separator + "extra.xls"); - file07 = TestFileUtil.readFile("extra" + File.separator + "extra.xlsx"); + file03 = TestFileUtil.readFile("easyexcel-test/test/resources/extra" + File.separator + "extra.xls"); + file07 = TestFileUtil.readFile("easyexcel-test/test/resources/extra" + File.separator + "extra.xlsx"); } @Test diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/FillData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/FillData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/FillData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/FillData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/FillDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/FillDataTest.java similarity index 85% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/FillDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/FillDataTest.java index e85d63a6..e43dea10 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/FillDataTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/FillDataTest.java @@ -56,25 +56,25 @@ public class FillDataTest { file07 = TestFileUtil.createNewFile("fill07.xlsx"); file03 = TestFileUtil.createNewFile("fill03.xls"); fileCsv = TestFileUtil.createNewFile("fill.csv"); - simpleTemplate07 = TestFileUtil.readFile("fill" + File.separator + "simple.xlsx"); - simpleTemplate03 = TestFileUtil.readFile("fill" + File.separator + "simple.xls"); - simpleTemplateCsv = TestFileUtil.readFile("fill" + File.separator + "simple.csv"); + simpleTemplate07 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "simple.xlsx"); + simpleTemplate03 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "simple.xls"); + simpleTemplateCsv = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "simple.csv"); fileComplex07 = TestFileUtil.createNewFile("fillComplex07.xlsx"); - complexFillTemplate07 = TestFileUtil.readFile("fill" + File.separator + "complex.xlsx"); + complexFillTemplate07 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "complex.xlsx"); fileComplex03 = TestFileUtil.createNewFile("fillComplex03.xls"); - complexFillTemplate03 = TestFileUtil.readFile("fill" + File.separator + "complex.xls"); + complexFillTemplate03 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "complex.xls"); fileHorizontal07 = TestFileUtil.createNewFile("fillHorizontal07.xlsx"); - horizontalFillTemplate07 = TestFileUtil.readFile("fill" + File.separator + "horizontal.xlsx"); + horizontalFillTemplate07 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "horizontal.xlsx"); fileHorizontal03 = TestFileUtil.createNewFile("fillHorizontal03.xls"); - horizontalFillTemplate03 = TestFileUtil.readFile("fill" + File.separator + "horizontal.xls"); + horizontalFillTemplate03 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "horizontal.xls"); byName07 = TestFileUtil.createNewFile("byName07.xlsx"); - byNameTemplate07 = TestFileUtil.readFile("fill" + File.separator + "byName.xlsx"); + byNameTemplate07 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "byName.xlsx"); byName03 = TestFileUtil.createNewFile("byName03.xls"); - byNameTemplate03 = TestFileUtil.readFile("fill" + File.separator + "byName.xls"); + byNameTemplate03 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "byName.xls"); fileComposite07 = TestFileUtil.createNewFile("fileComposite07.xlsx"); - compositeFillTemplate07 = TestFileUtil.readFile("fill" + File.separator + "composite.xlsx"); + compositeFillTemplate07 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "composite.xlsx"); fileComposite03 = TestFileUtil.createNewFile("fileComposite03.xls"); - compositeFillTemplate03 = TestFileUtil.readFile("fill" + File.separator + "composite.xls"); + compositeFillTemplate03 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "composite.xls"); } @Test diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/annotation/FillAnnotationData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/annotation/FillAnnotationData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/annotation/FillAnnotationData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/annotation/FillAnnotationData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/annotation/FillAnnotationDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/annotation/FillAnnotationDataTest.java similarity index 92% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/annotation/FillAnnotationDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/annotation/FillAnnotationDataTest.java index d2159e71..4be041f5 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/annotation/FillAnnotationDataTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/annotation/FillAnnotationDataTest.java @@ -14,13 +14,11 @@ import org.apache.poi.hssf.usermodel.HSSFPicture; import org.apache.poi.hssf.usermodel.HSSFShape; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.PictureData; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.WorkbookFactory; import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.xssf.usermodel.XSSFAnchor; import org.apache.poi.xssf.usermodel.XSSFPicture; import org.apache.poi.xssf.usermodel.XSSFShape; import org.apache.poi.xssf.usermodel.XSSFSheet; @@ -46,8 +44,8 @@ public class FillAnnotationDataTest { public static void init() { file07 = TestFileUtil.createNewFile("fillAnnotation07.xlsx"); file03 = TestFileUtil.createNewFile("fillAnnotation03.xls"); - fileTemplate07 = TestFileUtil.readFile("fill" + File.separator + "annotation.xlsx"); - fileTemplate03 = TestFileUtil.readFile("fill" + File.separator + "annotation.xls"); + fileTemplate07 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "annotation.xlsx"); + fileTemplate03 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "annotation.xls"); } @Test @@ -112,7 +110,7 @@ public class FillAnnotationDataTest { data.setNumber(99.99); data.setString1("string1"); data.setString2("string2"); - data.setImage(TestFileUtil.getPath() + "converter" + File.separator + "img.jpg"); + data.setImage(TestFileUtil.getPath() + "easyexcel-test/test/resources/converter" + File.separator + "img.jpg"); list.add(data); list.add(data); list.add(data); diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedTest.java similarity index 98% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedTest.java index 13367904..596dd33a 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedTest.java @@ -46,8 +46,8 @@ public class FillStyleAnnotatedTest { public static void init() { FillStyleAnnotated07 = TestFileUtil.createNewFile("FillStyleAnnotated07.xlsx"); FillStyleAnnotated03 = TestFileUtil.createNewFile("FillStyleAnnotated03.xls"); - fileStyleTemplate07 = TestFileUtil.readFile("fill" + File.separator + "style.xlsx"); - fileStyleTemplate03 = TestFileUtil.readFile("fill" + File.separator + "style.xls"); + fileStyleTemplate07 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "style.xlsx"); + fileStyleTemplate03 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "style.xls"); } @Test diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleDataTest.java similarity index 98% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleDataTest.java index 210a5b9f..149d9963 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleDataTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleDataTest.java @@ -49,8 +49,8 @@ public class FillStyleDataTest { fileStyle03 = TestFileUtil.createNewFile("fileStyle03.xls"); fileStyleHandler07 = TestFileUtil.createNewFile("fileStyleHandler07.xlsx"); fileStyleHandler03 = TestFileUtil.createNewFile("fileStyleHandler03.xls"); - fileStyleTemplate07 = TestFileUtil.readFile("fill" + File.separator + "style.xlsx"); - fileStyleTemplate03 = TestFileUtil.readFile("fill" + File.separator + "style.xls"); + fileStyleTemplate07 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "style.xlsx"); + fileStyleTemplate03 = TestFileUtil.readFile("easyexcel-test/test/resources/fill" + File.separator + "style.xls"); } @Test diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandler.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandler.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandler.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandler.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandlerData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandlerData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandlerData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandlerData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandlerTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandlerTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandlerTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/handler/WriteHandlerTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexHeadData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexHeadData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexHeadData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexHeadData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexHeadDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexHeadDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexHeadDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/ComplexHeadDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/ListHeadDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/ListHeadDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/ListHeadDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/ListHeadDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/ListHeadDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/ListHeadDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/ListHeadDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/ListHeadDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/head/NoHeadDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/large/LargeData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/large/LargeData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/large/LargeData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/large/LargeData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java similarity index 90% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java index c7f202e5..24ab53b5 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/large/LargeDataTest.java @@ -40,17 +40,17 @@ public class LargeDataTest { @BeforeClass public static void init() { fileFill07 = TestFileUtil.createNewFile("largefill07.xlsx"); - fileWrite07 = TestFileUtil.createNewFile("large" + File.separator + "fileWrite07.xlsx"); - fileWriteTemp07 = TestFileUtil.createNewFile("large" + File.separator + "fileWriteTemp07.xlsx"); - fileWritePoi07 = TestFileUtil.createNewFile("large" + File.separator + "fileWritePoi07.xlsx"); - template07 = TestFileUtil.readFile("large" + File.separator + "fill.xlsx"); + fileWrite07 = TestFileUtil.createNewFile("easyexcel-test/test/resources/large" + File.separator + "fileWrite07.xlsx"); + fileWriteTemp07 = TestFileUtil.createNewFile("easyexcel-test/test/resources/large" + File.separator + "fileWriteTemp07.xlsx"); + fileWritePoi07 = TestFileUtil.createNewFile("easyexcel-test/test/resources/large" + File.separator + "fileWritePoi07.xlsx"); + template07 = TestFileUtil.readFile("easyexcel-test/test/resources/large" + File.separator + "fill.xlsx"); fileCsv = TestFileUtil.createNewFile("largefileCsv.csv"); } @Test public void t01Read() throws Exception { long start = System.currentTimeMillis(); - EasyExcel.read(TestFileUtil.getPath() + "large" + File.separator + "large07.xlsx", LargeData.class, + EasyExcel.read(TestFileUtil.getPath() + "easyexcel-test/test/resources/large" + File.separator + "large07.xlsx", LargeData.class, new LargeDataListener()).headRowNumber(2).sheet().doRead(); LOGGER.info("Large data total time spent:{}", System.currentTimeMillis() - start); } diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsDataTest.java similarity index 86% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsDataTest.java index c69e3ae4..1ff9ce94 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsDataTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsDataTest.java @@ -26,8 +26,8 @@ public class MultipleSheetsDataTest { @BeforeClass public static void init() { - file07 = TestFileUtil.readFile("multiplesheets" + File.separator + "multiplesheets.xlsx"); - file03 = TestFileUtil.readFile("multiplesheets" + File.separator + "multiplesheets.xls"); + file07 = TestFileUtil.readFile("easyexcel-test/test/resources/multiplesheets" + File.separator + "multiplesheets.xlsx"); + file03 = TestFileUtil.readFile("easyexcel-test/test/resources/multiplesheets" + File.separator + "multiplesheets.xls"); } @Test diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/nomodel/NoModelDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/nomodel/NoModelDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/nomodel/NoModelDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/nomodel/NoModelDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/noncamel/UnCamelDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/parameter/ParameterDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleDataSheetNameListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleDataSheetNameListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleDataSheetNameListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleDataSheetNameListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleDataTest.java similarity index 92% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleDataTest.java index 36e90a0f..e6b56380 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleDataTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/simple/SimpleDataTest.java @@ -2,9 +2,7 @@ package com.alibaba.easyexcel.test.core.simple; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.FileOutputStream; -import java.io.InputStream; import java.util.ArrayList; import java.util.List; @@ -92,8 +90,8 @@ public class SimpleDataTest { @Test public void t21SheetNameRead07() { - EasyExcel.read(TestFileUtil.readFile("simple" + File.separator + "simple07.xlsx"), SimpleData.class, - new SimpleDataSheetNameListener()).sheet("simple").doRead(); + EasyExcel.read(TestFileUtil.readFile("easyexcel-test/test/resources/simple" + File.separator + "simple07.xlsx"), SimpleData.class, + new SimpleDataSheetNameListener()).sheet("easyexcel-test/test/resources/simple").doRead(); } private void synchronousRead(File file) { diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/skip/SkipData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/skip/SkipData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/skip/SkipData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/skip/SkipData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/skip/SkipDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/skip/SkipDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/skip/SkipDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/skip/SkipDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/sort/SortData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/sort/SortData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/sort/SortData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/sort/SortData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/sort/SortDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/sort/SortDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/sort/SortDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/sort/SortDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/sort/SortDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/sort/SortDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/sort/SortDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/sort/SortDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/style/StyleData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/style/StyleData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/style/StyleData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/style/StyleData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataTest.java similarity index 86% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataTest.java index d6ebd0aa..3cc041b8 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataTest.java @@ -41,14 +41,14 @@ public class TemplateDataTest { private void readAndWrite07(File file) { EasyExcel.write(file, TemplateData.class) - .withTemplate(TestFileUtil.readFile("template" + File.separator + "template07.xlsx")).sheet() + .withTemplate(TestFileUtil.readFile("easyexcel-test/test/resources/template" + File.separator + "template07.xlsx")).sheet() .doWrite(data()); EasyExcel.read(file, TemplateData.class, new TemplateDataListener()).headRowNumber(3).sheet().doRead(); } private void readAndWrite03(File file) { EasyExcel.write(file, TemplateData.class) - .withTemplate(TestFileUtil.readFile("template" + File.separator + "template03.xls")).sheet() + .withTemplate(TestFileUtil.readFile("easyexcel-test/test/resources/template" + File.separator + "template03.xls")).sheet() .doWrite(data()); EasyExcel.read(file, TemplateData.class, new TemplateDataListener()).headRowNumber(3).sheet().doRead(); } diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillTest.java similarity index 92% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillTest.java index d0f90fe9..c16a2725 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillTest.java @@ -36,7 +36,7 @@ public class FillTest { public void simpleFill() { // 模板注意 用{} 来表示你要用的变量 如果本来就有"{","}" 特殊字符 用"\{","\}"代替 String templateFileName = - TestFileUtil.getPath() + "demo" + File.separator + "fill" + File.separator + "simple.xlsx"; + TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "fill" + File.separator + "simple.xlsx"; // 方案1 根据对象填充 String fileName = TestFileUtil.getPath() + "simpleFill" + System.currentTimeMillis() + ".xlsx"; @@ -65,7 +65,7 @@ public class FillTest { // 模板注意 用{} 来表示你要用的变量 如果本来就有"{","}" 特殊字符 用"\{","\}"代替 // 填充list 的时候还要注意 模板中{.} 多了个点 表示list String templateFileName = - TestFileUtil.getPath() + "demo" + File.separator + "fill" + File.separator + "list.xlsx"; + TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "fill" + File.separator + "list.xlsx"; // 方案1 一下子全部放到内存里面 并填充 String fileName = TestFileUtil.getPath() + "listFill" + System.currentTimeMillis() + ".xlsx"; @@ -103,7 +103,7 @@ public class FillTest { // 模板注意 用{} 来表示你要用的变量 如果本来就有"{","}" 特殊字符 用"\{","\}"代替 // {} 代表普通变量 {.} 代表是list的变量 String templateFileName = - TestFileUtil.getPath() + "demo" + File.separator + "fill" + File.separator + "complex.xlsx"; + TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "fill" + File.separator + "complex.xlsx"; String fileName = TestFileUtil.getPath() + "complexFill" + System.currentTimeMillis() + ".xlsx"; ExcelWriter excelWriter = EasyExcel.write(fileName).withTemplate(templateFileName).build(); @@ -135,7 +135,7 @@ public class FillTest { // {} 代表普通变量 {.} 代表是list的变量 // 这里模板 删除了list以后的数据,也就是统计的这一行 String templateFileName = - TestFileUtil.getPath() + "demo" + File.separator + "fill" + File.separator + "complexFillWithTable.xlsx"; + TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "fill" + File.separator + "complexFillWithTable.xlsx"; String fileName = TestFileUtil.getPath() + "complexFillWithTable" + System.currentTimeMillis() + ".xlsx"; ExcelWriter excelWriter = EasyExcel.write(fileName).withTemplate(templateFileName).build(); @@ -176,7 +176,7 @@ public class FillTest { // 模板注意 用{} 来表示你要用的变量 如果本来就有"{","}" 特殊字符 用"\{","\}"代替 // {} 代表普通变量 {.} 代表是list的变量 String templateFileName = - TestFileUtil.getPath() + "demo" + File.separator + "fill" + File.separator + "horizontal.xlsx"; + TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "fill" + File.separator + "horizontal.xlsx"; String fileName = TestFileUtil.getPath() + "horizontalFill" + System.currentTimeMillis() + ".xlsx"; ExcelWriter excelWriter = EasyExcel.write(fileName).withTemplate(templateFileName).build(); @@ -203,7 +203,7 @@ public class FillTest { // 模板注意 用{} 来表示你要用的变量 如果本来就有"{","}" 特殊字符 用"\{","\}"代替 // {} 代表普通变量 {.} 代表是list的变量 {前缀.} 前缀可以区分不同的list String templateFileName = - TestFileUtil.getPath() + "demo" + File.separator + "fill" + File.separator + "composite.xlsx"; + TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "fill" + File.separator + "composite.xlsx"; String fileName = TestFileUtil.getPath() + "compositeFill" + System.currentTimeMillis() + ".xlsx"; ExcelWriter excelWriter = EasyExcel.write(fileName).withTemplate(templateFileName).build(); diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/CellDataDemoHeadDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/CellDataDemoHeadDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/CellDataDemoHeadDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/CellDataDemoHeadDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/CellDataReadDemoData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/CellDataReadDemoData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/CellDataReadDemoData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/CellDataReadDemoData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/ConverterData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/ConverterData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/ConverterData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/ConverterData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/ConverterDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/ConverterDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/ConverterDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/ConverterDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/CustomStringStringConverter.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/CustomStringStringConverter.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/CustomStringStringConverter.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/CustomStringStringConverter.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoDAO.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoDAO.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoDAO.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoDAO.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExceptionListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExceptionListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExceptionListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExceptionListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExtraData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExtraData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExtraData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExtraData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExtraListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExtraListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExtraListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoExtraListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoHeadDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoHeadDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoHeadDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/DemoHeadDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/ExceptionDemoData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/ExceptionDemoData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/ExceptionDemoData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/ExceptionDemoData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/IndexOrNameData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/IndexOrNameData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/IndexOrNameData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/IndexOrNameData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/IndexOrNameDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/IndexOrNameDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/IndexOrNameDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/IndexOrNameDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/NoModelDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/NoModelDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/NoModelDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/NoModelDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java similarity index 87% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java index a97d2c1e..bf56f274 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java @@ -45,7 +45,7 @@ public class ReadTest { public void simpleRead() { // 写法1:JDK8+ ,不用额外写一个DemoDataListener // since: 3.0.0-beta1 - String fileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + String fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "demo.xlsx"; // 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭 // 这里每次会读取3000条数据 然后返回过来 直接调用使用数据就行 EasyExcel.read(fileName, DemoData.class, new PageReadListener(dataList -> { @@ -56,7 +56,7 @@ public class ReadTest { // 写法2: // 匿名内部类 不用额外写一个DemoDataListener - fileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "demo.xlsx"; // 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭 EasyExcel.read(fileName, DemoData.class, new ReadListener() { /** @@ -94,12 +94,12 @@ public class ReadTest { // 有个很重要的点 DemoDataListener 不能被spring管理,要每次读取excel都要new,然后里面用到spring可以构造方法传进去 // 写法3: - fileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "demo.xlsx"; // 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭 EasyExcel.read(fileName, DemoData.class, new DemoDataListener()).sheet().doRead(); // 写法4: - fileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "demo.xlsx"; // 一个文件一个reader ExcelReader excelReader = null; try { @@ -128,7 +128,7 @@ public class ReadTest { */ @Test public void indexOrNameRead() { - String fileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + String fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "demo.xlsx"; // 这里默认读取第一个sheet EasyExcel.read(fileName, IndexOrNameData.class, new IndexOrNameDataListener()).sheet().doRead(); } @@ -144,13 +144,13 @@ public class ReadTest { */ @Test public void repeatedRead() { - String fileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + String fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "demo.xlsx"; // 读取全部sheet // 这里需要注意 DemoDataListener的doAfterAllAnalysed 会在每个sheet读取完毕后调用一次。然后所有sheet都会往同一个DemoDataListener里面写 EasyExcel.read(fileName, DemoData.class, new DemoDataListener()).doReadAll(); // 读取部分sheet - fileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "demo.xlsx"; ExcelReader excelReader = null; try { excelReader = EasyExcel.read(fileName).build(); @@ -183,7 +183,7 @@ public class ReadTest { */ @Test public void converterRead() { - String fileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + String fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "demo.xlsx"; // 这里 需要指定读用哪个class去读,然后读取第一个sheet EasyExcel.read(fileName, ConverterData.class, new ConverterDataListener()) // 这里注意 我们也可以registerConverter来指定自定义转换器, 但是这个转换变成全局了, 所有java为string,excel为string的都会用这个转换器。 @@ -206,7 +206,7 @@ public class ReadTest { */ @Test public void complexHeaderRead() { - String fileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + String fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "demo.xlsx"; // 这里 需要指定读用哪个class去读,然后读取第一个sheet EasyExcel.read(fileName, DemoData.class, new DemoDataListener()).sheet() // 这里可以设置1,因为头就是一行。如果多行头,可以设置其他值。不传入也可以,因为默认会根据DemoData 来解析,他没有指定头,也就是默认1行 @@ -225,7 +225,7 @@ public class ReadTest { */ @Test public void headerRead() { - String fileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + String fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "demo.xlsx"; // 这里 需要指定读用哪个class去读,然后读取第一个sheet EasyExcel.read(fileName, DemoData.class, new DemoHeadDataListener()).sheet().doRead(); } @@ -246,7 +246,7 @@ public class ReadTest { */ @Test public void extraRead() { - String fileName = TestFileUtil.getPath() + "demo" + File.separator + "extra.xlsx"; + String fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "extra.xlsx"; // 这里 需要指定读用哪个class去读,然后读取第一个sheet EasyExcel.read(fileName, DemoExtraData.class, new DemoExtraListener()) // 需要读取批注 默认不读取 @@ -271,7 +271,7 @@ public class ReadTest { */ @Test public void cellDataRead() { - String fileName = TestFileUtil.getPath() + "demo" + File.separator + "cellDataDemo.xlsx"; + String fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "cellDataDemo.xlsx"; // 这里 需要指定读用哪个class去读,然后读取第一个sheet EasyExcel.read(fileName, CellDataReadDemoData.class, new CellDataDemoHeadDataListener()).sheet().doRead(); } @@ -288,7 +288,7 @@ public class ReadTest { */ @Test public void exceptionRead() { - String fileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + String fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "demo.xlsx"; // 这里 需要指定读用哪个class去读,然后读取第一个sheet EasyExcel.read(fileName, ExceptionDemoData.class, new DemoExceptionListener()).sheet().doRead(); } @@ -298,7 +298,7 @@ public class ReadTest { */ @Test public void synchronousRead() { - String fileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + String fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "demo.xlsx"; // 这里 需要指定读用哪个class去读,然后读取第一个sheet 同步读取会自动finish List list = EasyExcel.read(fileName).head(DemoData.class).sheet().doReadSync(); for (DemoData data : list) { @@ -318,7 +318,7 @@ public class ReadTest { */ @Test public void noModelRead() { - String fileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + String fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "demo.xlsx"; // 这里 只要,然后读取第一个sheet 同步读取会自动finish EasyExcel.read(fileName, new NoModelDataListener()).sheet().doRead(); } diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/web/DownloadData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/DownloadData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/web/DownloadData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/DownloadData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/web/EasyexcelApplication.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/EasyexcelApplication.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/web/EasyexcelApplication.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/EasyexcelApplication.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadDAO.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadDAO.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadDAO.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadDAO.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/UploadDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/web/WebTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/WebTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/web/WebTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/WebTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/CommentWriteHandler.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/CommentWriteHandler.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/CommentWriteHandler.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/CommentWriteHandler.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/ComplexHeadData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/ComplexHeadData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/ComplexHeadData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/ComplexHeadData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/ConverterData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/ConverterData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/ConverterData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/ConverterData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/CustomCellWriteHandler.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/CustomCellWriteHandler.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/CustomCellWriteHandler.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/CustomCellWriteHandler.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/CustomSheetWriteHandler.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/CustomSheetWriteHandler.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/CustomSheetWriteHandler.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/CustomSheetWriteHandler.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/CustomStringStringConverter.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/CustomStringStringConverter.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/CustomStringStringConverter.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/CustomStringStringConverter.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoMergeData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoMergeData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoMergeData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoMergeData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoStyleData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoStyleData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoStyleData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/DemoStyleData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDataWithAnnotation.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDataWithAnnotation.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDataWithAnnotation.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDataWithAnnotation.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDemoData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDemoData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDemoData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/ImageDemoData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/IndexData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/IndexData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/IndexData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/IndexData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/LongestMatchColumnWidthData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/LongestMatchColumnWidthData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/LongestMatchColumnWidthData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/LongestMatchColumnWidthData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/WidthAndHeightData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/WidthAndHeightData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/WidthAndHeightData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/WidthAndHeightData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteCellDemoData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteCellDemoData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteCellDemoData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteCellDemoData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java similarity index 99% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java index 41372f6a..462511c3 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java @@ -267,7 +267,7 @@ public class WriteTest { public void imageWrite() throws Exception { String fileName = TestFileUtil.getPath() + "imageWrite" + System.currentTimeMillis() + ".xlsx"; - String imagePath = TestFileUtil.getPath() + "converter" + File.separator + "img.jpg"; + String imagePath = TestFileUtil.getPath() + "easyexcel-test/test/resources/converter" + File.separator + "img.jpg"; try (InputStream inputStream = FileUtils.openInputStream(new File(imagePath))) { List list = ListUtils.newArrayList(); ImageDemoData imageDemoData = new ImageDemoData(); @@ -419,7 +419,7 @@ public class WriteTest { */ @Test public void templateWrite() { - String templateFileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + String templateFileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "demo.xlsx"; String fileName = TestFileUtil.getPath() + "templateWrite" + System.currentTimeMillis() + ".xlsx"; // 这里 需要指定写用哪个class去写,然后写到第一个sheet,名字为模板 然后文件流会自动关闭 EasyExcel.write(fileName, DemoData.class).withTemplate(templateFileName).sheet().doWrite(data()); diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/CamlData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/CamlData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/CamlData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/CamlData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/FillTempTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/FillTempTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/FillTempTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/FillTempTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/LockData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/LockData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/LockData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/LockData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/LockDataListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/LockDataListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/LockDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/LockDataListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/LockTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/LockTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/LockTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/LockTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/StyleData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/StyleData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/StyleData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/StyleData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/StyleTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/StyleTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/StyleTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/StyleTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/TempFillData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/TempFillData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/TempFillData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/TempFillData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/WriteLargeTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/WriteLargeTest.java similarity index 93% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/WriteLargeTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/WriteLargeTest.java index 23f623b6..34ff7a3a 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/WriteLargeTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/WriteLargeTest.java @@ -33,7 +33,7 @@ public class WriteLargeTest { @Test public void test() throws Exception { // 方法2 如果写到不同的sheet 同一个对象 - String fileName = TestFileUtil.getPath() + "large" + System.currentTimeMillis() + ".xlsx"; + String fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/large" + System.currentTimeMillis() + ".xlsx"; // 头的策略 WriteCellStyle headWriteCellStyle = new WriteCellStyle(); // 背景设置为红色 @@ -69,7 +69,7 @@ public class WriteLargeTest { @Test public void test2() throws Exception { // 方法2 如果写到不同的sheet 同一个对象 - String fileName = TestFileUtil.getPath() + "large" + System.currentTimeMillis() + ".xlsx"; + String fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/large" + System.currentTimeMillis() + ".xlsx"; ExcelWriter excelWriter = EasyExcel.write(fileName, LargeData.class).build(); WriteSheet writeSheet = EasyExcel.writerSheet().build(); diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/WriteV33Test.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/WriteV33Test.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/WriteV33Test.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/WriteV33Test.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/WriteV34Test.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/WriteV34Test.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/WriteV34Test.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/WriteV34Test.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/Xls03Test.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/Xls03Test.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/Xls03Test.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/Xls03Test.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/bug/DataType.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/bug/DataType.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/bug/DataType.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/bug/DataType.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/bug/ExcelCreat.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/bug/ExcelCreat.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/bug/ExcelCreat.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/bug/ExcelCreat.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/bug/HeadType.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/bug/HeadType.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/bug/HeadType.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/bug/HeadType.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/cache/CacheTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/cache/CacheTest.java similarity index 86% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/cache/CacheTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/cache/CacheTest.java index 43edce59..adcef54a 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/cache/CacheTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/cache/CacheTest.java @@ -4,12 +4,6 @@ import java.io.File; import java.util.HashMap; import java.util.UUID; -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.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.ehcache.Cache; import org.ehcache.PersistentCacheManager; import org.ehcache.config.builders.CacheConfigurationBuilder; diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvDataListeer.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvDataListeer.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvDataListeer.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvDataListeer.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvReadTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvReadTest.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvReadTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/csv/CsvReadTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/data/DataType.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/data/DataType.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/data/DataType.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/data/DataType.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/data/HeadType.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/data/HeadType.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/data/HeadType.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/data/HeadType.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatTest.java similarity index 98% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatTest.java index 4440f350..01046ce4 100644 --- a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatTest.java @@ -132,7 +132,7 @@ public class DataFormatTest { @Test public void test355() throws IOException, InvalidFormatException { - File file = TestFileUtil.readFile("dataformat" + File.separator + "dataformat.xlsx"); + File file = TestFileUtil.readFile("easyexcel-test/test/resources/dataformat" + File.separator + "dataformat.xlsx"); XSSFWorkbook xssfWorkbook = new XSSFWorkbook(file); Sheet xssfSheet = xssfWorkbook.getSheetAt(0); DataFormatter d = new DataFormatter(Locale.CHINA); diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatter1.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatter1.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatter1.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatter1.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/fill/FillData2.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/fill/FillData2.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/fill/FillData2.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/fill/FillData2.java diff --git a/easyexcel-core/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 similarity index 93% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/fill/FillTempTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/fill/FillTempTest.java index 2c201863..a538ab88 100644 --- a/easyexcel-core/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 @@ -64,7 +64,7 @@ public class FillTempTest { // 模板注意 用{} 来表示你要用的变量 如果本来就有"{","}" 特殊字符 用"\{","\}"代替 // 填充list 的时候还要注意 模板中{.} 多了个点 表示list String templateFileName = - TestFileUtil.getPath() + "demo" + File.separator + "fill" + File.separator + "list.xlsx"; + TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "fill" + File.separator + "list.xlsx"; // 方案1 一下子全部放到内存里面 并填充 String fileName = TestFileUtil.getPath() + "listFill" + System.currentTimeMillis() + ".xlsx"; @@ -91,7 +91,7 @@ public class FillTempTest { // 模板注意 用{} 来表示你要用的变量 如果本来就有"{","}" 特殊字符 用"\{","\}"代替 // {} 代表普通变量 {.} 代表是list的变量 String templateFileName = - TestFileUtil.getPath() + "demo" + File.separator + "fill" + File.separator + "complex.xlsx"; + TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "fill" + File.separator + "complex.xlsx"; String fileName = TestFileUtil.getPath() + "complexFill" + System.currentTimeMillis() + ".xlsx"; ExcelWriter excelWriter = EasyExcel.write(fileName).withTemplate(templateFileName).build(); @@ -123,7 +123,7 @@ public class FillTempTest { // {} 代表普通变量 {.} 代表是list的变量 // 这里模板 删除了list以后的数据,也就是统计的这一行 String templateFileName = - TestFileUtil.getPath() + "demo" + File.separator + "fill" + File.separator + "complexFillWithTable.xlsx"; + TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "fill" + File.separator + "complexFillWithTable.xlsx"; String fileName = TestFileUtil.getPath() + "complexFillWithTable" + System.currentTimeMillis() + ".xlsx"; ExcelWriter excelWriter = EasyExcel.write(fileName).withTemplate(templateFileName).build(); @@ -164,7 +164,7 @@ public class FillTempTest { // 模板注意 用{} 来表示你要用的变量 如果本来就有"{","}" 特殊字符 用"\{","\}"代替 // {} 代表普通变量 {.} 代表是list的变量 String templateFileName = - TestFileUtil.getPath() + "demo" + File.separator + "fill" + File.separator + "horizontal.xlsx"; + TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "fill" + File.separator + "horizontal.xlsx"; String fileName = TestFileUtil.getPath() + "horizontalFill" + System.currentTimeMillis() + ".xlsx"; ExcelWriter excelWriter = EasyExcel.write(fileName).withTemplate(templateFileName).build(); @@ -191,7 +191,7 @@ public class FillTempTest { // 模板注意 用{} 来表示你要用的变量 如果本来就有"{","}" 特殊字符 用"\{","\}"代替 // {} 代表普通变量 {.} 代表是list的变量 {前缀.} 前缀可以区分不同的list String templateFileName = - TestFileUtil.getPath() + "demo" + File.separator + "fill" + File.separator + "composite.xlsx"; + TestFileUtil.getPath() + "easyexcel-test/test/resources/demo" + File.separator + "fill" + File.separator + "composite.xlsx"; String fileName = TestFileUtil.getPath() + "compositeFill" + System.currentTimeMillis() + ".xlsx"; ExcelWriter excelWriter = EasyExcel.write(fileName).withTemplate(templateFileName).build(); diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Data1662.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Data1662.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Data1662.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Data1662.java diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Issue1662Test.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Issue1662Test.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/issue1663/FillData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue1663/FillData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/issue1663/FillData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue1663/FillData.java diff --git a/easyexcel-core/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 similarity index 88% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/issue1663/FillTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue1663/FillTest.java index 7f89621c..aa4de2b9 100644 --- a/easyexcel-core/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 @@ -23,9 +23,9 @@ public class FillTest { @Test public void TestFillNullPoint(){ String templateFileName = - TestFileUtil.getPath() + "temp/issue1663" + File.separator + "template.xlsx"; + TestFileUtil.getPath() + "easyexcel-test/test/resources/temp/issue1663" + File.separator + "template.xlsx"; - String fileName = TestFileUtil.getPath() + "temp/issue1663" + File.separator + "issue1663.xlsx"; + String fileName = TestFileUtil.getPath() + "easyexcel-test/test/resources/temp/issue1663" + File.separator + "issue1663.xlsx"; ExcelWriter excelWriter = EasyExcel.write(fileName).withTemplate(templateFileName).build(); WriteSheet writeSheet = EasyExcel.writerSheet().build(); FillConfig fillConfig = FillConfig.builder().direction(WriteDirectionEnum.VERTICAL).build(); diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue2443/Issue2443.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue2443/Issue2443.java new file mode 100644 index 00000000..45309c9f --- /dev/null +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue2443/Issue2443.java @@ -0,0 +1,15 @@ +package com.alibaba.easyexcel.test.temp.issue2443; + +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +import java.util.Date; + +@Getter +@Setter +@EqualsAndHashCode +public class Issue2443 { + private int a; + private int b; +} 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 new file mode 100644 index 00000000..57484b74 --- /dev/null +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/issue2443/Issue2443Test.java @@ -0,0 +1,56 @@ +package com.alibaba.easyexcel.test.temp.issue2443; + +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.read.listener.PageReadListener; +import com.alibaba.fastjson.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; + +@Ignore +@Slf4j +public class Issue2443Test { + //CS304 (manually written) Issue link: https://github.com/alibaba/easyexcel/issues/2443 + @Test + public void IssueTest1() { + String fileName = TestFileUtil.getPath() + "temp/issue2443" + File.separator + "date1.xlsx"; + EasyExcel.read(fileName, Issue2443.class, new PageReadListener(dataList -> { + for (Issue2443 issueData : dataList) { + log.info("读取到一条数据{}", JSON.toJSONString(issueData)); + } + })).sheet().doRead(); + } + //CS304 (manually written) Issue link: https://github.com/alibaba/easyexcel/issues/2443 + @Test + public void IssueTest2() { + String fileName = TestFileUtil.getPath() + "temp/issue2443" + File.separator + "date2.xlsx"; + EasyExcel.read(fileName, Issue2443.class, new PageReadListener(dataList -> { + for (Issue2443 issueData : dataList) { + log.info("读取到一条数据{}", JSON.toJSONString(issueData)); + } + })).sheet().doRead(); + } + + @Test + public void parseIntegerTest1() throws ParseException { + String string = "1.00"; + ExcelContentProperty contentProperty = null; + int Int = NumberUtils.parseInteger(string,contentProperty); + 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); + } + +} diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/large/LargeData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/LargeData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/large/LargeData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/LargeData.java diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/large/LargeDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/LargeDataListener.java diff --git a/easyexcel-core/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 similarity index 95% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/large/NoModelLargeDataListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/NoModelLargeDataListener.java index 715dc4f4..aff72adf 100644 --- a/easyexcel-core/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,7 +2,6 @@ package com.alibaba.easyexcel.test.temp.large; import java.util.Map; -import org.apache.poi.ss.formula.functions.Index; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/easyexcel-core/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 similarity index 94% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/large/TempLargeDataTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/large/TempLargeDataTest.java index 934b62f5..8a6b8625 100644 --- a/easyexcel-core/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 @@ -45,10 +45,10 @@ public class TempLargeDataTest { @BeforeClass public static void init() { fileFill07 = TestFileUtil.createNewFile("largefill07.xlsx"); - fileWrite07 = TestFileUtil.createNewFile("large" + File.separator + "fileWrite07.xlsx"); - fileWriteTemp07 = TestFileUtil.createNewFile("large" + File.separator + "fileWriteTemp07.xlsx"); - fileWritePoi07 = TestFileUtil.createNewFile("large" + File.separator + "fileWritePoi07.xlsx"); - template07 = TestFileUtil.readFile("large" + File.separator + "fill.xlsx"); + fileWrite07 = TestFileUtil.createNewFile("easyexcel-test/test/resources/large" + File.separator + "fileWrite07.xlsx"); + fileWriteTemp07 = TestFileUtil.createNewFile("easyexcel-test/test/resources/large" + File.separator + "fileWriteTemp07.xlsx"); + fileWritePoi07 = TestFileUtil.createNewFile("easyexcel-test/test/resources/large" + File.separator + "fileWritePoi07.xlsx"); + template07 = TestFileUtil.readFile("easyexcel-test/test/resources/large" + File.separator + "fill.xlsx"); fileCsv = TestFileUtil.createNewFile("largefileCsv.csv"); } diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi2Test.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi2Test.java diff --git a/easyexcel-core/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 similarity index 75% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi3Test.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi3Test.java index 1ea737c0..4f7a3431 100644 --- a/easyexcel-core/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 @@ -6,23 +6,12 @@ import java.io.OutputStream; import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey; import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackageAccess; 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.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellCopyPolicy; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; -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.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.slf4j.Logger; @@ -41,7 +30,7 @@ public class Poi3Test { @Test public void Encryption() throws Exception { - String file = TestFileUtil.getPath() + "large" + File.separator + "large07.xlsx"; + String file = TestFileUtil.getPath() + "easyexcel-test/test/resources/large" + File.separator + "large07.xlsx"; POIFSFileSystem fs = new POIFSFileSystem(); EncryptionInfo info = new EncryptionInfo(EncryptionMode.agile); Encryptor enc = info.getEncryptor(); diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiEncryptTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiEncryptTest.java diff --git a/easyexcel-core/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 similarity index 87% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiFormatTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiFormatTest.java index a9e2ce36..b20004a9 100644 --- a/easyexcel-core/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 @@ -1,18 +1,13 @@ package com.alibaba.easyexcel.test.temp.poi; -import java.io.File; import java.io.IOException; import java.util.Locale; -import org.apache.poi.hssf.usermodel.HSSFDataFormatter; import org.apache.poi.ss.usermodel.DataFormatter; -import org.apache.poi.ss.usermodel.DateUtil; -import org.apache.poi.ss.usermodel.Row; 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.XSSFCell; -import org.apache.poi.xssf.usermodel.XSSFDataFormat; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -21,8 +16,6 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.alibaba.easyexcel.test.util.TestFileUtil; - /** * 测试poi * diff --git a/easyexcel-core/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 similarity index 92% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiTest.java index e27136d4..e83f7a7d 100644 --- a/easyexcel-core/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 @@ -176,7 +176,7 @@ public class PoiTest { @Test public void lastRowNum233() throws IOException { - String file = TestFileUtil.getPath() + "fill" + File.separator + "simple.xlsx"; + String file = TestFileUtil.getPath() + "easyexcel-test/test/resources/fill" + File.separator + "simple.xlsx"; Workbook xx = new XSSFWorkbook(file); System.out.println(new File(file).exists()); @@ -231,7 +231,7 @@ public class PoiTest { @Test public void lastRowNum2333() throws IOException, InvalidFormatException { - String file = TestFileUtil.getPath() + "fill" + File.separator + "simple.xlsx"; + String file = TestFileUtil.getPath() + "easyexcel-test/test/resources/fill" + File.separator + "simple.xlsx"; XSSFWorkbook xssfWorkbook = new XSSFWorkbook(new File(file)); SXSSFWorkbook sxssfWorkbook = new SXSSFWorkbook(xssfWorkbook); Sheet xssfSheet = xssfWorkbook.getSheetAt(0); @@ -248,14 +248,14 @@ public class PoiTest { @Test public void testread() throws IOException { - String file = TestFileUtil.getPath() + "fill" + File.separator + "simple.xlsx"; + String file = TestFileUtil.getPath() + "easyexcel-test/test/resources/fill" + File.separator + "simple.xlsx"; SXSSFWorkbook xssfWorkbook = new SXSSFWorkbook(new XSSFWorkbook(file)); Sheet xssfSheet = xssfWorkbook.getXSSFWorkbook().getSheetAt(0); // // Cell cell = xssfSheet.getRow(0).createCell(9); - String file1 = TestFileUtil.getPath() + "fill" + File.separator + "simple.xlsx"; + String file1 = TestFileUtil.getPath() + "easyexcel-test/test/resources/fill" + File.separator + "simple.xlsx"; SXSSFWorkbook xssfWorkbook1 = new SXSSFWorkbook(new XSSFWorkbook(file1)); Sheet xssfSheet1 = xssfWorkbook1.getXSSFWorkbook().getSheetAt(0); @@ -268,13 +268,13 @@ public class PoiTest { @Test public void testreadRead() throws IOException { - String file = TestFileUtil.getPath() + "fill" + File.separator + "simple.xlsx"; + String file = TestFileUtil.getPath() + "easyexcel-test/test/resources/fill" + File.separator + "simple.xlsx"; FileUtils.readFileToByteArray(new File(file)); } @Test public void lastRowNum2332222() throws IOException { - String file = TestFileUtil.getPath() + "fill" + File.separator + "simple.xlsx"; + String file = TestFileUtil.getPath() + "easyexcel-test/test/resources/fill" + File.separator + "simple.xlsx"; SXSSFWorkbook xssfWorkbook = new SXSSFWorkbook(new XSSFWorkbook(file)); Sheet xssfSheet = xssfWorkbook.getXSSFWorkbook().getSheetAt(0); @@ -287,7 +287,7 @@ public class PoiTest { @Test public void lastRowNum23443() throws IOException { - String file = TestFileUtil.getPath() + "fill" + File.separator + "simple.xlsx"; + String file = TestFileUtil.getPath() + "easyexcel-test/test/resources/fill" + File.separator + "simple.xlsx"; SXSSFWorkbook xssfWorkbook = new SXSSFWorkbook(new XSSFWorkbook(file)); Sheet xssfSheet = xssfWorkbook.getSheetAt(0); @@ -298,7 +298,7 @@ public class PoiTest { @Test public void lastRowNum2() throws IOException { - String file = TestFileUtil.getPath() + "fill" + File.separator + "simple.xlsx"; + String file = TestFileUtil.getPath() + "easyexcel-test/test/resources/fill" + File.separator + "simple.xlsx"; SXSSFWorkbook xssfWorkbook = new SXSSFWorkbook(new XSSFWorkbook(file)); Sheet xssfSheet = xssfWorkbook.getXSSFWorkbook().getSheetAt(0); LOGGER.info("一共行数:{}", xssfSheet.getPhysicalNumberOfRows()); @@ -309,7 +309,7 @@ public class PoiTest { @Test public void lastRowNumXSSF2() throws IOException { - String file = TestFileUtil.getPath() + "fill" + File.separator + "simple.xlsx"; + String file = TestFileUtil.getPath() + "easyexcel-test/test/resources/fill" + File.separator + "simple.xlsx"; XSSFWorkbook xssfWorkbook = new XSSFWorkbook(file); LOGGER.info("一共:{}个sheet", xssfWorkbook.getNumberOfSheets()); XSSFSheet xssfSheet = xssfWorkbook.getSheetAt(0); diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiWriteTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiWriteTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/poi/TestCell.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/TestCell.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/poi/TestCell.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/poi/TestCell.java diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/read/CommentTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/CommentTest.java diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/read/HDListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HDListener.java diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadListener.java diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadData.java diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/read/TestListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/TestListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/read/TestListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/read/TestListener.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData1.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData1.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData1.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData1.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData2.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData2.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData2.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/DemoData2.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgListener.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgListener.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgListener.java diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/JsonData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/JsonData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/JsonData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/JsonData.java diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/RepeatListener.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/RepeatListener.java diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/RepeatTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/RepeatTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/Wirte.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/Wirte.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/Wirte.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/Wirte.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteCellHandler.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteCellHandler.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteCellHandler.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteCellHandler.java diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteData.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteHandler.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteHandler.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteHandler.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/simple/WriteHandler.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/write/TempWriteData.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/write/TempWriteData.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/write/TempWriteData.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/write/TempWriteData.java diff --git a/easyexcel-core/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 similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/write/TempWriteTest.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/write/TempWriteTest.java diff --git a/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/util/TestFileUtil.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/util/TestFileUtil.java similarity index 100% rename from easyexcel-core/src/test/java/com/alibaba/easyexcel/test/util/TestFileUtil.java rename to easyexcel-test/src/test/java/com/alibaba/easyexcel/test/util/TestFileUtil.java diff --git a/easyexcel-core/src/test/resources/converter/converter03.xls b/easyexcel-test/src/test/resources/converter/converter03.xls similarity index 100% rename from easyexcel-core/src/test/resources/converter/converter03.xls rename to easyexcel-test/src/test/resources/converter/converter03.xls diff --git a/easyexcel-core/src/test/resources/converter/converter07.xlsx b/easyexcel-test/src/test/resources/converter/converter07.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/converter/converter07.xlsx rename to easyexcel-test/src/test/resources/converter/converter07.xlsx diff --git a/easyexcel-core/src/test/resources/converter/converterCsv.csv b/easyexcel-test/src/test/resources/converter/converterCsv.csv similarity index 100% rename from easyexcel-core/src/test/resources/converter/converterCsv.csv rename to easyexcel-test/src/test/resources/converter/converterCsv.csv diff --git a/easyexcel-core/src/test/resources/converter/img.jpg b/easyexcel-test/src/test/resources/converter/img.jpg similarity index 100% rename from easyexcel-core/src/test/resources/converter/img.jpg rename to easyexcel-test/src/test/resources/converter/img.jpg diff --git a/easyexcel-core/src/test/resources/dataformat/dataformat.xls b/easyexcel-test/src/test/resources/dataformat/dataformat.xls similarity index 100% rename from easyexcel-core/src/test/resources/dataformat/dataformat.xls rename to easyexcel-test/src/test/resources/dataformat/dataformat.xls diff --git a/easyexcel-core/src/test/resources/dataformat/dataformat.xlsx b/easyexcel-test/src/test/resources/dataformat/dataformat.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/dataformat/dataformat.xlsx rename to easyexcel-test/src/test/resources/dataformat/dataformat.xlsx diff --git a/easyexcel-core/src/test/resources/demo/cellDataDemo.xlsx b/easyexcel-test/src/test/resources/demo/cellDataDemo.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/demo/cellDataDemo.xlsx rename to easyexcel-test/src/test/resources/demo/cellDataDemo.xlsx diff --git a/easyexcel-core/src/test/resources/demo/demo.xlsx b/easyexcel-test/src/test/resources/demo/demo.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/demo/demo.xlsx rename to easyexcel-test/src/test/resources/demo/demo.xlsx diff --git a/easyexcel-core/src/test/resources/demo/extra.xlsx b/easyexcel-test/src/test/resources/demo/extra.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/demo/extra.xlsx rename to easyexcel-test/src/test/resources/demo/extra.xlsx diff --git a/easyexcel-core/src/test/resources/demo/fill/complex.xlsx b/easyexcel-test/src/test/resources/demo/fill/complex.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/demo/fill/complex.xlsx rename to easyexcel-test/src/test/resources/demo/fill/complex.xlsx diff --git a/easyexcel-core/src/test/resources/demo/fill/complexFillWithTable.xlsx b/easyexcel-test/src/test/resources/demo/fill/complexFillWithTable.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/demo/fill/complexFillWithTable.xlsx rename to easyexcel-test/src/test/resources/demo/fill/complexFillWithTable.xlsx diff --git a/easyexcel-core/src/test/resources/demo/fill/composite.xlsx b/easyexcel-test/src/test/resources/demo/fill/composite.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/demo/fill/composite.xlsx rename to easyexcel-test/src/test/resources/demo/fill/composite.xlsx diff --git a/easyexcel-core/src/test/resources/demo/fill/horizontal.xlsx b/easyexcel-test/src/test/resources/demo/fill/horizontal.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/demo/fill/horizontal.xlsx rename to easyexcel-test/src/test/resources/demo/fill/horizontal.xlsx diff --git a/easyexcel-core/src/test/resources/demo/fill/list.xlsx b/easyexcel-test/src/test/resources/demo/fill/list.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/demo/fill/list.xlsx rename to easyexcel-test/src/test/resources/demo/fill/list.xlsx diff --git a/easyexcel-core/src/test/resources/demo/fill/simple.xlsx b/easyexcel-test/src/test/resources/demo/fill/simple.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/demo/fill/simple.xlsx rename to easyexcel-test/src/test/resources/demo/fill/simple.xlsx diff --git a/easyexcel-core/src/test/resources/extra/extra.xls b/easyexcel-test/src/test/resources/extra/extra.xls similarity index 100% rename from easyexcel-core/src/test/resources/extra/extra.xls rename to easyexcel-test/src/test/resources/extra/extra.xls diff --git a/easyexcel-core/src/test/resources/extra/extra.xlsx b/easyexcel-test/src/test/resources/extra/extra.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/extra/extra.xlsx rename to easyexcel-test/src/test/resources/extra/extra.xlsx diff --git a/easyexcel-core/src/test/resources/fill/annotation.xls b/easyexcel-test/src/test/resources/fill/annotation.xls similarity index 100% rename from easyexcel-core/src/test/resources/fill/annotation.xls rename to easyexcel-test/src/test/resources/fill/annotation.xls diff --git a/easyexcel-core/src/test/resources/fill/annotation.xlsx b/easyexcel-test/src/test/resources/fill/annotation.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/fill/annotation.xlsx rename to easyexcel-test/src/test/resources/fill/annotation.xlsx diff --git a/easyexcel-core/src/test/resources/fill/byName.xls b/easyexcel-test/src/test/resources/fill/byName.xls similarity index 100% rename from easyexcel-core/src/test/resources/fill/byName.xls rename to easyexcel-test/src/test/resources/fill/byName.xls diff --git a/easyexcel-core/src/test/resources/fill/byName.xlsx b/easyexcel-test/src/test/resources/fill/byName.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/fill/byName.xlsx rename to easyexcel-test/src/test/resources/fill/byName.xlsx diff --git a/easyexcel-core/src/test/resources/fill/complex.xls b/easyexcel-test/src/test/resources/fill/complex.xls similarity index 100% rename from easyexcel-core/src/test/resources/fill/complex.xls rename to easyexcel-test/src/test/resources/fill/complex.xls diff --git a/easyexcel-core/src/test/resources/fill/complex.xlsx b/easyexcel-test/src/test/resources/fill/complex.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/fill/complex.xlsx rename to easyexcel-test/src/test/resources/fill/complex.xlsx diff --git a/easyexcel-core/src/test/resources/fill/composite.xls b/easyexcel-test/src/test/resources/fill/composite.xls similarity index 100% rename from easyexcel-core/src/test/resources/fill/composite.xls rename to easyexcel-test/src/test/resources/fill/composite.xls diff --git a/easyexcel-core/src/test/resources/fill/composite.xlsx b/easyexcel-test/src/test/resources/fill/composite.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/fill/composite.xlsx rename to easyexcel-test/src/test/resources/fill/composite.xlsx diff --git a/easyexcel-core/src/test/resources/fill/horizontal.xls b/easyexcel-test/src/test/resources/fill/horizontal.xls similarity index 100% rename from easyexcel-core/src/test/resources/fill/horizontal.xls rename to easyexcel-test/src/test/resources/fill/horizontal.xls diff --git a/easyexcel-core/src/test/resources/fill/horizontal.xlsx b/easyexcel-test/src/test/resources/fill/horizontal.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/fill/horizontal.xlsx rename to easyexcel-test/src/test/resources/fill/horizontal.xlsx diff --git a/easyexcel-core/src/test/resources/fill/simple.csv b/easyexcel-test/src/test/resources/fill/simple.csv similarity index 100% rename from easyexcel-core/src/test/resources/fill/simple.csv rename to easyexcel-test/src/test/resources/fill/simple.csv diff --git a/easyexcel-core/src/test/resources/fill/simple.xls b/easyexcel-test/src/test/resources/fill/simple.xls similarity index 100% rename from easyexcel-core/src/test/resources/fill/simple.xls rename to easyexcel-test/src/test/resources/fill/simple.xls diff --git a/easyexcel-core/src/test/resources/fill/simple.xlsx b/easyexcel-test/src/test/resources/fill/simple.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/fill/simple.xlsx rename to easyexcel-test/src/test/resources/fill/simple.xlsx diff --git a/easyexcel-core/src/test/resources/fill/style.xls b/easyexcel-test/src/test/resources/fill/style.xls similarity index 100% rename from easyexcel-core/src/test/resources/fill/style.xls rename to easyexcel-test/src/test/resources/fill/style.xls diff --git a/easyexcel-core/src/test/resources/fill/style.xlsx b/easyexcel-test/src/test/resources/fill/style.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/fill/style.xlsx rename to easyexcel-test/src/test/resources/fill/style.xlsx diff --git a/easyexcel-core/src/test/resources/large/fill.xlsx b/easyexcel-test/src/test/resources/large/fill.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/large/fill.xlsx rename to easyexcel-test/src/test/resources/large/fill.xlsx diff --git a/easyexcel-core/src/test/resources/large/large07.xlsx b/easyexcel-test/src/test/resources/large/large07.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/large/large07.xlsx rename to easyexcel-test/src/test/resources/large/large07.xlsx diff --git a/easyexcel-core/src/test/resources/logback.xml b/easyexcel-test/src/test/resources/logback.xml similarity index 100% rename from easyexcel-core/src/test/resources/logback.xml rename to easyexcel-test/src/test/resources/logback.xml diff --git a/easyexcel-core/src/test/resources/multiplesheets/multiplesheets.xls b/easyexcel-test/src/test/resources/multiplesheets/multiplesheets.xls similarity index 100% rename from easyexcel-core/src/test/resources/multiplesheets/multiplesheets.xls rename to easyexcel-test/src/test/resources/multiplesheets/multiplesheets.xls diff --git a/easyexcel-core/src/test/resources/multiplesheets/multiplesheets.xlsx b/easyexcel-test/src/test/resources/multiplesheets/multiplesheets.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/multiplesheets/multiplesheets.xlsx rename to easyexcel-test/src/test/resources/multiplesheets/multiplesheets.xlsx diff --git a/easyexcel-core/src/test/resources/simple/simple07.xlsx b/easyexcel-test/src/test/resources/simple/simple07.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/simple/simple07.xlsx rename to easyexcel-test/src/test/resources/simple/simple07.xlsx diff --git a/easyexcel-core/src/test/resources/temp/issue1663/template.xlsx b/easyexcel-test/src/test/resources/temp/issue1663/template.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/temp/issue1663/template.xlsx rename to easyexcel-test/src/test/resources/temp/issue1663/template.xlsx diff --git a/easyexcel-test/src/test/resources/temp/issue2443/date1.xlsx b/easyexcel-test/src/test/resources/temp/issue2443/date1.xlsx new file mode 100644 index 00000000..92ef811d Binary files /dev/null and b/easyexcel-test/src/test/resources/temp/issue2443/date1.xlsx differ diff --git a/easyexcel-test/src/test/resources/temp/issue2443/date2.xlsx b/easyexcel-test/src/test/resources/temp/issue2443/date2.xlsx new file mode 100644 index 00000000..c6feb325 Binary files /dev/null and b/easyexcel-test/src/test/resources/temp/issue2443/date2.xlsx differ diff --git a/easyexcel-core/src/test/resources/template/template03.xls b/easyexcel-test/src/test/resources/template/template03.xls similarity index 100% rename from easyexcel-core/src/test/resources/template/template03.xls rename to easyexcel-test/src/test/resources/template/template03.xls diff --git a/easyexcel-core/src/test/resources/template/template07.xlsx b/easyexcel-test/src/test/resources/template/template07.xlsx similarity index 100% rename from easyexcel-core/src/test/resources/template/template07.xlsx rename to easyexcel-test/src/test/resources/template/template07.xlsx diff --git a/pom.xml b/pom.xml index e8a7f9c0..ca9a601c 100644 --- a/pom.xml +++ b/pom.xml @@ -14,6 +14,7 @@ easyexcel-core easyexcel-support + easyexcel-test easyexcel @@ -165,28 +166,6 @@ lombok provided - - - - ch.qos.logback - logback-classic - test - - - com.alibaba - fastjson - test - - - org.springframework.boot - spring-boot-starter-web - test - - - junit - junit - test - @@ -348,17 +327,6 @@ - - org.apache.maven.plugins - maven-surefire-plugin - - - com/alibaba/easyexcel/test/core/**/*.java - - true - - - org.apache.maven.plugins maven-shade-plugin diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillTest.java b/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillTest.java index a83f64a5..29c707d3 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillTest.java @@ -1,3 +1,3 @@ /** - * Documents have been migrated to https://github.com/alibaba/easyexcel/blob/master/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillTest.java + * Documents have been migrated to https://github.com/alibaba/easyexcel/blob/master/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillTest.java */ diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java b/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java index 5c7e8068..b8d7bffc 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java @@ -1,3 +1,3 @@ /** - * Documents have been migrated to https://github.com/alibaba/easyexcel/blob/master/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java + * Documents have been migrated to https://github.com/alibaba/easyexcel/blob/master/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java */ diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/web/WebTest.java b/src/test/java/com/alibaba/easyexcel/test/demo/web/WebTest.java index 3c234d83..c21cd0b2 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/web/WebTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/web/WebTest.java @@ -1,3 +1,3 @@ /** - * Documents have been migrated to https://github.com/alibaba/easyexcel/blob/master/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/web/WebTest.java + * Documents have been migrated to https://github.com/alibaba/easyexcel/blob/master/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/WebTest.java */ diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java b/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java index 340d228f..f152846a 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java @@ -1,3 +1,3 @@ /** - * Documents have been migrated to https://github.com/alibaba/easyexcel/blob/master/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java + * Documents have been migrated to https://github.com/alibaba/easyexcel/blob/master/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java */ diff --git a/update.md b/update.md index 5d576965..05d0ee10 100644 --- a/update.md +++ b/update.md @@ -5,6 +5,8 @@ * 修复CSV不关闭流的bug [Issue #2309](https://github.com/alibaba/easyexcel/issues/2309) * 修复`filed`拼接错误 [Issue #2390](https://github.com/alibaba/easyexcel/issues/2390) * 修复`BigIntegerStringConverter`无效的bug [Issue #2325](https://github.com/alibaba/easyexcel/issues/2325) +* 修复03版本无法读取到公式格式的bug [Issue #2444](https://github.com/alibaba/easyexcel/issues/2444) +* 提高类型转换兼容性 [Issue #2443](https://github.com/alibaba/easyexcel/issues/2443) # 3.0.5