Package com.calclab.emite.core.events

Examples of com.calclab.emite.core.events.AuthorizationResultEvent


            return;
          }
        }
        setStatus(SessionStatus.authorized);
        mode = SessionMode.ready;
        eventBus.fireEventFromSource(new AuthorizationResultEvent(credentials), this);
        connection.restartStream();
        bindResource(credentials.isAnoymous() ? null : credentials.getURI().getResource());
      } else if ("failure".equals(name) && XmppNamespaces.SASL.equals(xmlns)) {
        setStatus(SessionStatus.notAuthorized);
        mode = SessionMode.offline;
View Full Code Here


  }

  @Test
  public void shouldHandleFailedAuthorizationResult() {
    connection.connect();
    eventBus.fireEvent(new AuthorizationResultEvent());
    assertFalse(connection.isConnected());
  }
View Full Code Here

    assertFalse(connection.isConnected());
  }

  @Test
  public void shouldHandleSucceedAuthorizationResult() {
    eventBus.fireEvent(new AuthorizationResultEvent(new Credentials(uri("node@domain"), "pass")));

    assertEquals(SessionStatus.authorized, session.getStatus());
    assertTrue(connection.isStreamRestarted());
    verify(bindingManager).bindResource(anyString());
  }
View Full Code Here

TOP

Related Classes of com.calclab.emite.core.events.AuthorizationResultEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.