java-curl icon indicating copy to clipboard operation
java-curl copied to clipboard

All tests get -1 code

Open qkmaosjtu opened this issue 5 years ago • 5 comments

java.lang.AssertionError: Expected :200 Actual :-1 <Click to see difference>

at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:834)
at org.junit.Assert.assertEquals(Assert.java:645)
at org.junit.Assert.assertEquals(Assert.java:631)
at com.roxstudio.utils.CUrlTest.customResolver(CUrlTest.java:113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

qkmaosjtu avatar May 11 '20 13:05 qkmaosjtu

please change ENABLE_FIDDLER_FOR_ALL_TEST to false in CUrlTest.java

rockswang avatar May 11 '20 13:05 rockswang

Yes, it worked fine on my PC but still -1 on Android

Rocks Wang [email protected] 于2020年5月11日周一 下午9:52写道:

please change ENABLE_FIDDLER_FOR_ALL_TEST to false in CUrlTest.java

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rockswang/java-curl/issues/13#issuecomment-626715247, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD64MOFRJCUSHK6DZ5CZHPLRQ77LRANCNFSM4M55PJOA .

qkmaosjtu avatar May 11 '20 15:05 qkmaosjtu

please change ENABLE_FIDDLER_FOR_ALL_TEST to false in CUrlTest.java It works fine in my Java environment on my PC but still not work in Android.

qkmaosjtu avatar May 11 '20 15:05 qkmaosjtu

image

qkmaosjtu avatar May 11 '20 15:05 qkmaosjtu

Fails on MacOS with ENABLE_FIDDLER_FOR_ALL_TEST = false


T E S T S

Running com.roxstudio.utils.CUrlTest java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.Socket.connect(Socket.java:607) at sun.net.NetworkClient.doConnect(NetworkClient.java:175) at sun.net.www.http.HttpClient.openServer(HttpClient.java:463) at sun.net.www.http.HttpClient$1.run(HttpClient.java:515) at sun.net.www.http.HttpClient$1.run(HttpClient.java:513) at java.security.AccessController.doPrivileged(Native Method) at sun.net.www.http.HttpClient.privilegedOpenServer(HttpClient.java:512) at sun.net.www.http.HttpClient.openServer(HttpClient.java:553) at sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264) at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1205) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1570) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:352) at com.roxstudio.utils.CUrl.exec(CUrl.java:905) at com.roxstudio.utils.CUrlTest.selfSignedCertificate(CUrlTest.java:173)

aberezin avatar May 21 '20 00:05 aberezin

it seems you didn't get access to httpbin.org

rockswang avatar Jun 05 '23 02:06 rockswang