Guest User

Untitled

a guest
Jun 27th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. [Test(async)]
  2. public function userLogin_badCredentials_FailedLogin():void {
  3. var username:String = "guest";
  4. var password:String = "not_the_right_password";
  5.  
  6. var token:AsyncToken = authenticationService.userLogin(username, password);
  7. token.addResponder(Async.asyncResponder(this, new TestResponder(handleRemoteObjectNoExpectedResult, handleRemoteObjectExpectedFaultBadCredentials), TIMEOUT, username, handleTestTimeout));
  8. }
  9.  
  10.  
  11. [Test(async)]
  12. public function userLoginLogout_UserLoggedIn_SuccessfulLoginLogout():void {
  13. var username:String = "admin";
  14. var password:String = "admin";
  15.  
  16. var token:AsyncToken = authenticationService.userLogin(username, password);;
  17. token.addResponder(Async.asyncResponder(this, new TestResponder(userLoginLogout2_UserLoggedIn_SuccessfulLoginLogout, handleUnexpectedFault), TIMEOUT, username, handleTestTimeout));
  18. }
  19. public function userLoginLogout2_UserLoggedIn_SuccessfulLoginLogout(event:ResultEvent, passThroughData:Object):void {
  20. // Must have logged in correctly
  21. assertTrue(serviceManager.channelSet.authenticated);
  22.  
  23. // Now lets test logout
  24. var token:AsyncToken = authenticationService.userLogout();
  25. token.addResponder(Async.asyncResponder(this, new TestResponder(handleExpectedResult, handleUnexpectedFault), TIMEOUT, null, handleTestTimeout));
  26. }
  27.  
  28. Channel.Ping.Failed error Detected duplicate HTTP-based FlexSessions, generally
  29. due to the remote host disabling session cookies. Session cookies must be enabled
  30. to manage the client connection correctly.
Add Comment
Please, Sign In to add comment