Open vivienneChen opened 7 years ago
I've already fixed it. Checkout the latest code.
still git build error, all unit test failed, have you try to build it?
build error
############
警告: [options] 未与 -source 1.6 一起设置引导类路径
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:7: 警告: [deprecation] org.mockito中的Matchers已过时
import org.mockito.Matchers;
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoLogTest.java:24: 警告: [deprecation] org.mockito中的Matchers已过时
import static org.mockito.Matchers.any;
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoRequestHitTest.java:19: 警告: [deprecation] org.mockito中的Matchers已过时
import static org.mockito.Matchers.any;
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:99: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler).writeToResponse(Matchers.
com.github.dreamhead.moco.HttpsRunnerTest > should_work_well FAILED java.net.BindException
com.github.dreamhead.moco.internal.ActualHttpServerTest > should_merge_https_server FAILED java.net.BindException
It seems you are still using old code, because the anyObject
in MocoEventTest has been removed. Check out the latest code.
you latest commit has errors, could you have a look?
one more question, can standalone jar deal with json format post data? it always prompts "content is binary", but you handle the json in your code, i guess it is standalone jar is a old version, right?
Checkout the current code and there is no anyObject
https://github.com/dreamhead/moco/blob/master/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java
"content is binary" is printed by Moco code since Moco can't not guess the content type as text type. The code is as follows: https://github.com/dreamhead/moco/blob/master/moco-core/src/main/java/com/github/dreamhead/moco/dumper/HttpDumpers.java
Still build with errors and all test faled
########################################### 警告: [options] 未与 -source 1.6 一起设置引导类路径 /Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoLogTest.java:24: 警告: [deprecation] org.mockito中的Matchers已过时 import static org.mockito.Matchers.any; ^ /Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoRequestHitTest.java:19: 警告: [deprecation] org.mockito中的Matchers已过时 import static org.mockito.Matchers.any; ^ 3 个警告 :moco-core:processTestResources :moco-core:testClasses :moco-core:test
com.github.dreamhead.moco.HttpsRunnerTest > should_work_well FAILED java.net.BindException
com.github.dreamhead.moco.internal.ActualHttpServerTest > should_merge_https_server FAILED java.net.BindException
com.github.dreamhead.moco.internal.ActualHttpServerTest > should_config_handler_correctly_other_side_while_merging FAILED java.net.BindException
com.github.dreamhead.moco.internal.ActualHttpServerTest > should_merge_http_server_with_same_port FAILED java.net.BindException
com.github.dreamhead.moco.internal.ActualHttpServerTest > should_merge_two_https_servers FAILED java.net.BindException
com.github.dreamhead.moco.internal.ActualHttpServerTest > should_merge_http_server_without_port_for_first_server FAILED java.net.BindException
com.github.dreamhead.moco.internal.ActualHttpServerTest > should_throw_exception_for_merging_http_server_with_any_handler_one_side FAILED java.lang.Exception Caused by: java.net.BindException
com.github.dreamhead.moco.internal.ActualHttpServerTest > should_config_handler_correctly_while_merging FAILED java.net.BindException
com.github.dreamhead.moco.internal.ActualHttpServerTest > should_throw_for_merging_http_server_with_any_handler_other_side FAILED java.lang.Exception Caused by: java.net.BindException
com.github.dreamhead.moco.internal.ActualHttpServerTest > should_merge_https_server_into_http_server FAILED java.net.BindException
com.github.dreamhead.moco.internal.ActualHttpServerTest > should_merge_http_server_with_any_handler_other_side FAILED java.net.BindException
com.github.dreamhead.moco.internal.ActualHttpServerTest > should_merge_http_server_with_any_handler_one_side FAILED
It seems there is another server running with 12306 port.
Who can help to find out the root cause? code issue or not?
build error log:
:assemble UP-TO-DATE :check UP-TO-DATE :build UP-TO-DATE :moco-core:compileJava 警告: [options] 未与 -source 1.6 一起设置引导类路径 1 个警告 :moco-core:processResources UP-TO-DATE :moco-core:classes :moco-core:jar :moco-core:javadoc :moco-core:javadocJar :moco-core:sourcesJar :moco-core:signArchives SKIPPED :moco-core:assemble :moco-core:compileTestJava Download https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom Download https://jcenter.bintray.com/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom Download https://jcenter.bintray.com/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom Download https://jcenter.bintray.com/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.pom Download https://jcenter.bintray.com/org/mockito/mockito-core/2.1.0/mockito-core-2.1.0.pom Download https://jcenter.bintray.com/org/apache/httpcomponents/fluent-hc/4.5.2/fluent-hc-4.5.2.pom Download https://jcenter.bintray.com/net/bytebuddy/byte-buddy/1.4.26/byte-buddy-1.4.26.jar Download https://jcenter.bintray.com/net/bytebuddy/byte-buddy-agent/1.4.26/byte-buddy-agent-1.4.26.jar Download https://jcenter.bintray.com/org/objenesis/objenesis/2.4/objenesis-2.4.jar 警告: [options] 未与 -source 1.6 一起设置引导类路径 /Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:7: 警告: [deprecation] org.mockito中的Matchers已过时 import org.mockito.Matchers; ^ /Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoLogTest.java:24: 警告: [deprecation] org.mockito中的Matchers已过时 import static org.mockito.Matchers.any; ^ /Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoRequestHitTest.java:19: 警告: [deprecation] org.mockito中的Matchers已过时 import static org.mockito.Matchers.any; ^ /Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:99: 警告: [deprecation] org.mockito中的Matchers已过时 verify(handler).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:99: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:115: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:115: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:131: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:131: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:147: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:147: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:164: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:164: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:180: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:180: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:196: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:196: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:212: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:212: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:228: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:228: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:244: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:244: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:260: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:260: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:276: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:276: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:289: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler, never()).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:289: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler, never()).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:294: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:294: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:307: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler, never()).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:307: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler, never()).writeToResponse(Matchers.anyObject());
^
其中, T是类型变量:
T扩展已在方法 anyObject()中声明的Object
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:312: 警告: [deprecation] org.mockito中的Matchers已过时
verify(handler).writeToResponse(Matchers.anyObject());
^
/Users/vchen/Downloads/moco/moco-core/src/test/java/com/github/dreamhead/moco/MocoEventTest.java:312: 警告: [deprecation] ArgumentMatchers中的anyObject()已过时
verify(handler).writeToResponse(Matchers.anyObject());
^