IT test for long values#713
Conversation
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
| "messages/testinglongvalues", | ||
| null, | ||
| HttpExtension.GET, CLOUD_EVENT_LIST_TYPE_REF).block(); | ||
| assertEquals(590518626939830271L, messages.get(0).getData()); |
There was a problem hiding this comment.
@tanvigour Why do we have to publish N messages and then check only one message ?
There was a problem hiding this comment.
we can check for all values, just added a commit for that
Signed-off-by: tanvigour <[email protected]>
mukundansundar
left a comment
There was a problem hiding this comment.
overall lgtm ... if possible test for larger values of long and varied values ....
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
|
@tanvigour |
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
mukundansundar
left a comment
There was a problem hiding this comment.
@tanvigour Please address these comments.
| } | ||
|
|
||
| public static class ConvertToLong { | ||
| public Long value; |
| public void setVal(Long value) { | ||
| this.value = value; | ||
| } | ||
| } |
There was a problem hiding this comment.
Add getter for value, and equals and Dashcode method (Can autogenerate in IntelliJ using Objects.hash etc ).
| } | ||
|
|
||
| ConvertToLong value = new ConvertToLong(); | ||
| value.setVal(590518626939830271L); |
There was a problem hiding this comment.
Create a Random object to generate random values with 590518626939830271L as seed.
Create a Set HashSet,
Add 590518626939830271L as the first element.
Add more random long values upto NUM_MESSAGES size.
| client.publishEvent( | ||
| PUBSUB_NAME, | ||
| LONG_TOPIC_NAME, | ||
| value, |
There was a problem hiding this comment.
create iterator of the set, and send the next element here.
| daprRun.getAppName(), | ||
| "messages/testinglongvalues", | ||
| null, | ||
| HttpExtension.GET, CLOUD_EVENT_LIST_TYPE_REF).block(); |
There was a problem hiding this comment.
ADD an new TypeRef
private static final TypeRef<List<CloudEvent<ConvertToLong>>> CLOUD_EVENT_LONG_LIST_TYPE_REF = new TypeRef<>() {};
use that here .
| null, | ||
| HttpExtension.GET, CLOUD_EVENT_LIST_TYPE_REF).block(); | ||
| for (int i = 0; i < NUM_MESSAGES; i++) { | ||
| System.out.println("The long value received!!! " +messages.get(i).getData().value); |
| "messages/testinglongvalues", | ||
| null, | ||
| HttpExtension.GET, CLOUD_EVENT_LIST_TYPE_REF).block(); | ||
| for (int i = 0; i < NUM_MESSAGES; i++) { |
There was a problem hiding this comment.
| for (int i = 0; i < NUM_MESSAGES; i++) { | |
| Assert.assertNotNull(messages); | |
| for (int i = 0; i < messages.size(); i++) { |
| HttpExtension.GET, CLOUD_EVENT_LIST_TYPE_REF).block(); | ||
| for (int i = 0; i < NUM_MESSAGES; i++) { | ||
| System.out.println("The long value received!!! " +messages.get(i).getData().value); | ||
| assertEquals(590518626939830271L, messages.get(i).getData().value); |
There was a problem hiding this comment.
Add it to the actual ConvertToLong Set created above.
actual.add(message.getData()| assertEquals(590518626939830271L, messages.get(i).getData().value); | ||
| } | ||
| }, 2000); | ||
| } |
There was a problem hiding this comment.
Add assert comparing two set values
Assert.assertEquals(expected, actual);Both expected and actual are of type Set<ConvertToLong
| } | ||
|
|
||
| @Test | ||
| public void testlongValues() throws Exception { |
There was a problem hiding this comment.
| public void testlongValues() throws Exception { | |
| public void testLongValues() throws Exception { |
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
|
Tested this locally ... it is working ... with latest master Dapr after contrib 1.7-rc merge @tanvigour is the test working for you locally ? |
…ue to set Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
Signed-off-by: tanvigour <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #713 +/- ##
=========================================
Coverage 78.19% 78.19%
Complexity 1117 1117
=========================================
Files 97 97
Lines 3417 3417
Branches 399 399
=========================================
Hits 2672 2672
Misses 547 547
Partials 198 198 Continue to review full report at Codecov.
|
mukundansundar
left a comment
There was a problem hiding this comment.
lgtm
cc @artursouza
* run IT test for long values Signed-off-by: tanvigour <[email protected]> * Fix the class name Signed-off-by: tanvigour <[email protected]> * assert for all messages and fix class name Signed-off-by: tanvigour <[email protected]> * test for Long.MAX_VALUE Signed-off-by: tanvigour <[email protected]> * revert back long number and print Signed-off-by: tanvigour <[email protected]> * fix the typo Signed-off-by: tanvigour <[email protected]> * update the latest dapr commit in workflow files Signed-off-by: tanvigour <[email protected]> * log some more data to debug Signed-off-by: tanvigour <[email protected]> * debug Signed-off-by: tanvigour <[email protected]> * get the value from messages Signed-off-by: tanvigour <[email protected]> * address feedback Signed-off-by: tanvigour <[email protected]> * change the assertion Signed-off-by: tanvigour <[email protected]> * Add hashcode and equals functione and create new obj while adding value to set Signed-off-by: tanvigour <[email protected]> * move iterator Signed-off-by: tanvigour <[email protected]> * log value before adding to hashset Signed-off-by: tanvigour <[email protected]> * log value before adding to hashset Signed-off-by: tanvigour <[email protected]> * log value before adding to hashset Signed-off-by: tanvigour <[email protected]> * change assertion Signed-off-by: tanvigour <[email protected]> * fix equals method Signed-off-by: tanvigour <[email protected]> * adding debugging for expected value Signed-off-by: tanvigour <[email protected]> * adding logs for expected value Signed-off-by: tanvigour <[email protected]> * log value before adding to hashset Signed-off-by: tanvigour <[email protected]> Co-authored-by: Mukundan Sundararajan <[email protected]> Signed-off-by: Artur Souza <[email protected]>
Description
Please explain the changes you've made
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #686
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: