openhab / openhab1-addons

Add-ons for openHAB 1.x
Eclipse Public License 2.0
3.43k stars 1.71k forks source link

Failed test #1344

Closed tramxx closed 9 years ago

tramxx commented 9 years ago

When running mvn clean install i get this error:

Failed tests: testTypeMappingDateTime_19_001(org.openhab.binding.knx.internal.config.KNXCoreTypeMa pperTest): KNXCoreTypeMapper.toDPTValue() test failed for datapoint type "19.001" expected:<1[900-01-01 00]:00:00> but was:<1[899-12-31 17]:00:00>

Snickermicker commented 9 years ago

tram, which branch and version are you trying to build?

tramxx commented 9 years ago

I was following the wiki tutorial for setting up and IDE for developers.

So i made a: git clone https://github.com/openhab/openhab

I gues I am using the main branch. I commented out the tests and it built nicely. So either my system is messing it up or there is in fact an error in the tests.

Snickermicker commented 9 years ago

Since I wrote the testcase recently would I like to know where and why it's broken. Could you please post "git rev-parse HEAD" and "git branch"?

tramxx commented 9 years ago

I can but it wont make you happy. I cloned the git today:

git rev-parse HEAD 65ec52f2a61d7c087a1f05447375d45ec951a3eb

git branch

tramxx commented 9 years ago

Hmm I can point you to 4 lines which i commented out and then it built succesfully: KNXCoreTypeMapperTest.java at lines: 1426, 1472, 1477, 1482

Snickermicker commented 9 years ago

Sure, my bad. You mentioned that you cloned it recently. Which timezone/country are you in? Date/Time parsing seems to be depending on that.

tramxx commented 9 years ago

I'm from Slovenia. Which puts me in Central European Time Zone (UTC+01:00). We have daylight saving time in the winter.

Snickermicker commented 9 years ago

I'm currently a bit clueless about this issue. I've tested using TimeZone.setDefault(TimeZone.getTimeZone("Europe/Ljubljana")); and Locale.setDefault(new Locale("sl", "SI"));, which I hope represent your environment. Got no error with mvn clean or building openHAB.

tramxx commented 9 years ago

Since no one else is complaining, maybe its really something about my setup.

On Fri, Aug 15, 2014 at 3:52 PM, Snickermicker notifications@github.com wrote:

I'm currently a bit clueless about this issue. I've tested using TimeZone.setDefault(TimeZone.getTimeZone("Europe/Ljubljana")); and Locale.setDefault(new Locale("sl", "SI"));, which I hope represent your environment. Got no error with mvn clean or building openHAB.

— Reply to this email directly or view it on GitHub https://github.com/openhab/openhab/issues/1344#issuecomment-52307639.

Snickermicker commented 9 years ago

Could be, but I'm not giving up just yet :) This might be related to #1330

sniporbob commented 9 years ago

I had an issue with the KNX test too. I think I encountered the error you mentioned here, but I can't say for sure (it was several days ago this happened). I ended up using -DskipTests to bypass the ordeal. I'm in Pacific Daylight Time. When I get a chance I'll retry and let you know.

Snickermicker commented 9 years ago

Since I cannot reproduce it with my fork nor does it fail on jenkins: all help appreciated

sniporbob commented 9 years ago

Well this is strange. Now everything is working fine. Just a few days ago I couldn't successfully build no matter what I tried (other than -DskipTests), but now it works great. I have no idea.

Snickermicker commented 9 years ago

Glas to hear that it's workng for you now. Did you by, any chance, fetch the latest commits vor was it pure "magic"?

sniporbob commented 9 years ago

I found out what I did to make it work, and how to make the test fail. It is operating system dependent. I was using maven on windows originally when I first was getting all the errors, and ended up creating an Ubuntu virtual machine to build everything. The build works fine on Ubuntu. On windows, the KNX test fails. The error in the system terminal is:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.19.0:test (default-test) on project org.openhab.binding.knx.test: There are test failures.

