Package intellijcoder.os

Examples of intellijcoder.os.Network


    private static FileSystem injectFileSystem() {
        return new FileSystem();
    }

    private static Network injectNetwork() {
        return new Network();
    }
View Full Code Here



    @Test
    public void testProblemTransferFromClientToServer() throws Exception {
        FakeWorkspaceManager workspaceManager = new FakeWorkspaceManager();
        IntelliJCoderServer server = new IntelliJCoderServer(workspaceManager, new Network());

        int port = server.start();
        IntelliJCoderClient client = new IntelliJCoderClient(new Network(), port);

        Problem problem = sampleProgram();
        client.createProblemWorkspace(problem);

        workspaceManager.hasReceivedProblemEqualTo(problem);
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

    }

    @Test(timeout = TIMEOUT)
    public void testSourceTransferFromServerToClient() throws Exception {
        final WorkspaceManager workspaceManager = context.mock(WorkspaceManager.class);
        IntelliJCoderServer server = new IntelliJCoderServer(workspaceManager, new Network());

        int port = server.start();
        IntelliJCoderClient client = new IntelliJCoderClient(new Network(), port);

        context.checking(new Expectations(){{
            allowing(workspaceManager).getSolutionSource("className"); will(returnValue("solution source"));
        }});
        assertEquals("solution class source", "solution source", client.getSolutionSource("className"));
View Full Code Here

    @Test(timeout = TIMEOUT)
    public void clientRethrowsWorkspaceCreationExceptionOccuredOnServer() throws Exception {
        final WorkspaceManager workspaceManager = context.mock(WorkspaceManager.class);

        IntelliJCoderServer server = new IntelliJCoderServer(workspaceManager, new Network());
        int port = server.start();
        IntelliJCoderClient client = new IntelliJCoderClient(new Network(), port);

        context.checking(new Expectations(){{
            allowing(workspaceManager).createProblemWorkspace(with(any(Problem.class)));
            will(throwException(new IntelliJCoderException("big error", null)));
        }});
View Full Code Here

    @Test(timeout = TIMEOUT)
    public void clientRethrowsGettingSourceExceptionOccuredOnServer() throws Exception {
        final WorkspaceManager workspaceManager = context.mock(WorkspaceManager.class);

        IntelliJCoderServer server = new IntelliJCoderServer(workspaceManager, new Network());
        int port = server.start();
        IntelliJCoderClient client = new IntelliJCoderClient(new Network(), port);

        context.checking(new Expectations(){{
            allowing(workspaceManager).getSolutionSource(with(any(String.class)));
            will(throwException(new IntelliJCoderException("big error", null)));
        }});
View Full Code Here

    }

    @Test(timeout = TIMEOUT)
    public void severalRequestsToServer() throws Exception {
        final WorkspaceManager workspaceManager = context.mock(WorkspaceManager.class);
        IntelliJCoderServer server = new IntelliJCoderServer(workspaceManager, new Network());

        int port = server.start();
        IntelliJCoderClient client = new IntelliJCoderClient(new Network(), port);

        context.checking(new Expectations(){{
            allowing(workspaceManager).createProblemWorkspace(with(any(Problem.class)));
            allowing(workspaceManager).getSolutionSource("className");    will(returnValue("solution source"));
        }});
View Full Code Here

    }

    @Test
    public void testProblemTransferFromArenaPluginToIntelliJCoderServer() throws Exception {
        FakeWorkspaceManager workspaceManager = new FakeWorkspaceManager();
        IntelliJCoderServer server = new IntelliJCoderServer(workspaceManager, new Network());

        int port = server.start();

        setSystemProperty(ArenaProcessLauncher.INTELLIJCODER_PORT_PROPERTY, port);
        IntelliJCoderArenaPlugin plugin = new IntelliJCoderArenaPlugin();
View Full Code Here

TOP

Related Classes of intellijcoder.os.Network

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.