Package com.topcoder.shared.problem

Examples of com.topcoder.shared.problem.TestCase


        Method method = new Method(problem.getMethodName(), convertType(problem.getReturnType()), params);

        LanguageTrait trait = LanguageManager.getInstance().getTrait(language);
        Testcase[] cases = new Testcase[problem.getTestCases().length];
        for (int i = 0; i < cases.length; ++i) {
            TestCase tc = problem.getTestCases()[i];
            ParamValue[] input = new ParamValue[tc.getInput().length];
            for (int j = 0; j < input.length; j++)
                input[j] = trait.parseValue(tc.getInput()[j], params[j]);
            ParamValue output = trait.parseValue(tc.getOutput(), new Param("expected", method.getReturnType(), params.length));
            cases[i] = new Testcase(i, input, output);

            if (tc.getAnnotation() != null) {
                String ann = getRidOfTopElement(tc.getAnnotation().toXML());
                ann = commonTCXMLFixes(ann);
                if ( ann.length() != 0 ) {
                    cases[i].setAnnotation(ann);
                }
            }
View Full Code Here


        descriptorsMap.put(JavaLanguage.JAVA_LANGUAGE.getId(), descriptor);
        return new DataType(1, descriptor, descriptorsMap);
    }

    public static TestCase testCase(String[] testInput, String testOutput) {
        return new TestCase(1, testInput, testOutput, false);
    }
View Full Code Here

TOP

Related Classes of com.topcoder.shared.problem.TestCase

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.