New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash if "No route to host" #316

Merged
merged 5 commits into from Jun 30, 2017

Conversation

Projects
None yet
3 participants
@FlorianSW
Contributor

FlorianSW commented Jun 12, 2017

If the connection to the remote host could not be established, the app
creates a fake response with the error message and status code 500 for the
notification settings sync hhtp request. However, until now, the creation
of this Fake response failed, as the Response builder requires some data,
which was not given so far.

This also refactors the MyHttpClient sslSetup method, which does not need
to get the whole context passed to it and therefore the constructors of
MyAsync and MySyncHttpClient does not need this neither. It now takes a
boolean argument, which indicates, if hostnames of a ssl cert should be
ignored or not.

Fixes #315

Fix crash if "No route to host"
If the connection to the remote host could not be established, the app
creates a fake response with the error message and status code 500 for the
notification settings sync hhtp request. However, until now, the creation
of this Fake response failed, as the Response builder requires some data,
which was not given so far.

This also refactors the MyHttpClient sslSetup method, which does not need
to get the whole context passed to it and therefore the constructors of
MyAsync and MySyncHttpClient does not need this neither. It now takes a
boolean argument, which indicates, if hostnames of a ssl cert should be
ignored or not.

Fixes #315
@digitaldan

This comment has been minimized.

Show comment
Hide comment
@digitaldan

digitaldan Jun 15, 2017

Contributor

Thanks!

Contributor

digitaldan commented Jun 15, 2017

Thanks!

@digitaldan

This comment has been minimized.

Show comment
Hide comment
@digitaldan

digitaldan Jun 20, 2017

Contributor

Hi @FlorianSW ! , can you resolve the merge conflicts? Thanks!

Contributor

digitaldan commented Jun 20, 2017

Hi @FlorianSW ! , can you resolve the merge conflicts? Thanks!

@digitaldan

This comment has been minimized.

Show comment
Hide comment
@digitaldan

digitaldan Jun 20, 2017

Contributor

