// Path: java/collabode/testing/TestSupportInitializer.java
// public static final String PACKAGE = "collabode";
// 
// Path: java/collabode/testing/TestSupportInitializer.java
// public static final List<String> STATUSES = Arrays.asList(new String[] { "New", "NeedsImpl", "NeedsReview", "Accepted" });


import static collabode.testing.TestSupportInitializer.PACKAGE;
import static collabode.testing.TestSupportInitializer.STATUSES;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import org.eclipse.jdt.core.*;
import org.eclipse.jdt.junit.model.ITestCaseElement;
import org.eclipse.jdt.junit.model.ITestElement.FailureTrace;
import org.eclipse.jdt.junit.model.ITestElement.Result;
package collabode.testing;




/**
 * Represents a single test result
 */
public class TestResult {
    private final Result result;
    /**
     * Test failure trace.
     */
    public final FailureTrace trace;
    /**
     * Test evolution status.
     * Represented in code by a collabode.* annotation.
     */
    public final String status;
    
    TestResult(ITestCaseElement elt, IJavaProject project) {
        result = elt.getTestResult(true);
        trace = elt.getFailureTrace();
        status = getStatus(elt, project);
    }
    
    private String getStatus(ITestCaseElement elt, IJavaProject project) {
        try {
            IType type = project.findType(elt.getTestClassName());
            IMethod method = type.getMethod(elt.getTestMethodName(), new String[0]);
            for (IAnnotation ann : method.getAnnotations()) {
                String[][] names = type.resolveType(ann.getElementName());
                if (names == null) { continue; }
                for (String[] name : names) {
// Path: java/collabode/testing/TestSupportInitializer.java
// public static final String PACKAGE = "collabode";
// 
// Path: java/collabode/testing/TestSupportInitializer.java
// public static final List<String> STATUSES = Arrays.asList(new String[] { "New", "NeedsImpl", "NeedsReview", "Accepted" });


// Path: java/collabode/testing/TestResult.java
import static collabode.testing.TestSupportInitializer.PACKAGE;
import static collabode.testing.TestSupportInitializer.STATUSES;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import org.eclipse.jdt.core.*;
import org.eclipse.jdt.junit.model.ITestCaseElement;
import org.eclipse.jdt.junit.model.ITestElement.FailureTrace;
import org.eclipse.jdt.junit.model.ITestElement.Result;

package collabode.testing;




/**
 * Represents a single test result
 */
public class TestResult {
    private final Result result;
    /**
     * Test failure trace.
     */
    public final FailureTrace trace;
    /**
     * Test evolution status.
     * Represented in code by a collabode.* annotation.
     */
    public final String status;
    
    TestResult(ITestCaseElement elt, IJavaProject project) {
        result = elt.getTestResult(true);
        trace = elt.getFailureTrace();
        status = getStatus(elt, project);
    }
    
    private String getStatus(ITestCaseElement elt, IJavaProject project) {
        try {
            IType type = project.findType(elt.getTestClassName());
            IMethod method = type.getMethod(elt.getTestMethodName(), new String[0]);
            for (IAnnotation ann : method.getAnnotations()) {
                String[][] names = type.resolveType(ann.getElementName());
                if (names == null) { continue; }
                for (String[] name : names) {
                    if (name[0].equals(PACKAGE)) {