Examples of ProblemComponentModel


Examples of com.topcoder.client.contestant.ProblemComponentModel

    private ArenaPlugin arenaPlugin = new IntelliJCoderArenaPlugin(workspaceManager, messagePanel);


    @Test
    public void extractsClassNameFromProblemModel() throws IntelliJCoderException {
        ProblemComponentModel problemComponentModel = make(a(ProblemComponentModel, with(className, "BinaryCode")));
        context.checking(new Expectations(){{
            oneOf(workspaceManager).createProblemWorkspace(with(hasClassName("BinaryCode")));
            ignoring(messagePanel);
        }});
        arenaPlugin.setProblemComponent(problemComponentModel, JavaLanguage.JAVA_LANGUAGE, null);
View Full Code Here

Examples of com.topcoder.client.contestant.ProblemComponentModel

        arenaPlugin.setProblemComponent(problemComponentModel, JavaLanguage.JAVA_LANGUAGE, null);
    }

    @Test
    public void extractsMethodSignatureFromProblemModel() throws IntelliJCoderException {
        ProblemComponentModel problemComponentModel = make(a(ProblemComponentModel,
                with(returnType, dataType("int[]")), with(methodName, "decode"),
                with(paramTypes, new DataType[]{dataType("String[]")}), with(paramNames, new String[]{"a"})));
        context.checking(new Expectations(){{
            oneOf(workspaceManager).createProblemWorkspace(with(hasMethodSignature("int[]", "decode", "String[]", "a")));
            ignoring(messagePanel);
View Full Code Here

Examples of com.topcoder.client.contestant.ProblemComponentModel

    @Test
    public void extractsTestCaseFromProblemModel() throws IntelliJCoderException {
        final String[] testInput = {"{\"-10 0 10 0\",\"0 -10 0 10\"}", "1"};
        final String testOutput = "1";
        final ProblemComponentModel problemComponentModel =
                make(a(ProblemComponentModel, with(testCase, testCase(testInput, testOutput))));
        context.checking(new Expectations() {{
            oneOf(workspaceManager).createProblemWorkspace(with(hasTestCase(testInput, testOutput)));
            ignoring(messagePanel);
        }});
View Full Code Here

Examples of com.topcoder.client.contestant.ProblemComponentModel

        assertEquals("solution class source", "class Lottery{}", arenaPlugin.getSource());
    }

    @Test
    public void alwaysGetsSourceForTheLastOpenedProblem() throws Exception {
        final ProblemComponentModel problemComponentModel1 = make(a(ProblemComponentModel, with(className, "class1")));
        final ProblemComponentModel problemComponentModel2 = make(a(ProblemComponentModel, with(className, "class2")));
        context.checking(new Expectations(){{
            allowing(workspaceManager).createProblemWorkspace(with(any(Problem.class)));
            oneOf(workspaceManager).getSolutionSource("class1");
            oneOf(workspaceManager).getSolutionSource("class2");
            ignoring(messagePanel);
View Full Code Here

Examples of com.topcoder.client.contestant.ProblemComponentModel

       Strange thing, but TopCoder applet sometimes calls setProblemComponentModel() twice for the same problem and language,
       but for different renderers.
     */
    @Test
    public void onlyOneWorkspaceCreatedForTwoSubsequentCallsToSetProblemComponentForTheSameProblem() throws Exception {
        ProblemComponentModel componentModel = someProblemComponentModel();
        context.checking(new Expectations(){{
            oneOf(workspaceManager).createProblemWorkspace(with(any(Problem.class)));
            ignoring(messagePanel);
        }});
        arenaPlugin.setProblemComponent(componentModel, JavaLanguage.JAVA_LANGUAGE, null);
View Full Code Here

Examples of com.topcoder.client.contestant.ProblemComponentModel

        setSystemProperty(ArenaProcessLauncher.INTELLIJCODER_PORT_PROPERTY, port);
        IntelliJCoderArenaPlugin plugin = new IntelliJCoderArenaPlugin();
        plugin.startUsing();

        final ProblemComponentModel inputComponentModel = context.mock(ProblemComponentModel.class);
        context.checking(new Expectations(){{
            allowing(inputComponentModel).getClassName(); will(returnValue("BinaryCode"));
            allowing(inputComponentModel).getReturnType();   will(returnValue(new DataType("int")));
            allowing(inputComponentModel).getMethodName();   will(returnValue("multiply"));
            allowing(inputComponentModel).getParamTypes();   will(returnValue(new DataType[0]));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.