Package com.ibm.sbt.services.client.connections.profiles

Examples of com.ibm.sbt.services.client.connections.profiles.ProfileService


    }
    return null;
  }
 
  public static String getProfileXMLString(){
    ProfileService svc = new ProfileService("connections");
    Profile prof=null;
    String xmlText = null;
    try {
      prof = svc.getMyProfile();
      xmlText =DOMUtil.getXMLString((Node)prof.getDataHandler().getData());
    } catch (XMLException e) {
      e.printStackTrace();
    }
    catch (ProfileServiceException e) {
View Full Code Here


  /**
   * This test uses urls with ?param1=value&param2=value parameters
   */
  @Test
  public void testGenerateUrlWithUrlParameters(){
    ProfileService service = new ProfileService();
    String urlAssertEmail = "profiles/atom/connection.do?sourceEmail=bjordan%40renovations.com&targetEmail=fadams%40renovations.com&connectionType=colleague";
    String sourceId = "bjordan@renovations.com";
    String targetId = "fadams@renovations.com";
    String url = ProfileUrls.CHECK_COLLEAGUE.format(service, ProfileParams.sourceId.get(sourceId), ProfileParams.targetId.get(targetId));
    assertEquals(urlAssertEmail, url);
View Full Code Here

    assertEquals(urlAssertEmail, url);
  }

  @Test
  public void testGenerateUrlWithMissingUrlParameters(){
    ProfileService service = new ProfileService();
    String sourceId = "bjordan@renovations.com";

    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage("Missing parameter");
    ProfileUrls.CHECK_COLLEAGUE.format(service, ProfileParams.sourceId.get(sourceId));
View Full Code Here

    ProfileUrls.CHECK_COLLEAGUE.format(service, ProfileParams.sourceId.get(sourceId));
  }

  @Test
  public void testGenerateUrlWithUrlParametersNameAndValue(){
    ProfileService service = new ProfileService();
    String urlAssert = "profiles/atom/connection.do?connectionId=12345678";
    String url = ProfileUrls.CONNECTION.format(service, ProfileUrls.getConnectionId("12345678"));
    assertEquals(urlAssert, url);
  }
View Full Code Here

    }
   
    public Profile getProfile(String userId) {
        createContext();
       
        ProfileService profileService = getProfileService();
        Profile profile = null;
        try {
            profile = profileService.getProfile(userId);
        } catch (ClientServicesException cse) {
            Assert.fail("Error get profile: " + cse.getMessage());
            cse.printStackTrace();
    }
        return profile;
View Full Code Here

        return profile;
    }
   
    protected ProfileService getProfileService() {
        if (profileService == null) {
            profileService = new ProfileService();
        }
        return profileService;
    }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.connections.profiles.ProfileService

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.