The surefire-reports folder contains KNXGenericBindingProviderTest.txt, and the errors in that file are:

Tests run: 94, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.162 sec <<< FAILURE! [...removed extra log info...] sectestTypeMappingDateTime_19_001(org.openhab.binding.knx.internal.config.KNXCoreTypeMapperTest) Time elapsed: 0.002 sec <<< FAILURE! org.junit.ComparisonFailure: KNXCoreTypeMapper.toDPTValue() test failed for datapoint type "19.001" expected:< 1[900-01-01 00]:00:00 > but was:< 1[899-12-31 08]:00:00 > at org.junit.Assert.assertEquals(Assert.java:125) at org.openhab.binding.knx.internal.config.KNXCoreTypeMapperTest.testToDPTValue(KNXCoreTypeMapperTest.java:1938) at org.openhab.binding.knx.internal.config.KNXCoreTypeMapperTest.testTypeMappingDateTime_19_001(KNXCoreTypeMapperTest.java:1529) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110) at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175) at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123) at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:86) at org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438) at org.eclipse.equinox.launcher.Main.main(Main.java:1414) testToDPTid(org.openhab.binding.knx.internal.config.KNXCoreTypeMapperTest) Time elapsed: 0 sec

Side note: the test results ("expected .... but was .... ") are formatted in such a way that github removes the actual numbers. See Tram's original posting. I had to go back and edit this to add spaces in order to make the results show up. I'm not sure if that's something you can fix or not.

Snickermicker commented 9 years ago

That helps a lot! I'll try to reproduce it.

Snickermicker commented 9 years ago

Tried for some time now to reproduce it but I couldn't. Neither could I reproduce the strange JUnit behavior nor the test failure. Trying to reproduce I was using: Windows 7 64-bit, maven 3.2.3 for Windows, Windows timezone set to various locations.

Snickermicker commented 9 years ago

Unless there is more input: I'd like to suggest to close this issue.

avdleeuw commented 9 years ago

This issue is happening on Buildhive as well. But apparently only during certain time slots.

Have a look at this build: https://buildhive.cloudbees.com/job/openhab/job/openhab/1106/?auto_refresh=false

It seems there's an 8 hour time difference introduced somewhere, which could easily be explained by timezone differences. I'm just not sure if that's really the cause.

kaikreuzer commented 9 years ago

@teichsta , you had dealed with the timzone tests a few weeks ago. Could this be somehow related? Any advice on how to stabilize this test?

Snickermicker commented 9 years ago

I'm pretty sure (but have been wrong before) that the root cause is in calimero-lib and how it deals with timezones and Java locales.

Snickermicker commented 9 years ago

Looking at the various build failures: it's not a certain time period where it failed, since I found the distributed from 8 am until 22pm. My current idea is, that (by mistake) the test cases only worked when executed in the "right" sequence and JUnit doesn't guarantee the sequence.

Snickermicker commented 9 years ago

The fix seems to work since the last 30 builds didn't show any problems in KNX binding anymore. Jenkins KNX binding test history I'd like to suggest to close this issue.

TomDeVlaminck commented 9 years ago

Dear Snickermicker, I just tried to compile after i updated to the latest head and got a failure in a test, it seems like the hour is one of, see results OS : osx yosemite / timezone is brussels-belgium (cest) time.euro.apple.com is used as timeserver. Any suggestions how to fix the test? I thought the following could help to determine if the test date is in a daylight savings period or not, i dont find code in the tests that factor this in?

Calendar c = Calendar.getInstance(TimeZone.getDefault()); // omit timezone for default tz c.set(1900, 01, 01, 0, 0, 0); // your date; omit this line for current date int offset = c.get(Calendar.DST_OFFSET);

Output on 3/11/2014 23:29

T E S T S

Running org.openhab.binding.knx.internal.config.KNXCoreTypeMapperTest Tests run: 95, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.587 sec <<< FAILURE! Running org.openhab.binding.knx.internal.config.KNXGenericBindingProviderTest Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.025 sec

Results :

