Skip to content

Commit c5b2a1a

Browse files
committed
see 09/11 log
1 parent 495539e commit c5b2a1a

File tree

7 files changed

+31
-18
lines changed

7 files changed

+31
-18
lines changed

utilcode/src/test/java/com/blankj/utilcode/util/CacheUtilsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* author: Blankj
3333
* blog : http://blankj.com
3434
* time : 2017/05/26
35-
* desc :
35+
* desc : CacheUtils单元测试
3636
* </pre>
3737
*/
3838
@RunWith(RobolectricTestRunner.class)

utilcode/src/test/java/com/blankj/utilcode/util/EncryptUtilsTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
import java.io.File;
99
import java.util.Arrays;
1010

11-
import static com.blankj.utilcode.util.TestConfig.FILE_SEP;
12-
import static com.blankj.utilcode.util.TestConfig.TEST_PATH;
11+
import static com.blankj.utilcode.util.TestConfig.PATH_ENCRYPT;
1312
import static org.junit.Assert.assertEquals;
1413
import static org.junit.Assert.assertTrue;
1514

@@ -428,14 +427,12 @@ public void decryptAES() throws Exception {
428427
);
429428
}
430429

431-
private String path = TEST_PATH + FILE_SEP + "encrypt" + FILE_SEP;
432-
433430
@Test
434431
public void encryptMD5File() throws Exception {
435432
String fileMd5 = "7f138a09169b250e9dcb378140907378";
436433
assertEquals(
437434
fileMd5.toUpperCase(),
438-
EncryptUtils.encryptMD5File2String(new File(path + "MD5.txt"))
435+
EncryptUtils.encryptMD5File2String(new File(PATH_ENCRYPT + "MD5.txt"))
439436
);
440437
}
441438
}

utilcode/src/test/java/com/blankj/utilcode/util/FileIOUtilsTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@
55

66
import java.io.FileInputStream;
77

8-
import static com.blankj.utilcode.util.TestConfig.TEST_PATH;
8+
import static com.blankj.utilcode.util.TestConfig.PATH_FILE;
9+
import static com.blankj.utilcode.util.TestConfig.PATH_TEMP;
910

1011
/**
1112
* <pre>
1213
* author: Blankj
1314
* blog : http://blankj.com
1415
* time : 2017/05/24
15-
* desc :
16+
* desc : FileIOUtils单元测试
1617
* </pre>
1718
*/
1819
public class FileIOUtilsTest {
1920

2021
@Test
2122
public void writeFileFromIS() throws Exception {
22-
Assert.assertTrue(FileIOUtils.writeFileFromIS(TEST_PATH + "NEW.txt", new FileInputStream(TEST_PATH + "UTF8.txt"), false));
23-
Assert.assertTrue(FileIOUtils.writeFileFromIS(TEST_PATH + "NEW.txt", new FileInputStream(TEST_PATH + "UTF8.txt"), true));
23+
Assert.assertTrue(FileIOUtils.writeFileFromIS(PATH_TEMP + "UTF8.txt", new FileInputStream(PATH_FILE + "UTF8.txt"), false));
24+
Assert.assertTrue(FileIOUtils.writeFileFromIS(PATH_TEMP + "UTF8.txt", new FileInputStream(PATH_FILE + "UTF8.txt"), true));
2425
}
2526

2627
@Test

utilcode/src/test/java/com/blankj/utilcode/util/RegexUtilsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* author: Blankj
1313
* blog : http://blankj.com
1414
* time : 2016/08/16
15-
* desc : RegularUtils单元测试
15+
* desc : RegexUtils单元测试
1616
* </pre>
1717
*/
1818
public class RegexUtilsTest {

utilcode/src/test/java/com/blankj/utilcode/util/TestConfig.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* author: Blankj
66
* blog : http://blankj.com
77
* time : 2017/09/10
8-
* desc :
8+
* desc : 单元测试配置文件
99
* </pre>
1010
*/
1111
public class TestConfig {
@@ -21,14 +21,16 @@ public class TestConfig {
2121
if (!projectPath.contains("utilcode")) {
2222
projectPath += FILE_SEP + "utilcode";
2323
}
24-
TEST_PATH = projectPath + FILE_SEP + "src" + FILE_SEP + "test" + FILE_SEP + "res";
24+
TEST_PATH = projectPath + FILE_SEP + "src" + FILE_SEP + "test" + FILE_SEP + "res" + FILE_SEP;
2525
}
2626

27-
static final String PATH_TEMP = TEST_PATH + FILE_SEP + "temp" + FILE_SEP;
27+
static final String PATH_TEMP = TEST_PATH + "temp" + FILE_SEP;
2828

29-
static final String PATH_CACHE = TEST_PATH + FILE_SEP + "cache" + FILE_SEP;
29+
static final String PATH_CACHE = TEST_PATH + "cache" + FILE_SEP;
3030

31-
static final String PATH_FILE = TEST_PATH + FILE_SEP + "file" + FILE_SEP;
31+
static final String PATH_ENCRYPT = TEST_PATH + "encrypt" + FILE_SEP;
3232

33-
static final String PATH_ZIP = TEST_PATH + FILE_SEP + "zip" + FILE_SEP;
33+
static final String PATH_FILE = TEST_PATH + "file" + FILE_SEP;
34+
35+
static final String PATH_ZIP = TEST_PATH + "zip" + FILE_SEP;
3436
}

utilcode/src/test/java/com/blankj/utilcode/util/ZipUtilsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void setUp() throws Exception {
2727
}
2828

2929
@Test
30-
public void testUpZipFile() throws Exception {
30+
public void unzipFile() throws Exception {
3131
System.out.println(ZipUtils.unzipFile(zipFile, PATH_TEMP));
3232
}
3333

utilcode/src/test/res/temp/NEW.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
UTF8
2+
2
3+
3
4+
4
5+
5
6+
6
7+
7UTF8
8+
2
9+
3
10+
4
11+
5
12+
6
13+
7

0 commit comments

Comments
 (0)