Search in sources :

Example 46 with GoToOrganizer

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));
}
Also used : GoToOrganizer(org.olat.modules.gotomeeting.GoToOrganizer) Test(org.junit.Test)

Example 47 with GoToOrganizer

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());
}
Also used : GoToOrganizer(org.olat.modules.gotomeeting.GoToOrganizer) Identity(org.olat.core.id.Identity) Test(org.junit.Test)

Example 48 with GoToOrganizer

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));
}
Also used : GoToOrganizer(org.olat.modules.gotomeeting.GoToOrganizer) Identity(org.olat.core.id.Identity) Test(org.junit.Test)

Example 49 with GoToOrganizer

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);
}
Also used : GoToOrganizer(org.olat.modules.gotomeeting.GoToOrganizer) Test(org.junit.Test)

Example 50 with GoToOrganizer

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);
}
Also used : GoToOrganizer(org.olat.modules.gotomeeting.GoToOrganizer)

Aggregations

GoToOrganizer (org.olat.modules.gotomeeting.GoToOrganizer)60 Test (org.junit.Test)28 Date (java.util.Date)22 GoToMeeting (org.olat.modules.gotomeeting.GoToMeeting)18 IOException (java.io.IOException)16 HttpResponse (org.apache.http.HttpResponse)16 CloseableHttpClient (org.apache.http.impl.client.CloseableHttpClient)16 RepositoryEntry (org.olat.repository.RepositoryEntry)10 HttpGet (org.apache.http.client.methods.HttpGet)8 Identity (org.olat.core.id.Identity)8 StringEntity (org.apache.http.entity.StringEntity)6 GoToRegistrant (org.olat.modules.gotomeeting.GoToRegistrant)6 HttpPut (org.apache.http.client.methods.HttpPut)4 GoToError (org.olat.modules.gotomeeting.model.GoToError)4 GoToErrorG2T (org.olat.modules.gotomeeting.model.GoToErrorG2T)4 GoToRegistrantG2T (org.olat.modules.gotomeeting.model.GoToRegistrantG2T)4 Calendar (java.util.Calendar)2 Response (javax.ws.rs.core.Response)2 HttpDelete (org.apache.http.client.methods.HttpDelete)2 HttpPost (org.apache.http.client.methods.HttpPost)2