Package greed.code

Examples of greed.code.LanguageTrait


        Param[] params = new Param[problem.getParamNames().length];
        for (int i = 0; i < params.length; ++i)
            params[i] = new Param(problem.getParamNames()[i], convertType(problem.getParamTypes()[i]), i);
        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);
View Full Code Here

TOP

Related Classes of greed.code.LanguageTrait

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.