Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from MewX/v1.4
v1.4 release
- Loading branch information
Showing
41 changed files
with
946 additions
and
482 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,8 @@ | |
.idea/ | ||
.DS_Store | ||
/build | ||
|
||
# distributions | ||
baidu/ | ||
coolapk/ | ||
alpha/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
studio-android/LightNovelLibrary/app/proguard-rules-tests.pro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Proguard rules that are applied to your test apk/code. | ||
-ignorewarnings | ||
|
||
-keepattributes *Annotation* | ||
|
||
-dontnote junit.framework.** | ||
-dontnote junit.runner.** | ||
|
||
-dontwarn android.test.** | ||
-dontwarn android.support.test.** | ||
-dontwarn org.junit.** | ||
-dontwarn org.hamcrest.** | ||
-dontwarn com.squareup.javawriter.JavaWriter | ||
# Uncomment this if you use Mockito | ||
-dontwarn org.mockito.** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...ghtNovelLibrary/app/src/androidTest/java/org/mewx/wenku8/global/api/Wenku8ParserTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package org.mewx.wenku8.global.api; | ||
|
||
import android.support.test.filters.SmallTest; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import java.util.GregorianCalendar; | ||
|
||
@SmallTest | ||
public class Wenku8ParserTest { | ||
private final String REVIEW_LIST_XML = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + | ||
"<metadata>\n" + | ||
"<page num='12'/>\n" + | ||
"\n" + | ||
"<item rid='79800' posttime='20130525171631' replies='1' replytime='20130528184916'>\n" + | ||
"<user uid='81669'><![CDATA[老衲0轻音]]></user>\n" + | ||
"<content><![CDATA[前排……]]></content>\n" + | ||
"</item>\n" + | ||
"\n" + | ||
"<item rid='79826' posttime='20130525232002' replies='4' replytime='20130527234259'>\n" + | ||
"<user uid='34924'><![CDATA[冒险奏鸣]]></user>\n" + | ||
"<content><![CDATA[有种神曲奏界的既视感]]></content>\n" + | ||
"</item>\n" + | ||
"\n" + | ||
"</metadata>"; | ||
|
||
// TODO: more tests | ||
|
||
@Test | ||
public void testParseReviewList() { | ||
ReviewList reviewList = new ReviewList(); | ||
Wenku8Parser.parseReviewList(reviewList, REVIEW_LIST_XML); | ||
|
||
Assert.assertEquals(reviewList.getTotalPage(), 12); | ||
Assert.assertEquals(reviewList.getCurrentPage(), 1); | ||
Assert.assertEquals(reviewList.getList().size(), 2); | ||
ReviewList.Review review = reviewList.getList().get(0); | ||
Assert.assertEquals(review.getRid(), 79800); | ||
Assert.assertEquals(review.getPostTime().getTime(), | ||
new GregorianCalendar(2013, 5, 25, 17, 16, 31).getTime().getTime()); | ||
Assert.assertEquals(review.getNoReplies(), 1); | ||
Assert.assertEquals(review.getLastReplyTime().getTime(), | ||
new GregorianCalendar(2013, 5, 28, 18, 49, 16).getTime().getTime()); | ||
Assert.assertEquals(review.getUid(), 81669); | ||
Assert.assertEquals(review.getUserName(), "老衲0轻音"); | ||
Assert.assertEquals(review.getTitle(), "前排……"); | ||
|
||
review = reviewList.getList().get(1); | ||
Assert.assertEquals(review.getRid(), 79826); | ||
Assert.assertEquals(review.getPostTime().getTime(), | ||
new GregorianCalendar(2013, 5, 25, 23, 20, 2).getTime().getTime()); | ||
Assert.assertEquals(review.getNoReplies(), 4); | ||
Assert.assertEquals(review.getLastReplyTime().getTime(), | ||
new GregorianCalendar(2013, 5, 27, 23, 42, 59).getTime().getTime()); | ||
Assert.assertEquals(review.getUid(), 34924); | ||
Assert.assertEquals(review.getUserName(), "冒险奏鸣"); | ||
Assert.assertEquals(review.getTitle(), "有种神曲奏界的既视感"); | ||
} | ||
|
||
|
||
@Test | ||
public void testParseReviewListPageTwo() { | ||
// TODO | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.