Package org.housecream.restmcu.api.domain.board

Examples of org.housecream.restmcu.api.domain.board.RestMcuBoardSettings


    @Rule
    public RestmcuTestRule restmcu = new RestmcuTestRule();

    @Test
    public void should_update_settings_with_same() throws Exception {
        RestMcuBoardSettings boardSettings = restmcu.getBoardResource().getBoardSettings();
        restmcu.getBoardResource().setBoardSettings(boardSettings);
        restmcu.getBoardResource().getBoardSettings();
    }
View Full Code Here


    }

    @Test
    public void should_update_name() throws Exception {
        String name = new BigInteger(30, new SecureRandom()).toString(5);
        RestMcuBoardSettings boardSettings = new RestMcuBoardSettings();
        boardSettings.setName(name);
        restmcu.getBoardResource().setBoardSettings(boardSettings);
        assertEquals(name, restmcu.getBoardResource().getBoardSettings().getName());
    }
View Full Code Here

    }

    @Test(expected = UpdateException.class)
    public void should_update_notify_with_http() throws Exception {
        String notifyUrl = new BigInteger(30, new SecureRandom()).toString(5);
        RestMcuBoardSettings boardSettings = new RestMcuBoardSettings();
        boardSettings.setNotifyUrl(notifyUrl);
        restmcu.getBoardResource().setBoardSettings(boardSettings);
    }
View Full Code Here

    }

    @Test
    public void should_update_notify() throws Exception {
        String notifyUrl = "http://127.0.0.1/genre/style";
        RestMcuBoardSettings boardSettings = new RestMcuBoardSettings();
        boardSettings.setNotifyUrl(notifyUrl);
        restmcu.getBoardResource().setBoardSettings(boardSettings);
        assertEquals(notifyUrl, restmcu.getBoardResource().getBoardSettings().getNotifyUrl());
    }
View Full Code Here

    @Test
    public void should_not_update_notify_on_too_long() throws Exception {
        String oldNotifyUrl = restmcu.getBoardResource().getBoardSettings().getNotifyUrl();
        String notifyUrl = "http://127.0.0.1/genre/styledfkldfmldkfmldskfmdskfmdsfmskdmfksdmfsmfgpgkpkpkfdpbkfdpbkfdp";
        RestMcuBoardSettings boardSettings = new RestMcuBoardSettings();
        boardSettings.setNotifyUrl(notifyUrl);
        boolean exceptionflag = false;
        try {
            restmcu.getBoardResource().setBoardSettings(boardSettings);
        } catch (RestMcuUpdateException e) {
            exceptionflag = true;
View Full Code Here

    }

    @Test
    public void should_not_update_name_when_too_long() throws Exception {
        String oldName = restmcu.getBoardResource().getBoardSettings().getName();
        RestMcuBoardSettings boardSettings = new RestMcuBoardSettings();
        boardSettings.setName("AZERTYUIOPMKLKJHGFDSQWXCVBN");
        boolean exceptionflag = false;
        try {
            restmcu.getBoardResource().setBoardSettings(boardSettings);
        } catch (RestMcuUpdateException e) {
            exceptionflag = true;
View Full Code Here

    @Test
    @Ignore
    // TODO complexe test that change the ip and then go back
    public void should_update_ip() throws Exception {
        RestMcuBoardSettings boardSettings = new RestMcuBoardSettings();
        boardSettings.setIp("192.168.32.30");
        restmcu.getBoardResource().setBoardSettings(boardSettings);
    }
View Full Code Here

    @Test
    @Ignore
    // TODO complexe test that change the port and then go back
    public void should_update_port() throws Exception {
        RestMcuBoardSettings boardSettings = new RestMcuBoardSettings();
        boardSettings.setPort(81);
        restmcu.getBoardResource().setBoardSettings(boardSettings);
    }
View Full Code Here

    public RestServerRule notifyRule = new RestServerRule("http://0.0.0.0:5879", notifyResource);

    @Test
    public void should_notify_server() throws Exception {

        RestMcuBoardSettings boardSettings = new RestMcuBoardSettings();
        boardSettings.setNotifyUrl("http://" + NetworkUtils.getFirstNonWifiIp() + ":5879/");
        restmcu.getBoardResource().setBoardSettings(boardSettings);

        restmcu.getBoardResource().runNotify();

        List<RestMcuBoardNotification> awaitBoard = notifyResource.awaitBoard();
View Full Code Here

    public void setBoardSettings(RestMcuBoardSettings boardSettings) throws RestMcuUpdateException {
    }

    @Override
    public RestMcuBoardSettings getBoardSettings() {
        return new RestMcuBoardSettings();
    }
View Full Code Here

TOP

Related Classes of org.housecream.restmcu.api.domain.board.RestMcuBoardSettings

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.