use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestFileService method testGetRoom.
@Test
public void testGetRoom() {
ServiceResult r = login();
FileExplorerObject fo = getClient(getFileUrl()).path("/room/5").query("sid", r.getMessage()).get(FileExplorerObject.class);
assertNotNull(fo);
}
use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestGroupService method addRoomTest.
@Test
public void addRoomTest() {
// create new group
ServiceResult sr = login();
Long groupId = createGroup(sr.getMessage(), "Group WS");
RoomDTO rdto = new RoomDTO();
rdto.setName("Group WS Room");
CallResult<RoomDTO> room = createAndValidate(sr.getMessage(), rdto);
Response resp = getClient(getGroupUrl()).path(String.format("/%s/rooms/add/%s", groupId, room.getObj().getId())).query("sid", sr.getMessage()).query("name", "Test Group").post("");
assertNotNull("Valid ServiceResult should be returned", resp);
assertEquals("Call should be successful", Response.Status.OK.getStatusCode(), resp.getStatus());
ServiceResult sr1 = resp.readEntity(ServiceResult.class);
assertEquals("OM Call should be successful", sr1.getType(), Type.SUCCESS.name());
}
use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestGroupService method addRemoveTest.
@Test
public void addRemoveTest() {
ServiceResult r = login();
Long groupId = createGroup(r.getMessage(), "Test Group");
// delete group created
{
Response resp = getClient(getGroupUrl()).path("/" + groupId).query("sid", r.getMessage()).delete();
assertNotNull("Valid ServiceResult should be returned", resp);
assertEquals("Call should be successful", Response.Status.OK.getStatusCode(), resp.getStatus());
ServiceResult r1 = resp.readEntity(ServiceResult.class);
assertEquals("OM Call should be successful", r1.getType(), Type.SUCCESS.name());
}
}
use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestGroupService method createGroup.
private static Long createGroup(String sid, String name) {
Response resp = getClient(getGroupUrl()).path("/").query("sid", sid).query("name", name).post("");
assertNotNull("Valid ServiceResult should be returned", resp);
assertEquals("Call should be successful", Response.Status.OK.getStatusCode(), resp.getStatus());
ServiceResult r1 = resp.readEntity(ServiceResult.class);
assertEquals("OM Call should be successful", r1.getType(), Type.SUCCESS.name());
return Long.valueOf(r1.getMessage());
}
use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestRecordingService method testExternal.
@Test
public void testExternal() throws Exception {
User u = getExternalUser();
Recording r = new Recording();
r.setInsertedBy(u.getId());
r.setComment("Created by Unit Tests");
r.setRoomId(5L);
r = getBean(RecordingDao.class).update(r);
ServiceResult sr = login();
Collection<? extends RecordingDTO> recs = getClient(getRecordUrl()).path("/" + UNIT_TEST_EXT_TYPE).query("sid", sr.getMessage()).getCollection(RecordingDTO.class);
assertNotNull("Valid collection should be returned", recs);
assertFalse("Collection of the recordings should not be empty", recs.isEmpty());
boolean found = false;
for (RecordingDTO rdo : recs) {
if (r.getId().equals(rdo.getId())) {
// TODO check room, user
found = true;
break;
}
}
assertTrue("Just created recording was not found by the service", found);
}
Aggregations