amino-os / Amino.Run

Amino Distributed OS - Runtime Manager
Apache License 2.0
29 stars 12 forks source link

Fix KeyValueStoreClient example to fail if received value is not correct #818

Closed quinton-hoole closed 4 years ago

quinton-hoole commented 4 years ago

The example was actually returning two different Dates (one representing the put time, and the other the get time), which just happened to look the same because they were formatted with only second resolution.

This fix sets an explicit date in the past, and checks via an assertion that the retrieved date is the same (which it isn't due to a bug).

Task :examples:kvstorejs:runapp
...
<client>: setting key_0 = Mon Jan 20 04:20:00 PST 1969
...
<client>: got value Wed Sep 18 16:42:42 PDT 2019 with key key_0
Exception in thread "main" java.lang.AssertionError: Retrieved value is not equal to set value - see https://github.com/amino-os/Amino.Run/issues/725#issuecomment-532772106
        at amino.run.appdemo.KeyValueStoreClient.main(KeyValueStoreClient.java:61)
...
quinton-hoole commented 4 years ago

No reviewers. Uncontroversial change. Self-merging.