|
|
@ -4,12 +4,12 @@ import java.io.File; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
import org.junit.BeforeClass; |
|
|
|
|
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.easyexcel.test.util.TestFileUtil; |
|
|
|
import com.alibaba.easyexcel.test.util.TestFileUtil; |
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.junit.BeforeClass; |
|
|
|
|
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Annotation data test |
|
|
|
* Annotation data test |
|
|
|
* |
|
|
|
* |
|
|
@ -19,11 +19,13 @@ public class AnnotationIndexAndNameDataTest { |
|
|
|
|
|
|
|
|
|
|
|
private static File file07; |
|
|
|
private static File file07; |
|
|
|
private static File file03; |
|
|
|
private static File file03; |
|
|
|
|
|
|
|
private static File fileCsv; |
|
|
|
|
|
|
|
|
|
|
|
@BeforeClass |
|
|
|
@BeforeClass |
|
|
|
public static void init() { |
|
|
|
public static void init() { |
|
|
|
file07 = TestFileUtil.createNewFile("annotationIndexAndName07.xlsx"); |
|
|
|
file07 = TestFileUtil.createNewFile("annotationIndexAndName07.xlsx"); |
|
|
|
file03 = TestFileUtil.createNewFile("annotationIndexAndName03.xls"); |
|
|
|
file03 = TestFileUtil.createNewFile("annotationIndexAndName03.xls"); |
|
|
|
|
|
|
|
fileCsv = TestFileUtil.createNewFile("annotationIndexAndNameCsv.csv"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
@ -36,6 +38,11 @@ public class AnnotationIndexAndNameDataTest { |
|
|
|
readAndWrite(file03); |
|
|
|
readAndWrite(file03); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void t03ReadAndWrite03() { |
|
|
|
|
|
|
|
readAndWrite(fileCsv); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void readAndWrite(File file) { |
|
|
|
private void readAndWrite(File file) { |
|
|
|
EasyExcel.write(file, AnnotationIndexAndNameData.class).sheet().doWrite(data()); |
|
|
|
EasyExcel.write(file, AnnotationIndexAndNameData.class).sheet().doWrite(data()); |
|
|
|
EasyExcel.read(file, AnnotationIndexAndNameData.class, new AnnotationIndexAndNameDataListener()).sheet() |
|
|
|
EasyExcel.read(file, AnnotationIndexAndNameData.class, new AnnotationIndexAndNameDataListener()).sheet() |
|
|
|