I am getting this error when trying to build:
/Users/daniel/openhab2-master/git/openhab.android/mobile/src/main/java/org/openhab/habdroid/ui/OpenHABMainActivity.java:1232: error: constructor MySyncHttpClient in class MySyncHttpClient cannot be applied to given types; MySyncHttpClient syncHttpClient = new MySyncHttpClient(PreferenceManager ^ required: Boolean,Boolean found: boolean reason: actual and formal argument lists differ in length

Contributor

digitaldan commented Jun 20, 2017

I am getting this error when trying to build:
/Users/daniel/openhab2-master/git/openhab.android/mobile/src/main/java/org/openhab/habdroid/ui/OpenHABMainActivity.java:1232: error: constructor MySyncHttpClient in class MySyncHttpClient cannot be applied to given types; MySyncHttpClient syncHttpClient = new MySyncHttpClient(PreferenceManager ^ required: Boolean,Boolean found: boolean reason: actual and formal argument lists differ in length

@FlorianSW

This comment has been minimized.

Show comment
Hide comment
@FlorianSW

FlorianSW Jun 20, 2017

Contributor

Oops, sorry, that was an error during rebase :(

Contributor

FlorianSW commented Jun 20, 2017

Oops, sorry, that was an error during rebase :(

@digitaldan

This comment has been minimized.

Show comment
Hide comment
@digitaldan

digitaldan Jun 23, 2017

Contributor

Sorry, I'm still getting build errors:

/Users/daniel/openhab2-master/git/openhab.android/mobile/src/test/java/org/openhab/habdroid/util/MySyncHttpClientTest.java:20: error: constructor MySyncHttpClient in class MySyncHttpClient cannot be applied to given types; MySyncHttpClient httpClient = new MySyncHttpClient(false); ^ required: Boolean,Boolean found: boolean reason: actual and formal argument lists differ in length Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error

Contributor

digitaldan commented Jun 23, 2017

Sorry, I'm still getting build errors:

/Users/daniel/openhab2-master/git/openhab.android/mobile/src/test/java/org/openhab/habdroid/util/MySyncHttpClientTest.java:20: error: constructor MySyncHttpClient in class MySyncHttpClient cannot be applied to given types; MySyncHttpClient httpClient = new MySyncHttpClient(false); ^ required: Boolean,Boolean found: boolean reason: actual and formal argument lists differ in length Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error

@FlorianSW

This comment has been minimized.

Show comment
Hide comment
@FlorianSW

FlorianSW Jun 23, 2017

Contributor

Hmm, it worked for me. Checking it again, sorry for these problems :(

Contributor

FlorianSW commented Jun 23, 2017

Hmm, it worked for me. Checking it again, sorry for these problems :(

@FlorianSW

This comment has been minimized.

Show comment
Hide comment
@FlorianSW

FlorianSW Jun 23, 2017

Contributor

Ah, I forgot the tests, fixing it...

Contributor

FlorianSW commented Jun 23, 2017

Ah, I forgot the tests, fixing it...

@digitaldan

This comment has been minimized.

Show comment
Hide comment
@digitaldan

digitaldan Jun 23, 2017

Contributor

Still having issues :-) , btw I'm building from the command line with ./gradlew clean build

:mobile:compileDebugUnitTestSources
:mobile:mockableAndroidJar
:mobile:assembleDebugUnitTest
:mobile:testDebugUnitTest

org.openhab.habdroid.util.MySyncHttpClientTest > testMethodErrorResponse FAILED
    org.junit.ComparisonFailure at MySyncHttpClientTest.java:38

18 tests completed, 1 failed
:mobile:testDebugUnitTest FAILED

FAILURE: Build failed with an exception.```
Contributor

digitaldan commented Jun 23, 2017

Still having issues :-) , btw I'm building from the command line with ./gradlew clean build

:mobile:compileDebugUnitTestSources
:mobile:mockableAndroidJar
:mobile:assembleDebugUnitTest
:mobile:testDebugUnitTest

org.openhab.habdroid.util.MySyncHttpClientTest > testMethodErrorResponse FAILED
    org.junit.ComparisonFailure at MySyncHttpClientTest.java:38

18 tests completed, 1 failed
:mobile:testDebugUnitTest FAILED

FAILURE: Build failed with an exception.```
@FlorianSW

This comment has been minimized.

Show comment
Hide comment
@FlorianSW

FlorianSW Jun 23, 2017

Contributor
[...]
:mobile:processDebugUnitTestJavaRes NO-SOURCE
:mobile:compileDebugUnitTestSources
:mobile:mockableAndroidJar
:mobile:assembleDebugUnitTest
:mobile:testDebugUnitTest
:mobile:incrementalReleaseUnitTestJavaCompilationSafeguard NO-SOURCE
:mobile:javaPreCompileReleaseUnitTest
:mobile:preReleaseUnitTestBuild UP-TO-DATE
:mobile:prepareReleaseUnitTestDependencies
:mobile:compileReleaseUnitTestJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

[...]

BUILD SUCCESSFUL

Total time: 12 mins 25.738 secs

Works for me :/ This is probably a silly question, but have you pulled the latest commit(s)?

Contributor

FlorianSW commented Jun 23, 2017

[...]
:mobile:processDebugUnitTestJavaRes NO-SOURCE
:mobile:compileDebugUnitTestSources
:mobile:mockableAndroidJar
:mobile:assembleDebugUnitTest
:mobile:testDebugUnitTest
:mobile:incrementalReleaseUnitTestJavaCompilationSafeguard NO-SOURCE
:mobile:javaPreCompileReleaseUnitTest
:mobile:preReleaseUnitTestBuild UP-TO-DATE
:mobile:prepareReleaseUnitTestDependencies
:mobile:compileReleaseUnitTestJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

[...]

BUILD SUCCESSFUL

Total time: 12 mins 25.738 secs

Works for me :/ This is probably a silly question, but have you pulled the latest commit(s)?

@mueller-ma

This comment has been minimized.

Show comment
Hide comment
@mueller-ma

mueller-ma Jun 23, 2017

Member

Since debian 8 contains an too old jdk and I have some "do didnt accept the license" problems on arch, I had to built on windows and this was successful. I cannot really provide text from the console, so here is a screenshot:
ohbuild

Member

mueller-ma commented Jun 23, 2017

Since debian 8 contains an too old jdk and I have some "do didnt accept the license" problems on arch, I had to built on windows and this was successful. I cannot really provide text from the console, so here is a screenshot:
ohbuild

@digitaldan

This comment has been minimized.

Show comment
Hide comment
@digitaldan

digitaldan Jun 23, 2017

Contributor

Strange, I just checked out a fresh copy in a new directory from https://github.com/FlorianSW/openhab.android.git and have the same error. I must have a different SDK version or something. The error is in a test, checking the host value returned in the MyHTTPClient class, not sure why a local environmental difference would fail that.

Contributor

digitaldan commented Jun 23, 2017

Strange, I just checked out a fresh copy in a new directory from https://github.com/FlorianSW/openhab.android.git and have the same error. I must have a different SDK version or something. The error is in a test, checking the host value returned in the MyHTTPClient class, not sure why a local environmental difference would fail that.

@digitaldan

This comment has been minimized.

Show comment
Hide comment
@digitaldan

digitaldan Jun 23, 2017

Contributor

@FlorianSW I'm trying to understand how this is failing, if I turn up the logging this is the full stacktrace, do you see why this is failing on my system and not yours?

13:30:20.054 [DEBUG] [org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor] Executing test class org.openhab.habdroid.util.UtilTest
13:30:20.098 [DEBUG] [TestEventLogger] 
13:30:20.098 [DEBUG] [TestEventLogger] org.openhab.habdroid.util.MySyncHttpClientTest > testMethodErrorResponse FAILED
13:30:20.094 [INFO] [org.gradle.api.internal.tasks.testing.worker.TestWorker] Gradle Test Executor 1 finished executing tests.
13:30:20.099 [DEBUG] [TestEventLogger]     org.junit.ComparisonFailure: expected:<...st.a.local.url.local[]> but was:<...st.a.local.url.local[: unknown error]>
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.Assert.assertEquals(Assert.java:115)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.Assert.assertEquals(Assert.java:144)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.openhab.habdroid.util.MySyncHttpClientTest.testMethodErrorResponse(MySyncHttpClientTest.java:38)
13:30:20.099 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:30:20.099 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
13:30:20.099 [DEBUG] [TestEventLogger]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:30:20.099 [DEBUG] [TestEventLogger]         at java.lang.reflect.Method.invoke(Method.java:497)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
13:30:20.095 [DEBUG] [org.gradle.process.internal.worker.child.ActionExecutionWorker] Completed Gradle Test Executor 1.
13:30:20.100 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:114)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:57)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
13:30:20.100 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:30:20.100 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
13:30:20.100 [DEBUG] [TestEventLogger]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:30:20.100 [DEBUG] [TestEventLogger]         at java.lang.reflect.Method.invoke(Method.java:497)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
13:30:20.100 [DEBUG] [TestEventLogger]         at com.sun.proxy.$Proxy3.processTestClass(Unknown Source)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
13:30:20.101 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:30:20.101 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
13:30:20.101 [DEBUG] [TestEventLogger]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:30:20.101 [DEBUG] [TestEventLogger]         at java.lang.reflect.Method.invoke(Method.java:497)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:147)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:129)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
13:30:20.101 [DEBUG] [TestEventLogger]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
13:30:20.101 [DEBUG] [TestEventLogger]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
13:30:20.101 [DEBUG] [TestEventLogger]         at java.lang.Thread.run(Thread.java:745)
Contributor

digitaldan commented Jun 23, 2017

@FlorianSW I'm trying to understand how this is failing, if I turn up the logging this is the full stacktrace, do you see why this is failing on my system and not yours?

13:30:20.054 [DEBUG] [org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor] Executing test class org.openhab.habdroid.util.UtilTest
13:30:20.098 [DEBUG] [TestEventLogger] 
13:30:20.098 [DEBUG] [TestEventLogger] org.openhab.habdroid.util.MySyncHttpClientTest > testMethodErrorResponse FAILED
13:30:20.094 [INFO] [org.gradle.api.internal.tasks.testing.worker.TestWorker] Gradle Test Executor 1 finished executing tests.
13:30:20.099 [DEBUG] [TestEventLogger]     org.junit.ComparisonFailure: expected:<...st.a.local.url.local[]> but was:<...st.a.local.url.local[: unknown error]>
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.Assert.assertEquals(Assert.java:115)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.Assert.assertEquals(Assert.java:144)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.openhab.habdroid.util.MySyncHttpClientTest.testMethodErrorResponse(MySyncHttpClientTest.java:38)
13:30:20.099 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:30:20.099 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
13:30:20.099 [DEBUG] [TestEventLogger]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:30:20.099 [DEBUG] [TestEventLogger]         at java.lang.reflect.Method.invoke(Method.java:497)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
13:30:20.099 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
13:30:20.095 [DEBUG] [org.gradle.process.internal.worker.child.ActionExecutionWorker] Completed Gradle Test Executor 1.
13:30:20.100 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:114)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:57)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
13:30:20.100 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:30:20.100 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
13:30:20.100 [DEBUG] [TestEventLogger]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:30:20.100 [DEBUG] [TestEventLogger]         at java.lang.reflect.Method.invoke(Method.java:497)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
13:30:20.100 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
13:30:20.100 [DEBUG] [TestEventLogger]         at com.sun.proxy.$Proxy3.processTestClass(Unknown Source)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
13:30:20.101 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:30:20.101 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
13:30:20.101 [DEBUG] [TestEventLogger]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:30:20.101 [DEBUG] [TestEventLogger]         at java.lang.reflect.Method.invoke(Method.java:497)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:147)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:129)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
13:30:20.101 [DEBUG] [TestEventLogger]         at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
13:30:20.101 [DEBUG] [TestEventLogger]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
13:30:20.101 [DEBUG] [TestEventLogger]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
13:30:20.101 [DEBUG] [TestEventLogger]         at java.lang.Thread.run(Thread.java:745)
@FlorianSW

