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[] {  }, "Cubo.java", "Debes heredar de la clase Figura", "Crear clase Cubo heredando de la clase Figura", 0.0 });
        properties.add(new Object[] { "Eval2", "Functionality", null, new String[] {  }, "Cubo.java", "Debes implementar la interfaz Volumen", "Cubo implementa la interfaz Volumen", 0.15 });
        properties.add(new Object[] { "Eval3", "Functionality", null, new String[] {  }, "Cubo.java", "Debes heredar de la clase Figura", "Cubo hereda de la clase Figura", 0.15 });
        properties.add(new Object[] { "Eval4", "Functionality", null, new String[] {  }, "Cubo.java", "La clase debe tener un atributo de tipo double", "Cubo tiene un atributo de tipo double", 0.1 });
        properties.add(new Object[] { "Eval5", "Functionality", null, new String[] {  }, "Cubo.java", "Debes implementar el constructor", "Cubo implementa un constructor", 0.15 });
        properties.add(new Object[] { "Eval6", "Functionality", null, new String[] {  }, "Cubo.java", "Debes implementar el método volumen", "Cubo implementa el método volumen", 0.15 });
        properties.add(new Object[] { "Eval7", "Functionality", null, new String[] {  }, "GrupoFiguras.java", "Debes implementar el método maxVolumen", "Crear el método maxVolumen en la clase GrupoFiguras", 0.0 });
        properties.add(new Object[] { "Eval8", "Functionality", null, new String[] {  }, "GrupoFiguras.java", "Debes utilizar el bucle para recorrer las figuras", "Implementar el bucle en el método maxVolumen de GrupoFiguras", 0.15 });
        properties.add(new Object[] { "Eval9", "Functionality", null, new String[] {  }, "GrupoFiguras.java", "Debes usar instanceof", "Comprobar que la figura tiene volumen en el método maxVolumen de GrupoFiguras", 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("Cubo");
        if (class1 == null) return false;
        final Class class2 = super.introspector.getClass("Volumen");
        if (class2 == null) return false;
        if (!(super.introspector.checkImplements(class1, class2) == true)) return false;
        return true;
    }

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

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

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

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

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

    public boolean checkEval4() {
        final Class class1 = super.introspector.getClass("Cubo");
        if (class1 == null) return false;
        if (!(super.introspector.getDeclaredFieldCount(class1) == 1)) return false;
        boolean field1Checker = false;
        for (Field field1 : super.introspector.getDeclaredFields(class1)) {
            if (!(super.introspector.checkClass(field1, double.class, true) == true)) continue;
            field1Checker = true;
            break;
        }
        if (field1Checker == false) return false;
        return true;
    }

    public boolean solveEval4() {
        final Class class1 = super.introspector.getClass("Cubo");
        if (class1 == null) return false;
        super.intercessor.removeFields(class1);
        super.intercessor.addField(class1, 1, double.class, "lado");
        return true;
    }

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

    public boolean checkEval5() {
        final Class class1 = super.introspector.getClass("Cubo");
        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 solveEval5() {
        final Class class1 = super.introspector.getClass("Cubo");
        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[] testEval5() {
        return null;
    }

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

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

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

    public boolean checkEval7() {
        return true;
    }

    public boolean solveEval7() {
        return false;
    }

    public String[] testEval7() {
        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, "maxVolumen", classs1);
        if (method1 == null) return false;
        return true;
    }

    public boolean solveEval8() {
        return false;
    }

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

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

    public boolean solveEval9() {
        return false;
    }

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