Skip to content
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

Add Timestamped Nodes support to Send Operation at Server side. #1218

Closed
wants to merge 20 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
291c926
Add Timestamped nodes support to Send Operation at server side.
Mar 2, 2022
f46fc9f
Fix javadoc issue : no description for @param
sbernard31 Mar 10, 2022
20f189b
Fix Eclipse Warnings.
sbernard31 Mar 10, 2022
19b1831
Fix some formatting issue
sbernard31 Mar 10, 2022
1fe56a7
SendRequest : remove duplicate code.
sbernard31 Mar 10, 2022
2e95bb9
Removed unused TimestampedInstanceEnabler.
sbernard31 Mar 10, 2022
4b89dd5
Revert formatting as it seems there is no other changes in this file
sbernard31 Mar 10, 2022
aa6817e
add some check to Default Decoder/Encoder
sbernard31 Mar 10, 2022
b15ec7f
Fix retro comptability in EventServlet to not break the demo.
sbernard31 Mar 10, 2022
ae0073f
Rename : remove "Multi" in (encode/decode)MultiTimestampedNodes.
sbernard31 Mar 10, 2022
2249f45
Rename getNodesForTimestamp in getNodesAt
sbernard31 Mar 10, 2022
758fd57
Fix LwM2mNodeDecoderTest.senml_multiple_timestamped_nodes
sbernard31 Mar 16, 2022
278ee9b
Make TimestampedLwM2mNodes really immutable.
sbernard31 Mar 16, 2022
d346379
Add some validation.
sbernard31 Mar 16, 2022
a0f18ad
Use fluent notation in senml_multiple_timestamped_nodes test
sbernard31 Mar 17, 2022
65be110
Fix test name and remove duplicate tests in TimestampedLwM2mNodesTest
sbernard31 Mar 17, 2022
343a97f
Fix TimestampedLwM2mNodes.toString()
sbernard31 Mar 17, 2022
5d01cec
Fix LwM2mNodeDecoderTest.senml_multiple_timestamped_nodes test
sbernard31 Mar 17, 2022
74b3eb1
Add some path/node consistency validation in TimestampedLwM2mNodes
sbernard31 Mar 17, 2022
9f69122
Remove unnecessary empty line TimestampedLwM2mNodesTest
sbernard31 Mar 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1268,30 +1268,30 @@ public void senml_multiple_timestamped_nodes() throws CodecException {
StringBuilder b = new StringBuilder();
b.append("[{\"bn\":\"/4/0/\",\"bt\":268600000,\"n\":\"0\",\"v\":1,\"t\":1},");
b.append("{\"n\":\"1\",\"v\":2,\"t\":2},");
b.append("{\"n\":\"1\",\"v\":2,\"t\":3},");
b.append("{\"n\":\"2\",\"v\":3,\"t\":3},");
sbernard31 marked this conversation as resolved.
Show resolved Hide resolved
b.append("{\"bn\":\"/3/0/7/\",\"n\":\"0\",\"v\":3800}");
b.append("]");

// when
TimestampedLwM2mNodes data = decoder.decodeTimestampedNodes(b.toString().getBytes(),
ContentFormat.SENML_JSON, model);
TimestampedLwM2mNodes data = decoder.decodeTimestampedNodes(b.toString().getBytes(), ContentFormat.SENML_JSON,
model);

// then
Map<Long, Map<LwM2mPath, LwM2mNode>> expectedResult = data.getTimestampedNodes();
Map<Long, Map<LwM2mPath, LwM2mNode>> expectedResult = new HashMap<>();
Map<LwM2mPath, LwM2mNode> first = new HashMap<>();
first.put(new LwM2mPath("/3/0/7/0"), LwM2mResourceInstance.newIntegerInstance(0, 3000));
first.put(new LwM2mPath("/3/0/7/0"), LwM2mResourceInstance.newIntegerInstance(0, 3800));
expectedResult.put(268600000L, first);

Map<LwM2mPath, LwM2mNode> second = new HashMap<>();
second.put(new LwM2mPath("/4/0/0"), LwM2mResourceInstance.newIntegerInstance(0, 1));
second.put(new LwM2mPath("/4/0/0"), LwM2mSingleResource.newIntegerResource(0, 1));
expectedResult.put(268600001L, second);

Map<LwM2mPath, LwM2mNode> third = new HashMap<>();
third.put(new LwM2mPath("/4/0/1"), LwM2mResourceInstance.newIntegerInstance(0, 2));
third.put(new LwM2mPath("/4/0/1"), LwM2mSingleResource.newIntegerResource(1, 2));
expectedResult.put(268600002L, third);

Map<LwM2mPath, LwM2mNode> fourth = new HashMap<>();
fourth.put(new LwM2mPath("/4/0/2"), LwM2mResourceInstance.newIntegerInstance(0, 3));
fourth.put(new LwM2mPath("/4/0/2"), LwM2mSingleResource.newIntegerResource(2, 3));
expectedResult.put(268600003L, fourth);

assertEquals(expectedResult, data.getTimestampedNodes());
Expand Down