Package intellijcoder.ipc

Examples of intellijcoder.ipc.IntelliJCoderClient


    private Network network = context.mock(Network.class);

    @Test
    public void throwsApplicationExceptionIfFailedToConnectToServer() throws Exception {
        final int port = somePort();
        IntelliJCoderClient client = new IntelliJCoderClient(network, port);
        context.checking(new Expectations(){{
            allowing(network).getLocalhostSocket(port); will(throwException(new IOException()));
        }});
        try {
            client.createProblemWorkspace(someProblem());
            fail("should throw an exception");
        } catch (Exception e) {
            assertExceptionMessage(e, IntelliJCoderClient.FAILED_TO_CONNECT_ERROR_MESSAGE);
        }
    }
View Full Code Here


    }

    @Test
    public void throwsApplicationExceptionIfErrorOccuredDuringDataTransfer() throws Exception {
        final int port = somePort();
        IntelliJCoderClient client = new IntelliJCoderClient(network, port);
        final Socket socket = context.mock(Socket.class);
        context.checking(new Expectations(){{
            allowing(socket).getOutputStream(); will(throwException(new IOException()));
            oneOf(socket).close();
            allowing(network).getLocalhostSocket(port); will(returnValue(socket));
        }});
        try {
            client.createProblemWorkspace(someProblem());
            fail("should throw an exception");
        } catch (Exception e) {
            assertExceptionMessage(e, IntelliJCoderClient.SERVER_COMMUNICATION_ERROR_MESSAGE);
        }
    }
View Full Code Here

        if(messagePanel == null) {
            this.messagePanel = new MessagePanel();
        }
        if(!workspaceManagerInitialized()) {
            if(portPropertyDefined()) {
                this.workspaceManager = new IntelliJCoderClient(new Network(), getPortFromProperty());
            } else {
                messagePanel.showErrorMessage(PORT_PROPERTY_NOT_SPECIFIED_MESSAGE);
            }
        }
    }
View Full Code Here

TOP

Related Classes of intellijcoder.ipc.IntelliJCoderClient

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.