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

Test suite websocket #169

Merged
merged 9 commits into from
Jan 27, 2016
Merged

Test suite websocket #169

merged 9 commits into from
Jan 27, 2016

Conversation

ricardopereira
Copy link
Contributor

I was using client.transition to simulate incomings of errors & connection state change and it is wrong because some of the logic is missed.

To change the connection states:

  • client.onConnected(message: ARTProtocolMessage)
  • client.onDisconnected()
  • client.onSuspended()
  • client.onError(AblyTests.simulateError())

With this PR we have:

  • simulateIncomingNormalClose
  • simulateIncomingAbruptlyClose
  • simulateIncomingError
  • simulateLostConnection

…e, simulateIncomingError and simulateLostConnection
 - Tests should use each event (onConnected, onError, onDisconnected,
onSuspended…) to change the connection state because using the
`transition` method will ignore some logic.
@ricardopereira
Copy link
Contributor Author

@tcard What do you think?
@mattheworiordan I really needed this. There were several solutions around the test suite.

@@ -446,7 +446,7 @@ -(void) cancelPingTimer {
self.pingTimeout = nil;
}

- (void)onHeartbeat:(ARTProtocolMessage *)message {
- (void)onHeartbeat {
Copy link
Member

Choose a reason for hiding this comment

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

Why did you remove the ProtocolMessage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the method was not using it.

@mattheworiordan
Copy link
Member

Looks fine, few comments re: naming

This was referenced Jan 27, 2016
@tcard
Copy link
Contributor

tcard commented Jan 27, 2016

LGTM

ricardopereira added a commit that referenced this pull request Jan 27, 2016
@ricardopereira ricardopereira merged commit 667dbff into master Jan 27, 2016
@ricardopereira ricardopereira deleted the test-suite-websocket branch January 27, 2016 19:04
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.

3 participants