Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
webmagic
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
沈俊林
webmagic
Commits
fb0acd71
Commit
fb0acd71
authored
Jun 03, 2017
by
yihua.huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete SimpleHttpClientTest
parent
d07941d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
SimpleHttpClientTest.java
...test/java/us/codecraft/webmagic/SimpleHttpClientTest.java
+5
-1
No files found.
webmagic-extension/src/test/java/us/codecraft/webmagic/SimpleHttpClientTest.java
View file @
fb0acd71
package
us
.
codecraft
.
webmagic
;
package
us
.
codecraft
.
webmagic
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.junit.Test
;
import
us.codecraft.webmagic.model.AfterExtractor
;
import
us.codecraft.webmagic.model.AfterExtractor
;
import
us.codecraft.webmagic.model.annotation.ExtractBy
;
import
us.codecraft.webmagic.model.annotation.ExtractBy
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
/**
* @author code4crafter@gmail.com
* @author code4crafter@gmail.com
* Date: 2017/6/3
* Date: 2017/6/3
...
@@ -76,12 +79,13 @@ public class SimpleHttpClientTest {
...
@@ -76,12 +79,13 @@ public class SimpleHttpClientTest {
}
}
}
}
@Ignore
@Test
@Test
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
SimpleHttpClient
simpleClient
=
new
SimpleHttpClient
(
Site
.
me
().
setUserAgent
(
SimpleHttpClient
simpleClient
=
new
SimpleHttpClient
(
Site
.
me
().
setUserAgent
(
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36"
));
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36"
));
Weather
weather
=
simpleClient
.
get
(
"http://www.weather.com.cn/weather/101020100.shtml"
,
Weather
.
class
);
Weather
weather
=
simpleClient
.
get
(
"http://www.weather.com.cn/weather/101020100.shtml"
,
Weather
.
class
);
System
.
out
.
println
(
weather
);
assertThat
(
weather
).
isNotNull
(
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment