Package org.orgama.shared.auth.action

Examples of org.orgama.shared.auth.action.InitiateRegistration


     * @param authSource
     */
    @Override
    public void onAuthSourceSelected(AuthSourceInfo authSource) {
       
    final InitiateRegistration registration = new InitiateRegistration();
   
    registration.setAuthResourceName(authSource.getResourceName());
    registration.setEmailAddress(emailAddress);
   
    registration.setDisptachListener(new IDispatchListener() {

      @Override
      public void onDispatch() {
        BlockUi.blockAllWithMessage("Registering...");
      }

      @Override
      public void onResponse() {
      }
    });
   
    Dispatch.dispatch(registration,
        new OrgAsyncCallback<InitiateRegistrationResult>() {

      @Override
      public void onFailure(ClientSideException ex) {
        Logger.error("Error registering with " +
            registration.getAuthResourceName(), ex);
      }

      @Override
      public void onSuccess(InitiateRegistrationResult result) {
        //Should never get here
View Full Code Here


  public void tearDown() {
  }
 
  @Test
  public void testInitiateRegistrationWithGoogleAccounts() throws Exception {
    InitiateRegistration registration = new InitiateRegistration();
   
    registration.setAuthResourceName(AuthServiceName.googleAccounts);
    registration.setEmailAddress(emailAddress1);
   
    InitiateRegistrationResult result =
        (InitiateRegistrationResult)dispatch.execute(
            null, registration);
   
View Full Code Here

  }
 
  @Test
  public void testSomeErrorConditions() {
    try {
      InitiateRegistration registration = new InitiateRegistration();

      registration.setAuthResourceName("Yo mama");
      registration.setEmailAddress(emailAddress1);

      dispatch.execute(null, registration);
      fail("This should have caused an error");
    }
    catch(Exception ex) {
      //this is expected
    }
   
    try {
      InitiateRegistration registration = new InitiateRegistration();

      registration.setAuthResourceName(AuthServiceName.googleAccounts);
      registration.setEmailAddress(null);

      dispatch.execute(null, registration);
      fail("This should have caused an error");
    }
    catch(Exception ex) {
      //this is expected
    }
   
    try {
      InitiateRegistration registration = new InitiateRegistration();

      registration.setAuthResourceName(AuthServiceName.googleAccounts);
      registration.setEmailAddress(emailAddress2);

      dispatch.execute(null, registration);
      fail("This should have caused an error");
    }
    catch(Exception ex) {
View Full Code Here

    authInit.setServiceSpecificUserId(env.getEmailAddress());
    AuthUser user = userService.registerNewUser(authInit);
    sessionService.create(user, authInit);
   
    try {
      InitiateRegistration action =
          new InitiateRegistration();
      action.setAuthResourceName(AuthServiceName.googleAccounts);
      action.setEmailAddress(env.getEmailAddress());
      dispatch.execute(null, action);

      fail("This should have thrown an exception");
    }
    catch(Exception ex) {
View Full Code Here

    authInit.setEmailAddress(env.getEmailAddress());
    authInit.setServiceSpecificUserId(env.getEmailAddress());
    AuthUser user = userService.registerNewUser(authInit);
   
    try {
      InitiateRegistration action =
          new InitiateRegistration();
      action.setAuthResourceName(AuthServiceName.googleAccounts);
      action.setEmailAddress(env.getEmailAddress());
      dispatch.execute(null, action);

      fail("This should have thrown an exception");
    }
    catch(Exception ex) {
View Full Code Here

TOP

Related Classes of org.orgama.shared.auth.action.InitiateRegistration

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.