use of org.olat.modules.gotomeeting.GoToOrganizer in project openolat by klemens.
the class GoToOrganizerDAOTest method getOrganizers.
@Test
public void getOrganizers() {
String username = UUID.randomUUID().toString();
String accessToken = UUID.randomUUID().toString();
String organizerKey = UUID.randomUUID().toString();
GoToOrganizer organizer = organizerDao.createOrganizer(null, username, accessToken, organizerKey, "Martin", "Schongauer", null, null, 10l, null);
dbInstance.commitAndCloseSession();
Assert.assertNotNull(organizer);
// load by user name
List<GoToOrganizer> organizers = organizerDao.getOrganizers();
Assert.assertNotNull(organizers);
Assert.assertFalse(organizers.isEmpty());
Assert.assertTrue(organizers.contains(organizer));
}
use of org.olat.modules.gotomeeting.GoToOrganizer in project openolat by klemens.
the class GoToOrganizerDAOTest method createOrganizer_withOwner.
@Test
public void createOrganizer_withOwner() {
Identity org = JunitTestHelper.createAndPersistIdentityAsRndUser("organizer-1");
String username = UUID.randomUUID().toString();
String accessToken = UUID.randomUUID().toString();
String organizerKey = UUID.randomUUID().toString();
GoToOrganizer organizer = organizerDao.createOrganizer(null, username, accessToken, organizerKey, "Albrecht", "Durer", "albert@openolat.com", "account-key", 1200l, org);
dbInstance.commitAndCloseSession();
Assert.assertNotNull(organizer);
GoToOrganizer reloadedOrganizer = organizerDao.loadOrganizerByKey(organizer.getKey());
Assert.assertNotNull(reloadedOrganizer);
Assert.assertEquals(organizer.getKey(), reloadedOrganizer.getKey());
Assert.assertNotNull(organizer.getCreationDate());
Assert.assertNotNull(organizer.getLastModified());
Assert.assertEquals(username, reloadedOrganizer.getUsername());
Assert.assertEquals(accessToken, reloadedOrganizer.getAccessToken());
Assert.assertEquals(organizerKey, reloadedOrganizer.getOrganizerKey());
Assert.assertEquals(org, reloadedOrganizer.getOwner());
}
use of org.olat.modules.gotomeeting.GoToOrganizer in project openolat by klemens.
the class GoToOrganizerDAOTest method getOrganizersFor.
@Test
public void getOrganizersFor() {
Identity org = JunitTestHelper.createAndPersistIdentityAsRndUser("organizer-2");
Identity trainee = JunitTestHelper.createAndPersistIdentityAsRndUser("trainee-1");
String username = UUID.randomUUID().toString();
String accessToken = UUID.randomUUID().toString();
String organizerKey = UUID.randomUUID().toString();
GoToOrganizer myOrganizer = organizerDao.createOrganizer(null, username, accessToken, organizerKey, "Martin", "Schongauer", null, null, 10l, org);
GoToOrganizer systemOrganizer = organizerDao.createOrganizer(null, username + "_w", accessToken + "_w", organizerKey + "_w", "System", "Wide", null, null, 10l, null);
dbInstance.commitAndCloseSession();
Assert.assertNotNull(myOrganizer);
// load available organizers
List<GoToOrganizer> organizers = organizerDao.getOrganizersFor(org);
Assert.assertNotNull(organizers);
Assert.assertFalse(organizers.isEmpty());
Assert.assertTrue(organizers.contains(myOrganizer));
Assert.assertTrue(organizers.contains(systemOrganizer));
// trainee has only system wide organizers
List<GoToOrganizer> traineeOrganizers = organizerDao.getOrganizersFor(trainee);
Assert.assertNotNull(traineeOrganizers);
Assert.assertFalse(traineeOrganizers.isEmpty());
Assert.assertFalse(traineeOrganizers.contains(myOrganizer));
Assert.assertTrue(traineeOrganizers.contains(systemOrganizer));
}
use of org.olat.modules.gotomeeting.GoToOrganizer in project openolat by klemens.
the class GoToOrganizerDAOTest method organizerExists.
@Test
public void organizerExists() {
String username = UUID.randomUUID().toString();
String accessToken = UUID.randomUUID().toString();
String organizerKey = UUID.randomUUID().toString();
GoToOrganizer organizer = organizerDao.createOrganizer(null, username, accessToken, organizerKey, "Johann", "Amerbach", null, null, 10l, null);
dbInstance.commitAndCloseSession();
Assert.assertNotNull(organizer);
boolean exists = organizerDao.organizerExists(username);
Assert.assertTrue(exists);
boolean notExists = organizerDao.organizerExists(accessToken);
Assert.assertFalse(notExists);
}
use of org.olat.modules.gotomeeting.GoToOrganizer in project openolat by klemens.
the class GoToOrganizerListAdminController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (addOrganizerController == source) {
if (event == Event.DONE_EVENT) {
updateModel();
}
cmc.deactivate();
cleanUp();
} else if (updateOrganizerController == source) {
if (event == Event.DONE_EVENT) {
updateModel();
}
cmc.deactivate();
cleanUp();
} else if (confirmRemoveOrganizer == source) {
if (DialogBoxUIFactory.isYesEvent(event)) {
GoToOrganizer organizer = (GoToOrganizer) confirmRemoveOrganizer.getUserObject();
doRemoveOrganizer(organizer);
updateModel();
}
cleanUp();
} else if (cmc == source) {
cleanUp();
}
super.event(ureq, source, event);
}
Aggregations