use of org.ow2.proactive.scheduler.job.SchedulerUserInfo in project scheduling by ow2-proactive.
the class TestGetUsers method test.
@Test
public void test() throws Exception {
// login once with a different user to reset the connection time
schedulerHelper.getSchedulerInterface(TestUsers.USER);
// login with the demo user
Scheduler scheduler = schedulerHelper.getSchedulerInterface();
List<SchedulerUserInfo> users;
List<SchedulerUserInfo> usersWithJobs;
users = scheduler.getUsers();
assertEquals(1, users.size());
checkUser(users.get(0), TestUsers.DEMO.username, null);
assertTrue("Unexpected connect time: " + users.get(0).getConnectionTime(), users.get(0).getConnectionTime() > testStartTime);
Long connectTime = users.get(0).getConnectionTime();
scheduler.submit(createJob());
users = scheduler.getUsers();
usersWithJobs = scheduler.getUsersWithJobs();
assertEquals(1, users.size());
assertEquals(1, usersWithJobs.size());
checkUser(users.get(0), TestUsers.DEMO.username, connectTime);
checkUser(usersWithJobs.get(0), TestUsers.DEMO.username, null);
scheduler.submit(createJob());
users = scheduler.getUsers();
usersWithJobs = scheduler.getUsersWithJobs();
assertEquals(1, users.size());
assertEquals(1, usersWithJobs.size());
checkUser(users.get(0), TestUsers.DEMO.username, connectTime);
checkUser(usersWithJobs.get(0), TestUsers.DEMO.username, null);
}
use of org.ow2.proactive.scheduler.job.SchedulerUserInfo in project scheduling by ow2-proactive.
the class SchedulerFrontendState method getUsers.
synchronized List<SchedulerUserInfo> getUsers() {
List<SchedulerUserInfo> users = new ArrayList<>(identifications.size());
for (ListeningUser listeningUser : identifications.values()) {
UserIdentificationImpl user = listeningUser.getUser();
users.add(new SchedulerUserInfo(user.getHostName(), user.getUsername(), user.getConnectionTime(), user.getLastSubmitTime(), user.getSubmitNumber()));
}
return users;
}
Aggregations