- cleanup of bbb-web

This commit is contained in:
Richard Alam 2011-05-26 14:00:08 -04:00
parent c7c69296f8
commit 1e9a835615
23 changed files with 0 additions and 352 deletions

View File

@ -1,38 +0,0 @@
package org.bigbluebutton.web.controllers
import org.jsecurity.crypto.hash.Sha1Hash
import org.bigbluebutton.web.domain.Role
import org.bigbluebutton.web.domain.User
import org.bigbluebutton.web.domain.UserRoleRel
class AuthControllerTests extends GroovyTestCase {
void testLogin() {
// Administrator user and role.
def adminRole = new Role(name: "Administrator").save()
def adminUser = new User(username: "admin@test.com", passwordHash: new Sha1Hash("admin").toHex(),
fullName: "Admin").save()
new UserRoleRel(user: adminUser, role: adminRole).save()
// A normal user.
def userRole = new Role(name: "User").save()
def normalUser = new User(username: "phil@test.com", passwordHash: new Sha1Hash("password").toHex(),
fullName: "Phil").save()
new UserRoleRel(user: normalUser, role: userRole).save()
// Give another user the "User" role.
normalUser = new User(username: "alice@test.com", passwordHash: new Sha1Hash("changeit").toHex(),
fullName: "Alice").save()
new UserRoleRel(user: normalUser, role: userRole).save()
assertEquals 3, User.list().size()
def ac = new AuthController()
ac.params.username = "admin@test.com"
ac.params.password = "admin"
ac.params.targetUri = "/login-success"
ac.signIn()
assertEquals "/login-success", ac.response.redirectedUrl
}
}

View File

@ -1,33 +0,0 @@
package org.bigbluebutton.web.controllers
import org.bigbluebutton.web.domain.Conference
import org.jsecurity.crypto.hash.Sha1Hash
import org.bigbluebutton.web.domain.User
class ConferenceControllerTests extends GroovyTestCase {
def CONFERENCE_NAME = 'test-conference'
def USERNAME = "admin@test.com"
def USER_PASSWORD = "admin"
def USER_FULLNAME = "Admin User"
void testCreateConference() {
// Let's create a user to own the conference
def adminUser = new User(username:USERNAME , passwordHash: new Sha1Hash(USER_PASSWORD).toHex(),
fullName: USER_FULLNAME).save()
assertEquals 1, adminUser.id
assertEquals USERNAME, adminUser.username
// setup our controller
def cc = new ConferenceController()
// setup our mocked session
cc.session["userid"] = adminUser.id
// mock the params that get's sent from the client
cc.params.name = CONFERENCE_NAME
// now save to create the conference
cc.save()
assertEquals 1, Conference.list().size()
def conf = Conference.findByName(CONFERENCE_NAME)
assertEquals CONFERENCE_NAME, conf.name
assertEquals adminUser.id, conf.user.id
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.controllers
class PresentationControllerTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.controllers
class PublicConferenceControllerTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.controllers
class PublicScheduledSessionControllerTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,50 +0,0 @@
package org.bigbluebutton.web.controllers
import org.bigbluebutton.web.domain.Conference
import org.bigbluebutton.web.domain.User
import org.bigbluebutton.web.domain.ScheduledSession
import org.jsecurity.crypto.hash.Sha1Hash
class ScheduleSessionControllerTests extends GroovyTestCase {
def CONFERENCE_NAME = 'test-conference'
def USERNAME = "admin@test.com"
def USER_PASSWORD = "admin"
def USER_FULLNAME = "Admin User"
void testCreateConference() {
// Let's create a user to own the conference
def adminUser = new User(username:USERNAME , passwordHash: new Sha1Hash(USER_PASSWORD).toHex(),
fullName: USER_FULLNAME).save()
assertEquals 1, adminUser.id
assertEquals USERNAME, adminUser.username
def c = new Conference()
c.createdBy = adminUser.fullName
c.updatedBy = adminUser.fullName
c.name = CONFERENCE_NAME
c.user = adminUser
c.save()
assertEquals 1, Conference.list().size()
def conf = Conference.findByName(CONFERENCE_NAME)
assertEquals CONFERENCE_NAME, conf.name
assertEquals adminUser.id, conf.user.id
def ssc = new ScheduledSessionController()
ssc.session["userid"] = adminUser.id
ssc.params.conferenceId = conf.id
ssc.params.name = 'test-conference-schedule'
ssc.params.duration = 2
ssc.params.record = true
ssc.params.passwordProtect = true
ssc.params.hostPassword = 'TestMostPassword'
ssc.params.moderatorPassword = 'TestModeratorPassword'
ssc.params.attendeePassword = 'TestAttendeePassword'
ssc.save()
assertEquals 1, ScheduledSession.list().size()
conf = Conference.get(conf.id)
println conf.sessions
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.controllers
class UserControllerTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.domain
class AccountTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.domain
class AccountTypeTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.domain
class BasicAccountTypeTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.domain
class ConferenceSessionTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.domain
class ConferenceTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.domain
class PermissionTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.domain
class RolePermissionRelTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.domain
class RoleTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.domain
class ScheduleTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.domain
class ScheduledSessionTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.domain
class UserPermissionRelTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.domain
class UserRoleRelTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.domain
class UserTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.web.domain
class VoiceConferenceBridgeTests extends GroovyTestCase {
void testSomething() {
}
}

View File

@ -1,47 +0,0 @@
package org.bigbluebutton.web.services
import grails.test.*
import org.bigbluebutton.presentation.service.AdhocConference
class AdhocConferenceServiceTests extends GrailsUnitTestCase {
protected void setUp() {
super.setUp()
}
protected void tearDown() {
super.tearDown()
}
void testConferenceRoomExist() {
AdhocConferenceService service = new AdhocConferenceService()
service.createConference('85115');
assertTrue service.conferenceExistWithVoiceBridge('85115')
}
void testConferenceExistWithModeratorToken() {
AdhocConferenceService service = new AdhocConferenceService()
AdhocConference conf = new AdhocConference('85115', 'test-room', 'modToken', 'attToken')
service.createConference(conf);
assertTrue service.conferenceExistWithModeratorToken('modToken')
}
void testGetConferenceExistWithModeratorToken() {
AdhocConferenceService service = new AdhocConferenceService()
AdhocConference conf = new AdhocConference('85115', 'test-room', 'modToken', 'attToken')
service.createConference(conf);
AdhocConference conf1 = service.getConferenceWithModeratorToken('modToken')
assertEquals conf1.moderatorToken, 'modToken'
}
void testGetConferenceWithViewerToken() {
AdhocConferenceService service = new AdhocConferenceService()
AdhocConference conf = new AdhocConference('85115', 'test-room', 'modToken', 'attToken')
service.createConference(conf);
AdhocConference conf1 = service.getConferenceWithViewerToken('attToken')
assertEquals conf1.viewerToken, 'attToken'
}
}

View File

@ -1,40 +0,0 @@
/* BigBlueButton - http://www.bigbluebutton.org
*
*
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
*
* BigBlueButton is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
*
* Author: Richard Alam <ritzalam@gmail.com>
* DJP <DJP@architectes.org>
*
* @version $Id: $
*/
package org.bigbluebutton.presentation.service
import grails.test.*
class AdhocConferenceTests extends GrailsUnitTestCase {
protected void setUp() {
super.setUp()
}
protected void tearDown() {
super.tearDown()
}
void testCreateAdhocConference() {
def conf = new AdhocConference('85115', 'test-room', 'modToken', 'attToken')
assertEquals 'modToken', conf.moderatorToken
}
}