void putTestFailureTimestamp(Description key, long end) { fFailureTimestamps.put(key.toString(), end); }
void putTestDuration(Description description, long duration) { fDurations.put(description.toString(), duration); }
boolean isNewTest(Description key) { return !fDurations.containsKey(key.toString()); }
Long getFailureTimestamp(Description key) { return fFailureTimestamps.get(key.toString()); }
Long getTestDuration(Description key) { return fDurations.get(key.toString()); }
private Class<?> getMalformedTestClass(Description each) { try { return Class.forName(each.toString().replace(MALFORMED_JUNIT_3_TEST_CLASS_PREFIX, "")); } catch (ClassNotFoundException e) { return null; } }
void putTestFailureTimestamp(Description key, long end) { fFailureTimestamps.put(key.toString(), end); }
Long getFailureTimestamp(Description key) { return fFailureTimestamps.get(key.toString()); }
void putTestDuration(Description description, long duration) { fDurations.put(description.toString(), duration); }
boolean isNewTest(Description key) { return !fDurations.containsKey(key.toString()); }
Long getTestDuration(Description key) { return fDurations.get(key.toString()); }
private Class<?> getMalformedTestClass(Description each) { try { return Class.forName(each.toString().replace(MALFORMED_JUNIT_3_TEST_CLASS_PREFIX, "")); } catch (ClassNotFoundException e) { return null; } }
private String methodAndClassNamePatternGroupOrDefault(int group, String defaultString) { Matcher matcher = METHOD_AND_CLASS_NAME_PATTERN.matcher(toString()); return matcher.matches() ? matcher.group(group) : defaultString; } }
private String methodAndClassNamePatternGroupOrDefault(int group, String defaultString) { Matcher matcher = METHOD_AND_CLASS_NAME_PATTERN.matcher(toString()); return matcher.matches() ? matcher.group(group) : defaultString; } }
/** * @return If this describes a method invocation, * the name of the class of the test instance */ public String getClassName() { return fTestClass != null ? fTestClass.getName() : methodAndClassNamePatternGroupOrDefault(2, toString()); }
@Override public String toString() { return getDescription().toString(); }
/** * @return If this describes a method invocation, * the name of the class of the test instance */ public String getClassName() { return fTestClass != null ? fTestClass.getName() : methodAndClassNamePatternGroupOrDefault(2, toString()); }
@Override public String toString() { return getDescription().toString(); }
private void findLeaves(Description parent, Description description, List<Description> results) { if (description.getChildren().isEmpty()) { if (description.toString().equals("warning(junit.framework.TestSuite$1)")) { results.add(Description.createSuiteDescription(MALFORMED_JUNIT_3_TEST_CLASS_PREFIX + parent)); } else { results.add(description); } } else { for (Description each : description.getChildren()) { findLeaves(description, each, results); } } } }
private void findLeaves(Description parent, Description description, List<Description> results) { if (description.getChildren().isEmpty()) { if (description.toString().equals("warning(junit.framework.TestSuite$1)")) { results.add(Description.createSuiteDescription(MALFORMED_JUNIT_3_TEST_CLASS_PREFIX + parent)); } else { results.add(description); } } else { for (Description each : description.getChildren()) { findLeaves(description, each, results); } } } }