use of org.apache.openmeetings.db.dto.room.RoomDTO in project openmeetings by apache.
the class TestRoomService method testExternal.
@Test
public void testExternal() {
ServiceResult sr = login();
String extId = UUID.randomUUID().toString();
Room.Type type = Room.Type.presentation;
String name = "Unit Test Ext Room";
String comment = "Unit Test Ext Room Comments";
RoomDTO r = new RoomDTO();
r.setType(type);
r.setName(name);
r.setComment(comment);
r.setCapacity(CAPACITY);
RoomDTO room = getClient(getRoomUrl()).path(String.format("/%s/%s/%s", type, UNIT_TEST_EXT_TYPE, extId)).query("sid", sr.getMessage()).query("room", r.toString()).get(RoomDTO.class);
assertNotNull("Valid room should be returned", room);
assertNotNull("Room ID should be not empty", room.getId());
RoomDTO room1 = getClient(getRoomUrl()).path(String.format("/%s/%s/%s", Room.Type.presentation, UNIT_TEST_EXT_TYPE, extId)).query("sid", sr.getMessage()).get(RoomDTO.class);
assertNotNull("Valid room should be returned", room1);
assertEquals("Same Room should be returned", room.getId(), room1.getId());
}
use of org.apache.openmeetings.db.dto.room.RoomDTO 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.room.RoomDTO in project openmeetings by apache.
the class TestRoomService method testCreateWithFiles2.
@Test
public void testCreateWithFiles2() throws IOException {
// lets create real file
CallResult<FileItemDTO> fileCall = createVerifiedFile(getDefaultProfilePicture(), "img.jpg", BaseFileItem.Type.Image);
Room.Type type = Room.Type.presentation;
String name = "Unit Test Ext Room4";
String comment = "Unit Test Ext Room Comments4";
RoomDTO r = new RoomDTO();
r.setType(type);
r.setName(name);
r.setComment(comment);
r.setCapacity(CAPACITY);
RoomFileDTO rf = new RoomFileDTO();
// not existent
rf.setFileId(fileCall.getObj().getId());
r.getFiles().add(rf);
CallResult<RoomDTO> res = createAndValidate(fileCall.getSid(), r);
assertFalse("Room files should NOT be empty", res.getObj().getFiles().isEmpty());
}
use of org.apache.openmeetings.db.dto.room.RoomDTO in project openmeetings by apache.
the class TestRoomService method testCreateWithFiles1.
@Test
public void testCreateWithFiles1() {
Room.Type type = Room.Type.presentation;
String name = "Unit Test Ext Room3";
String comment = "Unit Test Ext Room Comments3";
RoomDTO r = new RoomDTO();
r.setType(type);
r.setName(name);
r.setComment(comment);
r.setCapacity(CAPACITY);
RoomFileDTO rf = new RoomFileDTO();
// not existent
rf.setFileId(-666L);
r.getFiles().add(rf);
CallResult<RoomDTO> res = createAndValidate(r);
assertTrue("No room files should be added", res.getObj().getFiles().isEmpty());
}
Aggregations