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
3c133819
Commit
3c133819
authored
May 20, 2017
by
yihua.huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for 0.7.0.alpha
parent
e8abc280
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
22 deletions
+22
-22
pom.xml
pom.xml
+4
-5
pom.xml
webmagic-core/pom.xml
+1
-1
HttpClientDownloaderTest.java
...decraft/webmagic/downloader/HttpClientDownloaderTest.java
+12
-11
pom.xml
webmagic-extension/pom.xml
+1
-1
pom.xml
webmagic-samples/pom.xml
+1
-1
pom.xml
webmagic-saxon/pom.xml
+1
-1
pom.xml
webmagic-scripts/pom.xml
+1
-1
pom.xml
webmagic-selenium/pom.xml
+1
-1
No files found.
pom.xml
View file @
3c133819
...
...
@@ -6,7 +6,7 @@
<version>
7
</version>
</parent>
<groupId>
us.codecraft
</groupId>
<version>
0.7.0-SNAPSHOT
</version>
<version>
0.7.0
.alpha
-SNAPSHOT
</version>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
pom
</packaging>
<properties>
...
...
@@ -108,7 +108,7 @@
<dependency>
<groupId>
com.github.dreamhead
</groupId>
<artifactId>
moco-core
</artifactId>
<version>
0.
9.1
</version>
<version>
0.
11.0
</version>
<scope>
test
</scope>
<exclusions>
<exclusion>
...
...
@@ -164,8 +164,7 @@
<artifactId>
maven-surefire-plugin
</artifactId>
<version>
2.18
</version>
<configuration>
<forkMode>
pertest
</forkMode>
<argLine>
-Xms1024m -Xmx1024m -Xss1m
</argLine>
<forkCount>
0
</forkCount>
</configuration>
</plugin>
<plugin>
...
...
@@ -234,7 +233,7 @@
<version>
2.10.4
</version>
<configuration>
<encoding>
UTF-8
</encoding>
<doctitle>
WebMagic 0.7.0
-SNAPSHOT
</doctitle>
<doctitle>
WebMagic 0.7.0
.alpha
</doctitle>
<locale>
en_US
</locale>
</configuration>
<executions>
...
...
webmagic-core/pom.xml
View file @
3c133819
...
...
@@ -3,7 +3,7 @@
<parent>
<groupId>
us.codecraft
</groupId>
<artifactId>
webmagic-parent
</artifactId>
<version>
0.7.0-SNAPSHOT
</version>
<version>
0.7.0
.alpha
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
webmagic-core/src/test/java/us/codecraft/webmagic/downloader/HttpClientDownloaderTest.java
View file @
3c133819
...
...
@@ -63,20 +63,20 @@ public class HttpClientDownloaderTest {
@Test
public
void
testGetHtmlCharset
()
throws
Exception
{
HttpServer
server
=
http
s
erver
(
13423
);
HttpServer
server
=
http
S
erver
(
13423
);
server
.
get
(
by
(
uri
(
"/header"
))).
response
(
header
(
"Content-Type"
,
"text/html; charset=gbk"
));
server
.
get
(
by
(
uri
(
"/meta4"
))).
response
(
with
(
text
(
"<html>\n"
+
" <head>\n"
+
" <meta charset='gbk'/>\n"
+
" </head>\n"
+
" <body></body>\n"
+
"</html>"
)),
header
(
"Content-Type"
,
""
));
"</html>"
)),
header
(
"Content-Type"
,
"
text/html; charset=gbk
"
));
server
.
get
(
by
(
uri
(
"/meta5"
))).
response
(
with
(
text
(
"<html>\n"
+
" <head>\n"
+
" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=gbk\" />\n"
+
" </head>\n"
+
" <body></body>\n"
+
"</html>"
)),
header
(
"Content-Type"
,
""
));
"</html>"
)),
header
(
"Content-Type"
,
"
text/html
"
));
Runner
.
running
(
server
,
new
Runnable
()
{
@Override
public
void
run
()
{
...
...
@@ -114,7 +114,8 @@ public class HttpClientDownloaderTest {
@Test
public
void
test_selectRequestMethod
()
throws
Exception
{
HttpServer
server
=
httpserver
(
13423
);
final
int
port
=
13423
;
HttpServer
server
=
httpServer
(
port
);
server
.
get
(
eq
(
query
(
"q"
),
"webmagic"
)).
response
(
"get"
);
server
.
post
(
eq
(
form
(
"q"
),
"webmagic"
)).
response
(
"post"
);
server
.
put
(
eq
(
form
(
"q"
),
"webmagic"
)).
response
(
"put"
);
...
...
@@ -127,11 +128,11 @@ public class HttpClientDownloaderTest {
@Override
public
void
run
()
throws
Exception
{
Request
request
=
new
Request
();
request
.
setUrl
(
"http://127.0.0.1:
13423
/search?q=webmagic"
);
request
.
setUrl
(
"http://127.0.0.1:
"
+
port
+
"
/search?q=webmagic"
);
request
.
setMethod
(
HttpConstant
.
Method
.
GET
);
Map
<
String
,
Object
>
params
=
new
HashedMap
();
params
.
put
(
"q"
,
"webmagic"
);
HttpUriRequest
httpUriRequest
=
httpUriRequestConverter
.
convert
(
request
,
site
,
null
).
getHttpUriRequest
();
HttpUriRequest
httpUriRequest
=
httpUriRequestConverter
.
convert
(
request
,
site
,
null
).
getHttpUriRequest
();
assertThat
(
EntityUtils
.
toString
(
HttpClients
.
custom
().
build
().
execute
(
httpUriRequest
).
getEntity
())).
isEqualTo
(
"get"
);
request
.
setMethod
(
HttpConstant
.
Method
.
DELETE
);
httpUriRequest
=
httpUriRequestConverter
.
convert
(
request
,
site
,
null
).
getHttpUriRequest
();
...
...
@@ -142,7 +143,7 @@ public class HttpClientDownloaderTest {
request
.
setMethod
(
HttpConstant
.
Method
.
TRACE
);
httpUriRequest
=
httpUriRequestConverter
.
convert
(
request
,
site
,
null
).
getHttpUriRequest
();
assertThat
(
EntityUtils
.
toString
(
HttpClients
.
custom
().
build
().
execute
(
httpUriRequest
).
getEntity
())).
isEqualTo
(
"trace"
);
request
.
setUrl
(
"http://127.0.0.1:
13423
/search"
);
request
.
setUrl
(
"http://127.0.0.1:
"
+
port
+
"
/search"
);
request
.
setMethod
(
HttpConstant
.
Method
.
POST
);
request
.
setRequestBody
(
HttpRequestBody
.
form
(
params
,
"utf-8"
));
httpUriRequest
=
httpUriRequestConverter
.
convert
(
request
,
site
,
null
).
getHttpUriRequest
();
...
...
@@ -156,7 +157,7 @@ public class HttpClientDownloaderTest {
@Test
public
void
test_set_request_cookie
()
throws
Exception
{
HttpServer
server
=
http
s
erver
(
13423
);
HttpServer
server
=
http
S
erver
(
13423
);
server
.
get
(
eq
(
cookie
(
"cookie"
),
"cookie-webmagic"
)).
response
(
"ok"
);
Runner
.
running
(
server
,
new
Runnable
()
{
@Override
...
...
@@ -173,7 +174,7 @@ public class HttpClientDownloaderTest {
@Test
public
void
test_set_request_header
()
throws
Exception
{
HttpServer
server
=
http
s
erver
(
13423
);
HttpServer
server
=
http
S
erver
(
13423
);
server
.
get
(
eq
(
header
(
"header"
),
"header-webmagic"
)).
response
(
"ok"
);
Runner
.
running
(
server
,
new
Runnable
()
{
@Override
...
...
@@ -190,7 +191,7 @@ public class HttpClientDownloaderTest {
@Test
public
void
test_set_site_cookie
()
throws
Exception
{
HttpServer
server
=
http
s
erver
(
13423
);
HttpServer
server
=
http
S
erver
(
13423
);
server
.
get
(
eq
(
cookie
(
"cookie"
),
"cookie-webmagic"
)).
response
(
"ok"
);
Runner
.
running
(
server
,
new
Runnable
()
{
@Override
...
...
@@ -207,7 +208,7 @@ public class HttpClientDownloaderTest {
@Test
public
void
test_download_when_task_is_null
()
throws
Exception
{
HttpServer
server
=
http
s
erver
(
13423
);
HttpServer
server
=
http
S
erver
(
13423
);
server
.
response
(
"foo"
);
Runner
.
running
(
server
,
new
Runnable
()
{
@Override
...
...
webmagic-extension/pom.xml
View file @
3c133819
...
...
@@ -3,7 +3,7 @@
<parent>
<groupId>
us.codecraft
</groupId>
<artifactId>
webmagic-parent
</artifactId>
<version>
0.7.0-SNAPSHOT
</version>
<version>
0.7.0
.alpha
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
webmagic-samples/pom.xml
View file @
3c133819
...
...
@@ -3,7 +3,7 @@
<parent>
<artifactId>
webmagic-parent
</artifactId>
<groupId>
us.codecraft
</groupId>
<version>
0.7.0-SNAPSHOT
</version>
<version>
0.7.0
.alpha
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
webmagic-saxon/pom.xml
View file @
3c133819
...
...
@@ -3,7 +3,7 @@
<parent>
<artifactId>
webmagic-parent
</artifactId>
<groupId>
us.codecraft
</groupId>
<version>
0.7.0-SNAPSHOT
</version>
<version>
0.7.0
.alpha
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
webmagic-scripts/pom.xml
View file @
3c133819
...
...
@@ -3,7 +3,7 @@
<parent>
<artifactId>
webmagic-parent
</artifactId>
<groupId>
us.codecraft
</groupId>
<version>
0.7.0-SNAPSHOT
</version>
<version>
0.7.0
.alpha
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
webmagic-selenium/pom.xml
View file @
3c133819
...
...
@@ -3,7 +3,7 @@
<parent>
<artifactId>
webmagic-parent
</artifactId>
<groupId>
us.codecraft
</groupId>
<version>
0.7.0-SNAPSHOT
</version>
<version>
0.7.0
.alpha
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
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