Skip to content

Commit b37959a

Browse files
committed
提交代码
1 parent 832f234 commit b37959a

14 files changed

Lines changed: 317 additions & 0 deletions

File tree

‎JavaUnitTest/.classpath‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
5+
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK/JavaUtil"/>
6+
<classpathentry combineaccessrules="false" kind="src" path="/arithmetic"/>
7+
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
8+
<classpathentry combineaccessrules="false" kind="src" path="/JavaUtil"/>
9+
<classpathentry kind="output" path="bin"/>
10+
</classpath>

‎JavaUnitTest/.project‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>JavaUnitTest</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=1.7
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11+
org.eclipse.jdt.core.compiler.source=1.7
535 Bytes
Binary file not shown.
2 KB
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.unittest.arithmetic;
2+
3+
import static org.junit.Assert.*;
4+
5+
import org.junit.Test;
6+
7+
public class ArithmeticTest {
8+
9+
@Test
10+
public void test() {
11+
fail("Not yet implemented");
12+
}
13+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package zjr.amy.excel.test;
2+
3+
import java.io.FileNotFoundException;
4+
import java.io.IOException;
5+
6+
import zjr.amy.excel.ExcelHelper;
7+
8+
public class TestExcelHelper {
9+
10+
/**
11+
* @param args
12+
*/
13+
public static void main(String[] args) {
14+
// TODO Auto-generated method stub
15+
TestGetData();
16+
}
17+
18+
/**
19+
* 测试获取数据
20+
*/
21+
public static void TestGetData() {
22+
try {
23+
String[][] array = ExcelHelper.getData("D:/001code/100java学习/JavaUtil/doc/税费管理20141105100144.xls", 0);
24+
25+
if (array != null && array.length > 0){
26+
for(int i = 0; i < array.length; i++){
27+
System.out.print(i + ": ");
28+
for(int j = 0; j < array[i].length; j ++){
29+
System.out.print(array[i][j] + " ");
30+
}
31+
System.out.println();
32+
}
33+
34+
setData(array, "税费信息");
35+
}
36+
37+
38+
} catch (FileNotFoundException e) {
39+
// TODO Auto-generated catch block
40+
e.printStackTrace();
41+
} catch (IOException e) {
42+
// TODO Auto-generated catch block
43+
e.printStackTrace();
44+
}
45+
}
46+
47+
/**
48+
* 测试写入数据
49+
* @param data 数据
50+
* @param sheetName sheet名称
51+
*/
52+
public static void setData(String [][] data, String sheetName){
53+
String fileName="D:/001code/100java学习/JavaUtil/doc/税费管理20141105100144Copy.xls";
54+
try {
55+
ExcelHelper.setData(fileName, data, sheetName);
56+
} catch (IOException e) {
57+
// TODO Auto-generated catch block
58+
e.printStackTrace();
59+
}
60+
}
61+
}

‎JavaUtil/.classpath‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
5+
<classpathentry kind="lib" path="D:/003technology/7jar/poi3.7/poi3.7/poi-3.7-20101029.jar" sourcepath="D:/003technology/7jar/poi-src-3.10-FINAL-20140208.zip"/>
6+
<classpathentry kind="output" path="bin"/>
7+
</classpath>

‎JavaUtil/.project‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>JavaUtil</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=1.7
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11+
org.eclipse.jdt.core.compiler.source=1.7

0 commit comments

Comments
 (0)