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 implicit attach test cases for channel publish and subscribe #115

Merged
merged 13 commits into from Apr 1, 2016

Conversation

gokhanbarisaker
Copy link
Contributor

Resolves: #45

  • RTL6c3
  • RTL7c
  • RTP6c
  • RTP8d
  • RTP11b
  • RTP15e

@gokhanbarisaker gokhanbarisaker force-pushed the channel-test-implicitattach branch 2 times, most recently from e7d79a3 to 1510587 Compare March 7, 2016 14:00
@mattheworiordan
Copy link
Member

LGTM, a few small comments

@gokhanbarisaker
Copy link
Contributor Author

What would you like me to use for error code? Is 90001 fine for Presence#get(...)?

@mattheworiordan
Copy link
Member

LGTM, @paddybyers you happy for this to be merged now?

* @return: the current present members.
* @throws AblyException
*/
public synchronized PresenceMessage[] get() {
public synchronized PresenceMessage[] get() throws AblyException {
if (channel.state == ChannelState.failed) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this check here, and not on the other methods below?

Edit: in fact, doesn't the attach() already throw if the state is failed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My current focus is on Presence with this pull request. If other methods have features like RTP11b, I am happy to implement that for them also

Copy link
Member

Choose a reason for hiding this comment

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

If the channel is in the failed state, does the attach() throw an exception? If so, the check above (l44) can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, channel.attach() does not throw an exception for it. Would you like me to move the state check to channel.attach(), instead of presence.get()?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Would you like me to move the state check to channel.attach(), instead of presence.get()?

No, we think that the state should be checked in Presence.get(), only calling attach() if not failed.

So please add that check to the other get() variants below.

@paddybyers
Copy link
Member

@paddybyers you happy for this to be merged now?

See my comment above.


/* wait until connected */
new ConnectionWaiter(ably.connection).waitFor(ConnectionState.connected);
assertEquals("Verify failed state reached", ably.connection.state, ConnectionState.connected);
Copy link
Member

Choose a reason for hiding this comment

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

This is verifying that the connected state is reached, not failed as in the message. (This problem also exists in the test cases below.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

holy copy & paste, my bad. fixing now

@paddybyers
Copy link
Member

See my comments on the tests. I stopped adding comments because I think they all have the same problem.

@paddybyers paddybyers merged commit 040a55d into ably:master Apr 1, 2016
@paddybyers
Copy link
Member

Thanks

gokhanbarisaker added a commit to gokhanbarisaker/ably-java that referenced this pull request Apr 1, 2016
gokhanbarisaker added a commit to gokhanbarisaker/ably-java that referenced this pull request Apr 1, 2016
gokhanbarisaker added a commit to gokhanbarisaker/ably-java that referenced this pull request Apr 1, 2016
gokhanbarisaker added a commit to gokhanbarisaker/ably-java that referenced this pull request Apr 1, 2016
gokhanbarisaker added a commit to gokhanbarisaker/ably-java that referenced this pull request Apr 1, 2016
gokhanbarisaker added a commit to gokhanbarisaker/ably-java that referenced this pull request Apr 1, 2016
gokhanbarisaker added a commit to gokhanbarisaker/ably-java that referenced this pull request Apr 1, 2016
gokhanbarisaker added a commit to gokhanbarisaker/ably-java that referenced this pull request Apr 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants