.
This commit is contained in:
parent
4d3afd565e
commit
e141c8b96e
11
pom.xml
11
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>net.tccn</groupId>
|
||||
<artifactId>excel</artifactId>
|
||||
<version>0.1.1</version>
|
||||
<version>0.1.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
@ -27,9 +27,7 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>JExcel</finalName>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<testSourceDirectory>test</testSourceDirectory>
|
||||
<finalName>excel-kit</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>res</directory>
|
||||
@ -39,9 +37,10 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.11.0</version>
|
||||
<configuration>
|
||||
<source>14</source>
|
||||
<target>14</target>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@ -1,8 +1,7 @@
|
||||
package net.tccn.excel.test;
|
||||
package test;
|
||||
|
||||
import net.tccn.kit.poi.ExcelKit;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
@ -17,7 +16,7 @@ import static java.util.Arrays.asList;
|
||||
*/
|
||||
public class ExcelKitTest {
|
||||
|
||||
@Test
|
||||
//@Test
|
||||
public void mapExport() {
|
||||
// 数据List<T> T可以是map,也可以是某个Javabean
|
||||
Map m1 = new HashMap();
|
||||
@ -49,7 +48,7 @@ public class ExcelKitTest {
|
||||
}
|
||||
|
||||
//read excel by fields
|
||||
@Test
|
||||
//@Test
|
||||
public void readTest() throws IOException {
|
||||
/*String sql1 = "select a, b, c from Sheet1";
|
||||
String sql2 = "select a, b, c from Sheet1 where a=1 order by b";
|
||||
@ -75,7 +74,7 @@ public class ExcelKitTest {
|
||||
}
|
||||
|
||||
//read excel no fields
|
||||
@Test
|
||||
//@Test
|
||||
public void readTest2() throws IOException {
|
||||
// 在不传 String[] fields 会把值从左到右分别赋值给 a...z,这样的key上
|
||||
List<Map> list = ExcelKit.readExcel(new File("target/abx.xls"));
|
||||
@ -137,7 +136,7 @@ public class ExcelKitTest {
|
||||
/**
|
||||
* 通用数据导入
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public void importTest() {
|
||||
String key = "user"; // 假定使用业务实体表名作为key
|
||||
|
@ -1,4 +1,4 @@
|
||||
package net.tccn.excel.test;
|
||||
package test;
|
||||
|
||||
import net.tccn.kit.poi.ExcelExportKit;
|
||||
import org.junit.Test;
|
||||
@ -168,7 +168,7 @@ public class ExportKitTest {
|
||||
response.finish(buf.toString().getBytes());
|
||||
}
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public void t() {
|
||||
Object t = new Person();
|
||||
((Person) t).setAge(20);
|
||||
@ -206,7 +206,7 @@ public class ExportKitTest {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
//@Test
|
||||
public void t2() {
|
||||
Person person = new Person();
|
||||
/*person.setName("dsafd''s'f");
|
@ -1,4 +1,4 @@
|
||||
package net.tccn.excel.test;
|
||||
package test;
|
||||
|
||||
import java.util.Date;
|
||||
|
Loading…
Reference in New Issue
Block a user