This comment has been minimized.

Show comment
Hide comment
@FlorianSW

FlorianSW Jun 23, 2017

Contributor

Hmm, it seems, that the UnknownHostException contains different error messages for different systems (or it may be different based on other criteria). As this is not the main information, what this test should check, I'll adapt it to not fail for these cases anymore :)

Contributor

FlorianSW commented Jun 23, 2017

Hmm, it seems, that the UnknownHostException contains different error messages for different systems (or it may be different based on other criteria). As this is not the main information, what this test should check, I'll adapt it to not fail for these cases anymore :)

Add more detailed information in error message (Exception class)
This also allows us to have a test case, which still checks that the
request failed for the correct reason but does not rely on the exact error
message anymore, which seems to be different in different circumstances.
@FlorianSW

This comment has been minimized.

Show comment
Hide comment
@FlorianSW

FlorianSW Jun 23, 2017

Contributor

@digitaldan Would be nice, if you could retest again :] Sorry for all the trouble :(

Contributor

FlorianSW commented Jun 23, 2017

@digitaldan Would be nice, if you could retest again :] Sorry for all the trouble :(

@digitaldan

This comment has been minimized.

Show comment
Hide comment
@digitaldan

digitaldan Jun 25, 2017

Contributor

That did it, no problem at all, thanks!

Contributor

digitaldan commented Jun 25, 2017

That did it, no problem at all, thanks!

@digitaldan digitaldan merged commit 03ea377 into openhab:master Jun 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment