Examples of Invite


Examples of com.ibm.sbt.services.client.connections.communities.Invite

      String id2 = getProperty("sample.id2");
      if (getEnvironment().isSmartCloud()) {
        displayName2 = getProperty("smartcloud.displayName2");
        id2 = getProperty("smartcloud.id2");
      }
      Invite invite = createInvite(community, id2);
     
        addSnippetParam("CommunityService.communityUuid", community.getCommunityUuid());
        addSnippetParam("CommunityService.inviteeUuid", invite.getInviteeUuid());
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNull("Unexpected error detected on page", json.getString("code"));
        String inviteUuid = community.getCommunityUuid() + "-" + invite.getInviteeUuid();
        Assert.assertEquals(inviteUuid, json.getString("inviteUuid"));
    }
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.communities.Invite

      String id2 = getProperty("sample.id2");
      if (getEnvironment().isSmartCloud()) {
        displayName2 = getProperty("smartcloud.displayName2");
        id2 = getProperty("smartcloud.id2");
      }
      Invite invite = createInvite(community, id2);
     
        addSnippetParam("CommunityService.communityUuid", "foo");
        addSnippetParam("CommunityService.inviteeUuid", invite.getInviteeUuid());
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertEquals(500, json.getAsInt("code"));
        Assert.assertEquals("Error generating atom document.", json.getString("message"));
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.communities.Invite

      String id2 = getProperty("sample.id2");
      if (getEnvironment().isSmartCloud()) {
        displayName2 = getProperty("smartcloud.displayName2");
        id2 = getProperty("smartcloud.id2");
      }
      Invite invite = createInvite(community, id2);
     
        addSnippetParam("CommunityService.communityUuid", "");
        addSnippetParam("CommunityService.inviteeUuid", invite.getInviteeUuid());
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertEquals(400, json.getAsInt("code"));
        Assert.assertEquals("Invalid argument, invite with community UUID must be specified.", json.getString("message"));
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.communities.Invite

      String id2 = getProperty("sample.id2");
      if (getEnvironment().isSmartCloud()) {
        displayName2 = getProperty("smartcloud.displayName2");
        id2 = getProperty("smartcloud.id2");
      }
      Invite invite = createInvite(community, id2);
     
        addSnippetParam("CommunityService.communityUuid", community.getCommunityUuid());
        addSnippetParam("CommunityService.inviteeUuid", "foo");
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.communities.Invite

      String id2 = getProperty("sample.id2");
      if (getEnvironment().isSmartCloud()) {
        displayName2 = getProperty("smartcloud.displayName2");
        id2 = getProperty("smartcloud.id2");
      }
      Invite invite = createInvite(community, id2);
     
        addSnippetParam("CommunityService.communityUuid", community.getCommunityUuid());
        addSnippetParam("CommunityService.inviteeUuid", "");
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.communities.Invite

      return false;
    }
   
    protected Invite createInvite(Community community, String userid) {
      try {
        Invite invite = new Invite(communityService);
        invite.setCommunityUuid(community.getCommunityUuid());
        invite.setUserid(userid);
        return communityService.createInvite(invite);
      } catch (ClientServicesException cse) {
        fail("Error creating invite",cse);
      }
      return null;
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.communities.Invite

      if (getEnvironment().isSmartCloud()) {
          name2 = getProperty("smartcloud.displayName2");
          userid2 = getProperty("smartcloud.userId2");
          email2 = getProperty("smartcloud.email2");
      }
        Invite invite = createInvite(community, userid2);
     
        addSnippetParam("CommunityService.communityUuid", community.getCommunityUuid());
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        List jsonList = previewPage.getJsonList();
        Assert.assertFalse("Get all invites returned no invites", jsonList.isEmpty());
View Full Code Here

Examples of com.sissi.protocol.muc.Invite

   * Super.write plus {"invite":invite.from,"reason":invite.reason,"continue":invite.continued,"type":"invite"}
   *
   * @see com.sissi.persistent.impl.PersistentMessage#write(com.sissi.protocol.Element)
   */
  public Map<String, Object> write(Element element) {
    Invite invite = Message.class.cast(element).getMuc().getInvite();
    Map<String, Object> entity = super.write(element);
    entity.put(Dictionary.FIELD_INVITE, invite.getFrom());
    entity.put(Dictionary.FIELD_REASON, invite.reason());
    entity.put(Dictionary.FIELD_CONTINUE, invite.continued());
    entity.put(Dictionary.FIELD_TYPE, Dictionary.FIELD_INVITE);
    return entity;
  }
View Full Code Here

Examples of com.sissi.protocol.muc.Invite

   * @see com.sissi.persistent.impl.PersistentMessage#read(java.util.Map)
   */
  @Override
  public Message read(Map<String, Object> element) {
    Message message = Message.class.cast(super.read(element, new Message()));
    return message.muc(new XUser().invite(new Invite().reason(super.toString(element, Dictionary.FIELD_REASON)).continued(super.toString(element, Dictionary.FIELD_CONTINUE)).setFrom(element.get(Dictionary.FIELD_INVITE).toString()))).delay(super.delay(element, message)).request(Boolean.valueOf(element.get(Dictionary.FIELD_ACK).toString()));
  }
View Full Code Here

Examples of com.sissi.protocol.muc.Invite

    this.room = room;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Invite invite = protocol.cast(Message.class).getMuc().password(this.room.build(super.build(protocol.parent().getTo())).pull(Dictionary.FIELD_PASSWORD, String.class)).getInvite();
    super.findOne(super.build(invite.getTo()), true).write(this.prepareAndReturn(context, protocol.cast(Message.class), invite).reply());
    return true;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.