All Downloads are FREE. Search and download functionalities are using the official Maven repository.

astra.unit.TestRunner Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version
package astra.unit;

import java.util.LinkedList;
import java.util.List;
import java.util.Set;

import org.reflections.Reflections;

import astra.core.ASTRAClass;

public class TestRunner {
    public static void main(String[] args) throws InstantiationException, IllegalAccessException {
        List tests = new LinkedList();
        Reflections reflections = new Reflections("");
        Set> javaClasses = reflections.getSubTypesOf(ASTRAClass.class);
        for (Class javaClass : javaClasses) {
            ASTRAClass astraClass = javaClass.newInstance();
            for (Class parent : astraClass.getParents()) {
                if (parent.getCanonicalName().equals("astra.unit.ASTRAUnitTest")) {
                    tests.add(javaClass.getCanonicalName());
                }
            }
        }
        TestSuite suite = new TestSuite(tests.toArray(new String[tests.size()]));
        suite.execute();
        TestSuite.displayResults(suite);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy