Skip to content

Conversation

@kamleshbhatt
Copy link
Contributor

No description provided.

ls2.put("b",globalStreamId_d);
Assert.assertEquals(globalStreamId_d, ls2.get("b"));
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think testEmptyState is redundant. All these features are already tested in above testLocalState.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also guess so. You can remove it.

@HeartSaVioR
Copy link
Contributor

Could you create a new branch based on current master and work from there, and submit PR?
You need to pull master before starting.

Copy link
Contributor

@HeartSaVioR HeartSaVioR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed for the first pass and left comments.


@Test
public void testLocalState() throws IOException{
TmpPath dir1_tmp = new TmpPath();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use try-with-resource to make it compatible with with-open in Clojure. It should cover dir1_tmp and dir2_tmp.


ls1.put("a",globalStreamId_a);
ls1.put("b",globalStreamId_b);
Assert.assertTrue(ls1.snapshot().containsKey("a"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below comparisons are broken: {"a" globalStreamId_b "b" globalStreamId_a} will pass.

I guess you can compare two Maps directly since Map.equals defines how implementation should compare each other properly.
https://docs.oracle.com/javase/7/docs/api/java/util/Map.html#equals(java.lang.Object)

Assert.assertTrue(ls1.snapshot().containsValue(globalStreamId_a));
Assert.assertTrue(ls1.snapshot().containsKey("b"));
Assert.assertTrue(ls1.snapshot().containsValue(globalStreamId_b));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You seemed to miss below lines:

-      (is (= {} (.snapshot ls2)))		
-      (is (= gs-a (.get ls1 "a")))		
-      (is (= nil (.get ls1 "c")))		
-      (is (= gs-b (.get ls1 "b")))		
-      (is (= {"a" gs-a "b" gs-b} (.snapshot (LocalState. dir1))))

ls2.put("b",globalStreamId_d);
Assert.assertEquals(globalStreamId_d, ls2.get("b"));
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also guess so. You can remove it.

@kamleshbhatt
Copy link
Contributor Author

@HeartSaVioR ,my apology for not responding to this early as some urgent travel came up for me. Thanks for reviewing the PR. As you suggested I'll apply the review comments and submit a separate PR.

@HeartSaVioR
Copy link
Contributor

@kamleshbhatt Any updates?

@kamleshbhatt
Copy link
Contributor Author

My sincere apology for the delay on this. As you suggested I am closing this PR and submit the revised one soon.

Thanks for all your help.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants