import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Constructor;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.util.Map;
import java.util.Hashtable;
import java.util.List;
import java.util.LinkedList;
import codeassess.javassessment.Assessor;
import codeassess.misc.Misc;

public class Template extends Assessor {

    public Map<String, String> getConfig() {
        final Map<String, String> config = new Hashtable<String, String>();
        config.put("Language", "Java");
        config.put("Extensions", ".java");
        config.put("AssessmentMode", "SemiAutomatic");
        return config;
    }

    public List<Object[]> getProperties() {
        final List<Object[]> properties = new LinkedList<Object[]>();
        properties.add(new Object[] { "Eval1", "Functionality", null, new String[] {  }, "Cuadrado.java", "Debes crear la clase cuadrado", "Crear clase Cuadrado", 0.0 });
        properties.add(new Object[] { "Eval2", "Functionality", null, new String[] {  }, "Cuadrado.java", "Cuadrado debe heredar de Rectangulo", "Cuadrado hereda de Rectangulo", 0.15 });
        properties.add(new Object[] { "Eval3", "Functionality", null, new String[] {  }, "Cuadrado.java", "Debes implementar el constructor", "Constructor de Cuadrado", 0.2 });
        properties.add(new Object[] { "Eval5", "Functionality", null, new String[] {  }, "Cuadrado.java", "Debes declarar atributos en Cuadrado", "Atributos de Cuadrado", 0.15 });
        properties.add(new Object[] { "Eval4", "Functionality", null, new String[] {  }, "Cuadrado.java", "Cuadrado debe implementar el método volumen", "Cuadrado implementa el método volumen", 0.2 });
        properties.add(new Object[] { "Eval9", "Functionality", null, new String[] {  }, "GrupoFiguras.java", "Debes implementar el método anyadeCuadrado en GrupoFiguras", "Método anyadeCuadrado en GrupoFiguras", 0.15 });
        properties.add(new Object[] { "Eval6", "Functionality", null, new String[] {  }, "GrupoFiguras.java", "Debes implementar el método numRectangulos", "Método numRectangulos en GrupoFiguras", 0.0 });
        properties.add(new Object[] { "Eval7", "Functionality", null, new String[] {  }, "GrupoFiguras.java", "Debes utilizar un bucle para recorrer las figuras", "Bucle en numRectangulos", 0.15 });
        properties.add(new Object[] { "Eval8", "Functionality", null, new String[] {  }, "GrupoFiguras.java", "Debes utilizar instanceof", "Instanceof Rectangulo", 0.15 });
        return properties;
    }

    public boolean checkEval1() {
        return true;
    }

    public boolean solveEval1() {
        return false;
    }

    public String[] testEval1() {
        return null;
    }

    public boolean checkEval2() {
        final Class class1 = super.introspector.getClass("Cuadrado");
        if (class1 == null) return false;
        final Class class2 = super.introspector.getClass("Rectangulo");
        if (class2 == null) return false;
        if (!(super.introspector.checkSuperclass(class1, class2) == true)) return false;
        return true;
    }

    public boolean solveEval2() {
        final Class class1 = super.introspector.getClass("Cuadrado");
        if (class1 == null) return false;
        final Class class2 = super.introspector.getClass("Rectangulo");
        if (class2 == null) return false;
        super.intercessor.setSuperclass(class1, class2);
        return true;
    }

    public String[] testEval2() {
        return null;
    }

    public boolean checkEval3() {
        final Class class1 = super.introspector.getClass("Cuadrado");
        if (class1 == null) return false;
        final Class[] classs1 = { double.class, double.class, double.class };
        if (!(super.introspector.checkDeclaredConstructor(class1, classs1, true) == true)) return false;
        return true;
    }

    public boolean solveEval3() {
        final Class class1 = super.introspector.getClass("Cuadrado");
        if (class1 == null) return false;
        final Class[] classs1 = { double.class, double.class, double.class };
        super.intercessor.removeConstructors(class1);
        super.intercessor.copyConstructor(class1, classs1);
        return true;
    }

