Skip to content

Commit c8e47e8

Browse files
林檎林檎
林檎
authored and
林檎
committed
Update Test Case
1 parent a457167 commit c8e47e8

File tree

1 file changed

+52
-42
lines changed

1 file changed

+52
-42
lines changed

src/test/java/jcomicdownloader/TestURL.java

+52-42
Original file line numberDiff line numberDiff line change
@@ -21,80 +21,90 @@
2121
@RunWith(value=Parameterized.class)
2222
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
2323
public class TestURL {
24-
@Rule
24+
@Rule
2525
public TestRule watcher = new TestWatcher() {
2626
protected void starting(Description description) {
27-
System.out.println("Starting test: " + description.getMethodName());
27+
System.out.println("Starting test: " + description.getMethodName());
2828
}
2929
@Override
3030
protected void failed(Throwable e, Description description) {
31-
System.out.println("Test fail: " + mod +"\t"+ description.getMethodName() + "\n");
31+
System.out.println("Test fail: " + mod +"\t"+ description.getMethodName() + "\n");
3232
}
3333

3434
@Override
3535
protected void succeeded(Description description) {
3636
System.out.println("Test success: " + mod +"\t"+ description.getMethodName() + "\n");
37-
}
38-
};
39-
37+
}
38+
};
39+
4040
@Parameterized.Parameters
4141
public static Collection<Object[]> getParameters() {
4242
return Arrays.asList(
43-
new Object[][] {
44-
{0,"http://www.comicvip.com/html/9718.html","jcomicdownloader.module.ParseEC"}
45-
,{1,"http://manhua.dmzj.com/ganwumeixiaomai/","jcomicdownloader.module.Parse178"}
46-
,{2,"http://comic.sfacg.com/HTML/GWMXM/","jcomicdownloader.module.ParseSF"}
47-
,{3,"http://comic.kukudm.com/comiclist/1842/index.htm","jcomicdownloader.module.ParseKUKU"}
48-
,{4,"http://comic.ck101.com/comic/18181","jcomicdownloader.module.ParseCK"}
49-
,{5,"http://www.tuku.cc/comic/11977/","jcomicdownloader.module.ParseTUKU"}
50-
,
51-
{6,"http://www.dm5.com/manhua-kissxdeath/","jcomicdownloader.module.ParseDM5"}
52-
}
43+
new Object[][] { //uncomment which site for test
44+
// {0,"http://www.comicvip.com/html/9718.html","jcomicdownloader.module.ParseEC"}
45+
// ,
46+
// {1,"http://manhua.dmzj.com/ganwumeixiaomai/","jcomicdownloader.module.Parse178"}
47+
// ,
48+
// {2,"http://comic.sfacg.com/HTML/GWMXM/","jcomicdownloader.module.ParseSF"}
49+
// ,
50+
// {3,"http://comic.kukudm.com/comiclist/1842/index.htm","jcomicdownloader.module.ParseKUKU"}
51+
// ,
52+
// {4,"http://comic.ck101.com/comic/18181","jcomicdownloader.module.ParseCK"}
53+
// ,
54+
// {5,"http://www.tuku.cc/comic/11977/","jcomicdownloader.module.ParseTUKU"}
55+
// ,
56+
// {6,"http://www.dm5.com/manhua-kissxdeath/","jcomicdownloader.module.ParseDM5"}
57+
// ,
58+
// {7,"https://tieba.baidu.com/p/4941848745","jcomicdownloader.module.ParseBAIDU"}
59+
,
60+
{8,"https://tieba.baidu.com/p/4978124556","jcomicdownloader.module.ParseBAIDU"}
61+
62+
}
5363
);
5464
}
55-
65+
5666
private final String url,mod;
5767
private ParseOnlineComicSite s;
5868

5969
public TestURL(Integer i,String url, String mod) {
6070
this.url = url;
61-
this.mod = mod;;
62-
71+
this.mod = mod;;
72+
6373
noGuiTweak:{ //just a label
6474
Run.isAlive=true;// tweak for no download
65-
Common.consoleThreadName= Thread.currentThread().getName();
75+
Common.consoleThreadName= Thread.currentThread().getName();
6676
}
67-
77+
6878
Common.debugPrintln("-----------------"+i+"--------------------");
6979
try{
70-
this.s=(ParseOnlineComicSite)Class.forName(mod).newInstance();
71-
ignoreBug_001:{// will fail if not set in some case
72-
this.s.setURL(url);
80+
this.s=(ParseOnlineComicSite)Class.forName(mod).newInstance();
81+
ignoreBug_001:{// will fail if not set in some case
82+
this.s.setURL(url);
7383
}
7484
}catch(Exception x){
7585
s=null;
76-
fail("Module "+mod+" has exception : "+x.getMessage());
86+
fail("Module "+mod+" has exception : "+x.getMessage());
7787
}
7888
}
79-
80-
@org.junit.Ignore
81-
@org.junit.Test
89+
90+
//@org.junit.Ignore
91+
@org.junit.Test
8292
public void test000Run() {
8393
RunModule r =new RunModule();
84-
// try{
85-
r.runMainProcess(s, url);
94+
// try{
95+
r.runMainProcess(s, url);
8696
// }catch(Exception e){
8797
// fail(e.toString());
88-
// }
98+
// }
8999
}
90-
91-
@org.junit.Ignore
92-
@org.junit.Test
100+
101+
//@org.junit.Ignore
102+
@org.junit.Test
93103
public void test001Url() {
94104
assertTrue(mod,s.canParserHandle(url));
95105
}
96-
97-
@org.junit.Ignore
106+
107+
//@org.junit.Ignore
98108
@org.junit.Test
99109
public void test002setParameters() {
100110
try{
@@ -104,18 +114,18 @@ public void test002setParameters() {
104114
fail(e.toString()+ " : "+e.getMessage());
105115
}
106116
}
107-
108-
@org.junit.Ignore
117+
118+
//@org.junit.Ignore
109119
@org.junit.Test
110-
public void test003getAllPageString() {
120+
public void test003getAllPageString() {
111121
String allPageString = s.getAllPageString(url);
112122
assertNotNull(allPageString);
113123
}
114-
115-
@org.junit.Ignore
124+
125+
//@org.junit.Ignore
116126
@org.junit.Test
117127
public void test004getTitleOnMainPage() {
118-
String allPageString = s.getAllPageString(url);
128+
String allPageString = s.getAllPageString(url);
119129
String title=s.getTitleOnMainPage(url, allPageString);
120130
System.out.println("test004getTitleOnMainPage : "+title);
121131
assertNotNull(title);

0 commit comments

Comments
 (0)