예제 #1
0
  @Test
  public final void testMyName() {
    System.out.println(
        "applicationProperties:" + "myComponent:" + applicationProperties.getDisplayName());

    System.out.println("myPluginComponent.getName():" + myPluginComponent.getName());

    assertEquals(
        "names do not match!",
        "myComponent:" + applicationProperties.getDisplayName(),
        myPluginComponent.getName());
  }
 @Test
 public void testMyName() {
   assertEquals(
       "names do not match!",
       "myComponent:" + applicationProperties.getDisplayName(),
       myPluginComponent.getName());
 }
 /**
  * Fetch the log entries as an atom feed. May trigger a purge of old messages, according to this
  * log service's purge policy. Includes paging options.
  *
  * @param maxResults maximum number of log results
  * @param startIndex starting index of log results
  * @return a {@code Feed} containing all the entries in the log
  */
 public synchronized Feed getFeed(Integer maxResults, Integer startIndex) {
   Feed feed = new Feed();
   feed.setTitle(
       "Plugin management log for "
           + applicationProperties.getDisplayName()
           + " ("
           + applicationProperties.getBaseUrl()
           + ")");
   feed.setModified(lastModified);
   addLink(feed, applicationProperties.getBaseUrl(), "base");
   addAuditLogEntries(feed, maxResults, startIndex);
   return feed;
 }
  private Person generatePerson(String username) {
    String product = applicationProperties.getDisplayName();
    Person person = new Person();

    // don't want to get a default UserProfile when the "user" is anon or the product,
    // and anyway there could be a user with the username "anonymous" or "Confluence" etc
    if (i18nResolver.getText("upm.auditLog.anonymous").equals(username)
        || product.equals(username)) {
      person.setName(username);
    } else {
      UserProfile userProfile = userManager.getUserProfile(username);
      final String userFullname = userProfile == null ? null : userProfile.getFullName();
      person.setName((userFullname != null) ? userFullname : username);
      URI userUri = uriBuilder.buildAbsoluteProfileUri(userProfile);
      if (userUri != null) {
        person.setUrl(userUri.toString());
      }
    }
    return person;
  }