    public String[] testEval3() {
        if (!(super.tester.executeTestCase("TestCases1", "test1").equals(true))) return new String[] { "TestCases1", "test1" };
        return null;
    }

    public boolean checkEval5() {
        final Class class1 = super.introspector.getClass("Cuadrado");
        if (class1 == null) return false;
        if (!(super.introspector.getDeclaredFieldCount(class1) == 0)) return false;
        return true;
    }

    public boolean solveEval5() {
        final Class class1 = super.introspector.getClass("Cuadrado");
        if (class1 == null) return false;
        super.intercessor.removeFields(class1);
        return true;
    }

    public String[] testEval5() {
        return null;
    }

    public boolean checkEval4() {
        final Class class1 = super.introspector.getClass("Cuadrado");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        if (!(super.introspector.checkDeclaredMethod(class1, "volumen", classs1, true) == true)) return false;
        return true;
    }

    public boolean solveEval4() {
        final Class class1 = super.introspector.getClass("Cuadrado");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        super.intercessor.copyMethod(class1, "volumen", classs1);
        return true;
    }

    public String[] testEval4() {
        if (!(super.tester.executeTestCases("AutomaticTestCases1") >= 90.0)) return new String[] { "AutomaticTestCases1" };
        return null;
    }

    public boolean checkEval9() {
        final Class class1 = super.introspector.getClass("GrupoFiguras");
        if (class1 == null) return false;
        final Class class2 = super.introspector.getClass("Cuadrado");
        if (class2 == null) return false;
        final Class[] classs1 = { class2 };
        if (!(super.introspector.checkDeclaredMethod(class1, "anyadeCuadrado", classs1, true) == true)) return false;
        return true;
    }

    public boolean solveEval9() {
        final Class class1 = super.introspector.getClass("GrupoFiguras");
        if (class1 == null) return false;
        final Class class2 = super.introspector.getClass("Cuadrado");
        if (class2 == null) return false;
        final Class[] classs1 = { class2 };
        super.intercessor.copyMethod(class1, "anyadeCuadrado", classs1);
        return true;
    }

    public String[] testEval9() {
        if (!(super.tester.executeTestCase("TestCases2", "test1").equals(true))) return new String[] { "TestCases2", "test1" };
        return null;
    }

    public boolean checkEval6() {
        return true;
    }

    public boolean solveEval6() {
        return false;
    }

    public String[] testEval6() {
        return null;
    }

    public boolean checkEval7() {
        final Class class1 = super.introspector.getClass("GrupoFiguras");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        final Method method1 = super.introspector.getDeclaredMethod(class1, "numRectangulos", classs1);
        if (method1 == null) return false;
        return true;
    }

    public boolean solveEval7() {
        return false;
    }

    public String[] testEval7() {
        if (!(super.tester.executeTestCase("TestCases3", "test1").equals(true))) return new String[] { "TestCases3", "test1" };
        if (!(super.tester.executeTestCase("TestCases3", "test2").equals(true))) return new String[] { "TestCases3", "test2" };
        if (!(super.tester.executeTestCase("TestCases3", "test3").equals(true))) return new String[] { "TestCases3", "test3" };
        return null;
    }

    public boolean checkEval8() {
        final Class class1 = super.introspector.getClass("GrupoFiguras");
        if (class1 == null) return false;
        final Class[] classs1 = {  };
        final Method method1 = super.introspector.getDeclaredMethod(class1, "numRectangulos", classs1);
        if (method1 == null) return false;
        return true;
    }

    public boolean solveEval8() {
        return false;
    }

    public String[] testEval8() {
        if (!(super.tester.executeTestCase("TestCases4", "test1").equals(true))) return new String[] { "TestCases4", "test1" };
        if (!(super.tester.executeTestCase("TestCases4", "test2").equals(true))) return new String[] { "TestCases4", "test2" };
        if (!(super.tester.executeTestCase("TestCases4", "test3").equals(true))) return new String[] { "TestCases4", "test3" };
        return null;
    }
}