Failed tests: testTypeMappingDateTime_19_001 (org.openhab.binding.knx.internal.config.KNXCoreTypeMapperTest): KNXCoreTypeMapper.toDPTValue() test failed for datapoint type "19.001" expected:"1900-01-01 0[0]:00:00" but was:"1900-01-01 0[1]:00:00"

Tests run: 103, Failures: 1, Errors: 0, Skipped: 0

Tests run: 103, Failures: 1, Errors: 0, Skipped: 0

Snickermicker commented 9 years ago

Hi, can you actually reproduce the failure? Thx

TomDeVlaminck commented 9 years ago

Hello, The failure is reproducable (from the original source, building on an ubuntu 14.04 serverwith all updates, timezone set to Brussels, Belgium. I think the problem is as I suggestedbefore that there is a daylight savings problem : git clone https://github.com/openhab/openhabmvn clean install gives error on unit test --> [INFO] Building jar: /opt/projects/openhab.org/openhab/bundles/binding/org.openhab.binding.knx.test/target/org.openhab.binding.knx.test-1.6.0-SNAPSHOT.jar[INFO] [INFO] --- tycho-p2-plugin:0.19.0:p2-metadata-default (default-p2-metadata-default) @ org.openhab.binding.knx.test ---[INFO] [INFO] --- tycho-surefire-plugin:0.19.0:test (default-test) @ org.openhab.binding.knx.test ---[INFO] Expected eclipse log file: /opt/projects/openhab.org/openhab/bundles/binding/org.openhab.binding.knx.test/target/work/data/.metadata/.log[INFO] Command line: /bin/sh -c cd /opt/projects/openhab.org/openhab/bundles/binding/org.openhab.binding.knx.test && /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java -Dosgi.noShutdown=false -Dosgi.os=linux -Dosgi.ws=gtk -Dosgi.arch=x86_64 -Dosgi.clean=true -jar /root/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.3.0.v20120522-1813/org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar -data /opt/projects/openhab.org/openhab/bundles/binding/org.openhab.binding.knx.test/target/work/data -install /opt/projects/openhab.org/openhab/bundles/binding/org.openhab.binding.knx.test/target/work -configuration /opt/projects/openhab.org/openhab/bundles/binding/org.openhab.binding.knx.test/target/work/configuration -application org.eclipse.tycho.surefire.osgibooter.headlesstest -testproperties /opt/projects/openhab.org/openhab/bundles/binding/org.openhab.binding.knx.test/target/surefire.propertiesSLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".SLF4J: Defaulting to no-operation (NOP) logger implementationSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. ------------------------------------------------------- T E S T S-------------------------------------------------------Running org.openhab.binding.knx.internal.config.KNXCoreTypeMapperTestTests run: 95, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.185 sec <<< FAILURE!Running org.openhab.binding.knx.internal.config.KNXGenericBindingProviderTestTests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.023 sec Results : Failed tests: testTypeMappingDateTime_19_001(org.openhab.binding.knx.internal.config.KNXCoreTypeMapperTest): KNXCoreTypeMapper.toDPTValue() test failed for datapoint type "19.001" expected:<1900-01-01 0[0]:00:00> but was:<1900-01-01 0[1]:00:00> Tests run: 103, Failures: 1, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------[INFO] Reactor Summary:[INFO] [INFO] openHAB ........................................... SUCCESS [ 0.255 s][INFO] openHAB Bundles ................................... SUCCESS [ 0.024 s][INFO] openHAB Actions ................................... SUCCESS [ 0.009 s][INFO] openHAB Core Components ........................... SUCCESS [ 0.033 s][INFO] openHAB Core ...................................... SUCCESS [ 1.154 s][INFO] openHAB Core Library .............................. SUCCESS [ 0.303 s][INFO] openHAB Core Script Engine ........................ SUCCESS [ 0.302 s][INFO] openHAB Mail Action ............................... SUCCESS [ 0.413 s][INFO] openHAB Prowl Action .............................. SUCCESS [ 0.275 s][INFO] openHAB I/O Components ............................ SUCCESS [ 0.018 s][INFO] openHAB Multimedia I/O ............................ SUCCESS [ 0.194 s][INFO] openHAB Console ................................... SUCCESS [ 0.236 s][INFO] openHAB Network I/O ............................... SUCCESS [ 0.397 s][INFO] openHAB Pushover Action ........................... SUCCESS [ 0.260 s][INFO] openHAB Squeeze Server ............................ SUCCESS [ 0.245 s][INFO] openHAB Squeezebox Action ......................... SUCCESS [ 0.380 s][INFO] openHAB Twitter Action ............................ SUCCESS [ 0.175 s][INFO] openHAB XBMC Action ............................... SUCCESS [ 0.194 s][INFO] openHAB XMPP Action ............................... SUCCESS [ 0.512 s][INFO] openHAB xPL Transport ............................. SUCCESS [ 0.329 s][INFO] openHAB xPL Action ................................ SUCCESS [ 0.232 s][INFO] openHAB NotifyMyAndroid Action .................... SUCCESS [ 0.208 s][INFO] openHAB Core Scheduler Service .................... SUCCESS [ 0.177 s][INFO] openHAB Configurations ............................ SUCCESS [ 0.020 s][INFO] openHAB Configuration Core ........................ SUCCESS [ 0.078 s][INFO] openHAB Models .................................... SUCCESS [ 0.004 s][INFO] openHAB Model Core ................................ SUCCESS [ 0.330 s][INFO] openHAB Model Items ............................... SUCCESS [ 10.171 s][INFO] openHAB Bindings .................................. SUCCESS [ 0.005 s][INFO] openHAB Homematic Binding ......................... SUCCESS [ 0.622 s][INFO] openHAB Homematic Action .......................... SUCCESS [ 0.115 s][INFO] openHAB OpenWebIf Action .......................... SUCCESS [ 0.158 s][INFO] openHAB Model Persistence ......................... SUCCESS [ 10.242 s][INFO] openHAB Core Persistence .......................... SUCCESS [ 0.203 s][INFO] openHAB Core Transformation Service ............... SUCCESS [ 0.260 s][INFO] openHAB Model Sitemap ............................. SUCCESS [ 19.593 s][INFO] openHAB UIs ....................................... SUCCESS [ 0.036 s][INFO] openHAB UI ........................................ SUCCESS [ 0.313 s][INFO] openHAB Lgtv Binding .............................. SUCCESS [ 0.290 s][INFO] openHAB Bluetooth Binding ......................... SUCCESS [ 0.236 s][INFO] openHAB Serial Transport .......................... SUCCESS [ 0.094 s][INFO] openHAB AutoUpdate Binding ........................ SUCCESS [ 0.197 s][INFO] openHAB KNX Binding ............................... SUCCESS [ 0.375 s][INFO] openHAB KNX Binding Tests ......................... FAILURE [ 3.410 s][INFO] openHAB Serial Binding ............................ SKIPPED[INFO] openHAB 1-Wire Binding ............................ SKIPPED[INFO] openHAB Wake-on-LAN binding ....................... SKIPPED

Date: Fri, 7 Nov 2014 04:47:27 -0800 From: notifications@github.com To: openhab@noreply.github.com CC: tom_de_vlaminck@hotmail.com Subject: Re: [openhab] Failed test (#1344)

Hi,

can you actually reproduce the failure?

Thx

— Reply to this email directly or view it on GitHub.

                  =
Snickermicker commented 9 years ago

I'm a bit clueless. Thing is: I'm testing on Ubuntu 14.04 timezone Amsterdam/Berlin and so far no error.

TomDeVlaminck commented 9 years ago

I will try that tonight on my server. Thanks in advance. Tom

--- Original Message ---

From: "Snickermicker" notifications@github.com Sent: 18 November 2014 09:58 To: "openhab/openhab" openhab@noreply.github.com Cc: "Tom De Vlaminck" tom_de_vlaminck@hotmail.com Subject: Re: [openhab] Failed test (#1344)

I'm a bit clueless. Thing is: I'm testing on Ubuntu 14.04 timezone Amsterdam/Berlin and so far no error.


Reply to this email directly or view it on GitHub: https://github.com/openhab/openhab/issues/1344#issuecomment-63439655

Snickermicker commented 9 years ago

Could you do me a favor and replace bundles/binding/org.openhab.binding.knx.test/src/test/java/org/openhab/binding/knx/internal/config/KNXCoreTypeMapperTest.java with this: KNXCoreTypeMapperTest.java This has a bit more output to pinpoint the issue.

TomDeVlaminck commented 9 years ago

I replaced the file and have this output : [INFO] Expected eclipse log file: /opt/projects/openhab.org/openhab/bundles/binding/org.openhab.binding.knx.test/target/work/data/.metadata/.log[INFO] Command line: /bin/sh -c cd /opt/projects/openhab.org/openhab/bundles/binding/org.openhab.binding.knx.test && /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java -Dosgi.noShutdown=false -Dosgi.os=linux -Dosgi.ws=gtk -Dosgi.arch=x86_64 -Dosgi.clean=true -jar /root/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.3.0.v20120522-1813/org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar -data /opt/projects/openhab.org/openhab/bundles/binding/org.openhab.binding.knx.test/target/work/data -install /opt/projects/openhab.org/openhab/bundles/binding/org.openhab.binding.knx.test/target/work -configuration /opt/projects/openhab.org/openhab/bundles/binding/org.openhab.binding.knx.test/target/work/configuration -application org.eclipse.tycho.surefire.osgibooter.headlesstest -testproperties /opt/projects/openhab.org/openhab/bundles/binding/org.openhab.binding.knx.test/target/surefire.propertiesSLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".SLF4J: Defaulting to no-operation (NOP) logger implementationSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. ------------------------------------------------------- T E S T S-------------------------------------------------------Running org.openhab.binding.knx.internal.config.KNXCoreTypeMapperTestTests run: 95, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.194 sec <<< FAILURE!Running org.openhab.binding.knx.internal.config.KNXGenericBindingProviderTestTests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.018 sec Results : Failed tests: testTypeMappingDateTime_19_001(org.openhab.binding.knx.internal.config.KNXCoreTypeMapperTest): KNXCoreTypeMapper.toDPTValue() reference test failed for datapoint type "19.001". TZ=Central European Time , TZ's DST offset=3600000, TZ uses DST: true expected:<1900-01-01 0[0]:00:00> but was:<1900-01-01 0[1]:00:00> Tests run: 103, Failures: 1, Errors: 0, Skipped: 0

Date: Tue, 18 Nov 2014 06:47:44 -0800 From: notifications@github.com To: openhab@noreply.github.com CC: tom_de_vlaminck@hotmail.com Subject: Re: [openhab] Failed test (#1344)

Could you do me a favor and replace

bundles/binding/org.openhab.binding.knx.test/src/test/java/org/openhab/binding/knx/internal/dpt/KNXCoreTypeMapperTest.java

with this: KNXCoreTypeMapperTest.java

This has a bit more output to pinpoint the issue.

— Reply to this email directly or view it on GitHub.

                  =
Snickermicker commented 9 years ago

I see that you are getting English text for time zone: "Central European Time". Shouldn't that be localized (maybe French). Not sure if this is related at all, but what locale are you using?

The code is (supposed to be) independent of DST. The test case failing does nothing but push a KNX byte representation of "1900-01-01 00:00:00" into the type mapper, then retrieves the data and compares. Internally, everything is mapped to milliseconds since epoch, so DST shouldn't matter.

Snickermicker commented 9 years ago

I hate to be a pest but could you replace bundles/binding/org.openhab.binding.knx.test/src/test/java/org/openhab/binding/knx/internal/config/KNXCoreTypeMapperTest.java with this: KNXCoreTypeMapperTest.java and bundles/binding/org.openhab.binding.knx/src/java/org/openhab/binding/knx/internal/dpt/KNXCoreTypeMapper.java with this: KNXCoreTypeMapper.java

Even more debug output. Thank you for spending the effort.

TomDeVlaminck commented 9 years ago

No problem ill do that this evening. Like to see it solved also. Thx Tom

--- Original Message ---

From: "Snickermicker" notifications@github.com Sent: 19 November 2014 12:50 To: "openhab/openhab" openhab@noreply.github.com Cc: "Tom De Vlaminck" tom_de_vlaminck@hotmail.com Subject: Re: [openhab] Failed test (#1344)

I hate to be a pest but could you replace bundles/binding/org.openhab.binding.knx.test/src/test/java/org/openhab/binding/knx/internal/config/KNXCoreTypeMapperTest.java with this: KNXCoreTypeMapperTest.java and bundles/binding/org.openhab.binding.knx/src/java/org/openhab/binding/knx/internal/config/KNXCoreTypeMapper.java with this: KNXCoreTypeMapper.java

Even more debug output. Thank you for spending the effort.


Reply to this email directly or view it on GitHub: https://github.com/openhab/openhab/issues/1344#issuecomment-63628804

TomDeVlaminck commented 9 years ago

Hi, the second download doesnt work, could you provide the correct link. Thx Tom

                  =
Snickermicker commented 9 years ago

Sorry, Here is the right stuft: https://github.com/Snickermicker/openhab/releases/tag/pr_1344_2

TomDeVlaminck commented 9 years ago

Hi, the result (used the 2 files in previous post)

T E S T S

Running org.openhab.binding.knx.internal.config.KNXCoreTypeMapperTest Locale: en_US sun.util.calendar.ZoneInfo[id="Europe/Brussels",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=184,lastRule=java.util.SimpleTimeZone[id=Europe/Brussels,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]] sun.util.calendar.ZoneInfo[id="CET",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=137,lastRule=java.util.SimpleTimeZone[id=CET,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=7200000,startTimeMode=1,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=7200000,endTimeMode=1]] Tests run: 95, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.171 sec <<< FAILURE! Running org.openhab.binding.knx.internal.config.KNXGenericBindingProviderTest Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.032 sec

Results :

Failed tests: testTypeMappingDateTime_19_001(org.openhab.binding.knx.internal.config.KNXCoreTypeMapperTest): KNXCoreTypeMapper.toDPTValue() reference test failed for datapoint type "19.001". TZ=Central European Time , TZ's DST offset=3600000, TZ uses DST: true expected:<1900-01-01 0[0]:00:00> but was:<1900-01-01 0[1]:00:00>

Tests run: 103, Failures: 1, Errors: 0, Skipped: 0

Snickermicker commented 9 years ago

It appears that the "new" KNXCoreTypeMapper.java was not used during your test. I would've expected some lines similar to this: toType(): Calimero ms: -2208988800000, mapper date: Mon Jan 01 00:00:00 CET 1900, mapper ms: -2208988800000, text: 1900-01-01T01:00:00, DateTimeType ms: -2208988800000, text: 1900-01-01T01:00:00 Did you overwrite the existing KNXCoreTypeMapper.java or do you have now two of them in different locations? I might be wrong, but it should be here: bundles/binding/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/dpt in previous versions it was in a different location. Sorry for the inconveniences.

TomDeVlaminck commented 9 years ago

I thought there was a problem. The link in the previous message shows two files wich i replaced. But in the message before the second file was absent and has another name. Can you verify this? Thx Tom

--- Original Message ---

From: "Snickermicker" notifications@github.com Sent: 20 November 2014 13:22 To: "openhab/openhab" openhab@noreply.github.com Cc: "Tom De Vlaminck" tom_de_vlaminck@hotmail.com Subject: Re: [openhab] Failed test (#1344)

It appears that the "new" KNXCoreTypeMapper.java was not used during your test. I would've expected some lines similar to this: toType(): Calimero ms: -2208988800000, mapper date: Mon Jan 01 00:00:00 CET 1900, mapper ms: -2208988800000, text: 1900-01-01T01:00:00, DateTimeType ms: -2208988800000, text: 1900-01-01T01:00:00 Did you overwrite the existing KNXCoreTypeMapper.java or do you have now two of them in different locations? I might be wrong, but it should be here: bundles/binding/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/dpt in previous versions it was in a different location. Sorry for the inconveniences.


Reply to this email directly or view it on GitHub: https://github.com/openhab/openhab/issues/1344#issuecomment-63800251

Snickermicker commented 9 years ago

Yup, you're right: copy and paste error. Please use the second link (https://github.com/Snickermicker/openhab/releases/tag/pr_1344_2).

TomDeVlaminck commented 9 years ago

I used the 2 files in the link :

T E S T S

Running org.openhab.binding.knx.internal.config.KNXCoreTypeMapperTest Locale: en_US sun.util.calendar.ZoneInfo[id="Europe/Brussels",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=184,lastRule=java.util.SimpleTimeZone[id=Europe/Brussels,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]] sun.util.calendar.ZoneInfo[id="CET",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=137,lastRule=java.util.SimpleTimeZone[id=CET,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=7200000,startTimeMode=1,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=7200000,endTimeMode=1]] Tests run: 95, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.187 sec <<< FAILURE! Running org.openhab.binding.knx.internal.config.KNXGenericBindingProviderTest Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.024 sec

Results :

Failed tests: testTypeMappingDateTime_19_001(org.openhab.binding.knx.internal.config.KNXCoreTypeMapperTest): KNXCoreTypeMapper.toDPTValue() reference test failed for datapoint type "19.001". TZ=Central European Time , TZ's DST offset=3600000, TZ uses DST: true expected:<1900-01-01 0[0]:00:00> but was:<1900-01-01 0[1]:00:00>

Tests run: 103, Failures: 1, Errors: 0, Skipped: 0

Snickermicker commented 9 years ago

Sorry, still didn't compile the right source. My guess: you didn't replace KNXCoreTypeMapper.java in it's original location (bundles/binding/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/dpt) But what I see is that the test didn't fail on the first timezone but the next. What is your build environment? Are you using oracle jdk?

watou commented 9 years ago

Did this issue ever get explained? I am trying build my fork which had been building fine with mvn clean install before, but now this testing is failing repeatedly:

Tests in error: 
  testAdd(org.openhab.binding.knx.internal.bus.KNXBusReaderSchedulerTest)

Tests run: 107, Failures: 0, Errors: 1, Skipped: 0

Instead of just skpping tests, I would like to understand the mystery...

Snickermicker commented 9 years ago

The error message posted seems to be unrelated to #1344. This issue was about failing time conversions.

Would you mind opening a new issue and including the exception that is thrown (if any)?

watou commented 9 years ago

Thanks. See #2097. I suggest trying the mvn clean install build for #1344 against Java 1.6 vs. Java 1.7 to see if that makes any difference.

neduz commented 9 years ago

Hello,

I'm experiencing the same problem I guess (see output: https://gist.github.com/neduz/cac01021fb2e82c4bf8b#file-failed-testtypemappingdatetime_19_001)

I'm running Ubuntu 14.10, using ubuntu-packaged java: java version "1.7.0_75" OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~utopic1) OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode) I'm also in the CET (Europe/Brussels) timezone, I'm not sure whether that's just a coincidence or not.

I see this issue was closed, what is the solution?

Snickermicker commented 9 years ago

From your log output I see the output: nl_BE Are sure you're on the latest commit?

neduz commented 9 years ago

I've created a new git clone in a seperate directory, Failed tests: testTypeMappingDateTime_19_001 nl_BE.UTF8 is the locale I'm using on my (Ubuntu) system.

StijnDS commented 9 years ago

Change time and date settings to a different timezone then Europe/Brussels. I chose London & "mvn clean install" worked without errors.

Snickermicker commented 9 years ago

I believe to have finally found the issue. The last comment help tremendously. Actually the code works fine, but the test itself is bogus. Will propose a pull request.