Package com.github.hipchat.api

Examples of com.github.hipchat.api.Room


        HipChat hipchat = new HipChat(HIPCHAT_KEY);

        List<Room> roomsBefore = hipchat.listRooms();
        int countBeforeOp = roomsBefore.size();

        Room room = null;
        try
        {
            room = hipchat.createRoom(TEST_ROOM_NAME, TEST_ROOM_OWNER, false, "test out api", false);
        } catch (IOException e)
        {
            e.printStackTrace();
            fail("Exception!");
        }
        assertNotNull(room);
        assertEquals(TEST_ROOM_NAME, room.getName());

        List<Room> roomsAfterAdd = hipchat.listRooms();
        int countAfterOp = roomsAfterAdd.size();
        assertEquals(countBeforeOp + 1, countAfterOp);

        boolean deleted = hipchat.deleteRoom(room.getId());
        assertTrue(deleted);

        List<Room> roomsAfterDelete = hipchat.listRooms();
        int countAfterOp2 = roomsAfterDelete.size();
        assertEquals(countBeforeOp, countAfterOp2);
View Full Code Here


    @Test
    public void testGetRoom()
    {
        HipChat hipchat = new HipChat(HIPCHAT_KEY);
        Room room = hipchat.getRoom(TEST_ROOM_ID);
        assertNotNull(room);

    }
View Full Code Here

    @Test
    public void testGetRoomHistory()
    {
        HipChat hipchat = new HipChat(HIPCHAT_KEY);
        Room room = hipchat.getRoom(TEST_ROOM_ID);
        assertNotNull(room);
        List<HistoryMessage> messages = room.getHistory();
        assertNotNull(messages);
        assertTrue(messages.size() > 0);
    }
View Full Code Here

    @Test
    public void testMessageRoom()
    {
        HipChat hipchat = new HipChat(HIPCHAT_KEY);
        Room room = hipchat.getRoom(TEST_ROOM_ID);
        assertNotNull(room);
        UserId from = UserId.create("api", "API UnitTest");
        assertTrue(room.sendMessage("test message", from, false, Color.PURPLE));
    }
View Full Code Here

TOP

Related Classes of com.github.hipchat.api.Room

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.