Package hudson.model

Examples of hudson.model.User


    }

    @Test
    public void testFindOrCreateUserWithEmptyEmail() throws IOException {
        mockStatic(User.class);
        User user = createMock(User.class);
        expect(User.get(AUTHOR_NAME, true)).andReturn(user);
        replay(User.class, user);
        GitChangeSet changeSet = new GitChangeSet(new ArrayList<String>(), false);
        changeSet.findOrCreateUser(AUTHOR_NAME, "", false);
        verify(User.class, user);
View Full Code Here


    curentLocalRepository = new File(currentTestDirectory.getAbsolutePath()+"/localRepo/");
      if(!(curentLocalRepository.mkdir())) { throw new IOException("Could not create local repo directory: " + curentLocalRepository.getAbsolutePath()); }
      scmUnderTest.initRepo(curentLocalRepository);
     
      // Mocking user
      User mockedUser = Mockito.mock(User.class);
      when(mockedUser.getId()).thenReturn("fcamblor");
     
    // Mocking Hudson singleton instance ...
      // Warning : this line will only work on Objenesis supported VMs :
      // http://code.google.com/p/objenesis/wiki/ListOfCurrentlySupportedVMs
      Hudson hudsonMockedInstance = spy((Hudson) new ObjenesisStd().getInstantiatorOf(Hudson.class).newInstance());
View Full Code Here

        }
        return includes;
    }

  private User getCurrentUser(){
    User user = null;
    try {
      user = Hudson.getInstance().getMe();
    }catch(AccessDeniedException e){}
    return user;
  }
View Full Code Here

        setParent(parent);
    }
   
    @Override
    public User getAuthor() {
        User author = User.get(change.getUser());
        return author;
    }
View Full Code Here

  protected String getReply(Bot bot, Sender sender, String[] args) {
    if (args.length < 2) {
        return giveSyntax(sender.getNickname(), args[0]);
    }
    String userName = args[1];
    User user = User.get(userName, false);
    if (user != null) {
       
        String checkPermission = checkPermission(user, sender);
        if (checkPermission != null) {
            return checkPermission;
        }
       
      StringBuilder buf = new StringBuilder();
      buf.append(userName).append(":");
     
      if (!userName.equals(user.getFullName())) {
        buf.append("\n").append("Full name: ").append(user.getFullName());
      }
     
      if (user.getDescription() != null) {
        buf.append("\n").append("Description: ").append(user.getDescription());
      }
     
      Mailer.UserProperty mailProperty = user.getProperty(Mailer.UserProperty.class);
      if (mailProperty != null) {
        buf.append("\n").append("E-mail: ").append(mailProperty.getAddress());
      }
     
//      if (Hudson.getInstance().getPlugin("jabber") != null) {
//       
//      }
     
      if (Hudson.getInstance().getPlugin("ci-game") != null) {
        UserScoreProperty property = user.getProperty(UserScoreProperty.class);
        if (property != null) {
          int score = (int) property.getScore();
          buf.append("\n").append("Current score in continuous integration game: ").append(score);
        }
      }
View Full Code Here

            public Authentication getAuthentication() {
                if (authentication != null) {
                    return authentication;
                }
               
                User u = User.get(descriptor.getHudsonUserName());

                return impersonateUser(u);
            }
        };
  }
View Full Code Here

       
        createPreviousNextRelationShip(this.previousBuildUpstreamBuild, this.upstreamBuildBetweenPreviousAndCurrent,
                this.upstreamBuild);
       
       
        User user1 = mock(User.class);
        when(user1.toString()).thenReturn("User1");
        ChangeLogSet<TestEntry> changeLogSet1 = new TestChangeLogSet(this.previousBuildUpstreamBuild,
                new TestEntry(user1));
        when(this.previousBuildUpstreamBuild.getChangeSet()).thenReturn(changeLogSet1);
       
        User user2 = mock(User.class);
        when(user2.toString()).thenReturn("User2");
        ChangeLogSet<TestEntry> changeLogSet2 = new TestChangeLogSet(this.upstreamBuildBetweenPreviousAndCurrent,
                new TestEntry(user2));
        when(this.upstreamBuildBetweenPreviousAndCurrent.getChangeSet()).thenReturn(changeLogSet2);
       
        User user3 = mock(User.class);
        when(user3.toString()).thenReturn("User3");
        ChangeLogSet<TestEntry> changeLogSet3 = new TestChangeLogSet(this.upstreamBuild,
                new TestEntry(user3));
        when(this.upstreamBuild.getChangeSet()).thenReturn(changeLogSet3);
       
       
View Full Code Here

    public long getTimestamp() {
        return timestamp;
    }

    @Override public String getShortDescription() {
        User u = getUser();
        if (u != null) {
            return "Rejected by " + u.getDisplayName();
        } else {
            return "Rejected";
        }
    }
View Full Code Here

      this.subProjects = subProjects;
    }

    @Exported(visibility=3)
    public String getUserName() {
      User u = User.get(user, false);
      return (u == null) ? user : u.getDisplayName();
    }
View Full Code Here

      return (u == null) ? user : u.getDisplayName();
    }

    @Exported(visibility=3)
    public String getUserUrl() {
      User u = User.get(user, false);
      if (u == null) {
        u = User.getUnknown();
      }
      return u.getAbsoluteUrl();
    }
View Full Code Here

TOP

Related Classes of hudson.model.User

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.