Search in sources :

Example 61 with User

use of org.apache.openmeetings.db.entity.user.User in project openmeetings by apache.

the class TestUserGroupAggregation method testitNow.

@Test
public void testitNow() {
    User u = userDao.get(1L);
    assertNotNull("Group list for default user must not be null", u.getGroupUsers());
    assertTrue("Default user must belong to at least one group", u.getGroupUsers().size() > 0);
    for (GroupUser orgUserObj : u.getGroupUsers()) {
        log.error("testitNow: group Id: '" + orgUserObj.getGroup().getId() + "'; name: '" + orgUserObj.getGroup().getName() + "'");
    }
}
Also used : User(org.apache.openmeetings.db.entity.user.User) GroupUser(org.apache.openmeetings.db.entity.user.GroupUser) GroupUser(org.apache.openmeetings.db.entity.user.GroupUser) Test(org.junit.Test)

Example 62 with User

use of org.apache.openmeetings.db.entity.user.User in project openmeetings by apache.

the class TestInvitation method testSendInvitationLink.

@Test
public void testSendInvitationLink() throws Exception {
    User us = userDao.getByLogin(adminUsername, User.Type.user, null);
    LocalDateTime from = LocalDateTime.now().plusDays(1).withHour(12).withMinute(0).withSecond(0);
    User invitee = userDao.getContact("sebawagner@apache.org", "Testname", "Testlastname", us.getId());
    Invitation i = invitationManager.getInvitation(invitee, roomDao.get(1L), false, "", Valid.OneTime, us, us.getLanguageId(), getDate(from, "GMT"), getDate(from.plusHours(2), "GMT"), null);
    invitationManager.sendInvitationLink(i, MessageType.Create, "subject", "message", false);
}
Also used : LocalDateTime(java.time.LocalDateTime) User(org.apache.openmeetings.db.entity.user.User) Invitation(org.apache.openmeetings.db.entity.room.Invitation) Test(org.junit.Test)

Example 63 with User

use of org.apache.openmeetings.db.entity.user.User in project openmeetings by apache.

the class TestEmailTemplate method testNullLocale.

@Test
public void testNullLocale() {
    User u = new User();
    u.setLanguageId(666L);
    checkTemplate(InvitationTemplate.getEmail(u, "testuser", "email", "message"));
}
Also used : User(org.apache.openmeetings.db.entity.user.User) Test(org.junit.Test)

Example 64 with User

use of org.apache.openmeetings.db.entity.user.User in project openmeetings by apache.

the class TestSubjTemplate method testTemplateGeneration.

@Test
public void testTemplateGeneration() {
    Appointment a = getAppointment();
    String[] ids = TimeZone.getAvailableIDs();
    Recording rec = new Recording();
    rec.setRoomId(5L);
    for (User u : userDao.get(0, 100)) {
        TimeZone tz = TimeZone.getTimeZone(ids[rnd.nextInt(ids.length)]);
        checkTemplate(CreatedAppointmentTemplate.get(u, a, tz, u.getLogin()));
        checkTemplate(CanceledAppointmentTemplate.get(u, a, tz, u.getLogin()));
        checkTemplate(UpdatedAppointmentTemplate.get(u, a, tz, u.getLogin()));
        checkTemplate(AppointmentReminderTemplate.get(u, a, tz));
        checkTemplate(RecordingExpiringTemplate.get(u, rec, 1L));
    }
}
Also used : Appointment(org.apache.openmeetings.db.entity.calendar.Appointment) TimeZone(java.util.TimeZone) User(org.apache.openmeetings.db.entity.user.User) Recording(org.apache.openmeetings.db.entity.record.Recording) Test(org.junit.Test)

Example 65 with User

use of org.apache.openmeetings.db.entity.user.User in project openmeetings by apache.

the class InviteUserMessageDialog method open.

public void open(IPartialPageRequestHandler handler, Long roomId, Long userId) {
    Room r = roomDao.get(roomId);
    User u = userDao.get(userId);
    message.setModelObject(String.format("%s %s %s %s", u.getFirstname(), u.getLastname(), getString("1137"), r.getName()));
    enterRoom.setModelObject(false);
    handler.add(form);
    open(handler);
}
Also used : User(org.apache.openmeetings.db.entity.user.User) Room(org.apache.openmeetings.db.entity.room.Room)

Aggregations

User (org.apache.openmeetings.db.entity.user.User)101 GroupUser (org.apache.openmeetings.db.entity.user.GroupUser)29 Test (org.junit.Test)25 Date (java.util.Date)11 Appointment (org.apache.openmeetings.db.entity.calendar.Appointment)10 ArrayList (java.util.ArrayList)8 ServiceResult (org.apache.openmeetings.db.dto.basic.ServiceResult)8 OmException (org.apache.openmeetings.util.OmException)8 Path (javax.ws.rs.Path)7 MeetingMember (org.apache.openmeetings.db.entity.calendar.MeetingMember)7 Room (org.apache.openmeetings.db.entity.room.Room)7 AbstractJUnitDefaults.getUser (org.apache.openmeetings.AbstractJUnitDefaults.getUser)6 Client (org.apache.openmeetings.db.entity.basic.Client)6 Address (org.apache.openmeetings.db.entity.user.Address)5 Group (org.apache.openmeetings.db.entity.user.Group)5 GroupDao (org.apache.openmeetings.db.dao.user.GroupDao)4 AppointmentDTO (org.apache.openmeetings.db.dto.calendar.AppointmentDTO)4 OAuthUser (org.apache.openmeetings.db.dto.user.OAuthUser)4 Recording (org.apache.openmeetings.db.entity.record.Recording)4 AbstractJUnitDefaults.createUser (org.apache.openmeetings.AbstractJUnitDefaults.createUser)3