Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
57,800
String () { return "Ignored " + methodName; }
describe
57,801
boolean (Description description) { if (description.isTest() && description.getDisplayName().startsWith("warning(junit.framework.TestSuite$")) { return true; } if (description.isTest() && isParameterizedMethodName(description.getMethodName(), methodName)) { return true; } return methodFilter.shouldRun(description); }
shouldRun
57,802
String () { return methodFilter.describe(); }
describe
57,803
boolean (final String methodName, final Class<?> clazz) { final RunWith clazzAnnotation = clazz.getAnnotation(RunWith.class); if (clazzAnnotation != null && Parameterized.class.isAssignableFrom(clazzAnnotation.value())) { return true; } if (methodName != null) { for (Method method : clazz.getDeclaredMethods()) { if (me...
isParameterized
57,804
Request (final String parameterString, final String methodName, Class<?> clazz, RunWith clazzAnnotation) { if (clazzAnnotation == null) return null; final Class<? extends Runner> runnerClass = clazzAnnotation.value(); if (parameterString != null || isParameterized(methodName, clazz)) { try { if (methodName != null) { t...
getParameterizedRequest
57,805
boolean (Description description) { final String descriptionMethodName = description.getMethodName(); //filter by params if (parameterString != null && descriptionMethodName != null && !descriptionMethodName.endsWith(parameterString)) { return false; } //filter only selected method if (methodName != null && description...
shouldRun
57,806
String () { if (parameterString == null) { return methodName + " with any parameter"; } if (methodName == null) { return "Parameter " + parameterString + " for any method"; } return methodName + " with parameter " + parameterString; }
describe
57,807
boolean (String parameterizedMethodName, String baseMethodName) { return parameterizedMethodName.startsWith(baseMethodName) && //methodName[ valid for any parameter for the current method. parameterizedMethodName.length() > baseMethodName.length() && parameterizedMethodName.substring(baseMethodName.length()).trim().sta...
isParameterizedMethodName
57,808
Request (String suiteName, Class<?>[] classes) { Request allClasses; try { Class.forName("org.junit.internal.requests.ClassesRequest"); allClasses = JUnit4ClassesRequestBuilder.getClassesRequest(suiteName, classes); } catch (ClassNotFoundException e1) { allClasses = JUnit45ClassesRequestBuilder.getClassesRequest(suiteN...
getClassRequestsUsing44API
57,809
void (List<Class<?>> result, String className) { final Class<?> aClass = loadTestClass(className); if (!result.contains(aClass)) { //do not append classes twice: rerun failed tests from one test suite result.add(aClass); } }
appendTestClass
57,810
ComparisonFailureData (String message) { return createExceptionNotification(message, PATTERNS); }
createExceptionNotification
57,811
ComparisonFailureData (Throwable assertion) { if (isComparisonFailure(assertion)) { return ComparisonFailureData.create(assertion); } try { final Throwable cause = assertion.getCause(); if (isComparisonFailure(cause)) { return ComparisonFailureData.create(cause); } } catch (Throwable ignore) { } final String message = ...
createExceptionNotification
57,812
boolean (Throwable throwable) { if (throwable == null) return false; return isComparisonFailure(throwable.getClass()); }
isComparisonFailure
57,813
boolean (Class<?> aClass) { if (aClass == null) return false; final String throwableClassName = aClass.getName(); if (throwableClassName.equals(JUNIT_FRAMEWORK_COMPARISON_NAME) || throwableClassName.equals(ORG_JUNIT_COMPARISON_NAME) || throwableClassName.equals(ComparisonFailureData.OPENTEST4J_ASSERTION)) { return true...
isComparisonFailure
57,814
boolean (int messageLength) { int threshold = 10000; try { final String property = System.getProperty(MESSAGE_LENGTH_FOR_PATTERN_MATCHING); if (property != null) { try { threshold = Integer.parseInt(property); } catch (NumberFormatException ignore) {} } } catch (SecurityException ignored) {} return messageLength < thre...
acceptedByThreshold
57,815
Request (String suiteName, Class<?>[] classes) { try { return Request.runner(new IdeaSuite(new AllDefaultPossibilitiesBuilder(true), classes, suiteName)); } catch (Exception initializationError) { initializationError.printStackTrace(); return null; } }
getClassesRequest
57,816
Runner () { try { return new AllDefaultPossibilitiesBuilder(true) { @Override protected IgnoredBuilder ignoredBuilder() { return new IgnoredBuilder() { @Override public Runner runnerForClass(Class testClass) { return null; } }; } @Override protected JUnit4Builder junit4Builder() { return new JUnit4Builder() { @Override...
getRunner
57,817
IgnoredBuilder () { return new IgnoredBuilder() { @Override public Runner runnerForClass(Class testClass) { return null; } }; }
ignoredBuilder
57,818
Runner (Class testClass) { return null; }
runnerForClass
57,819
JUnit4Builder () { return new JUnit4Builder() { @Override public Runner runnerForClass(Class testClass) throws Throwable { if (!recursively) return super.runnerForClass(testClass); try { Method ignored = BlockJUnit4ClassRunner.class.getDeclaredMethod("isIgnored", FrameworkMethod.class); return new BlockJUnit4ClassRunne...
junit4Builder
57,820
boolean (FrameworkMethod child) { return false; }
isIgnored
57,821
void (FrameworkMethod method, RunNotifier notifier) { final Description description = describeChild(method); final EachTestNotifier eachNotifier = new EachTestNotifier(notifier, description); eachNotifier.fireTestStarted(); try { methodBlock(method).evaluate(); } catch (AssumptionViolatedException e) { eachNotifier.add...
runChild
57,822
AnnotatedBuilder () { return new AnnotatedBuilder(this) { @Override public Runner runnerForClass(Class testClass) { return null; } }; }
annotatedBuilder
57,823
Runner (Class testClass) { return null; }
runnerForClass
57,824
JUnit4Builder () { return new JUnit4Builder() { @Override public Runner runnerForClass(Class testClass) { return null; } }; }
junit4Builder
57,825
Runner (Class testClass) { return null; }
runnerForClass
57,826
String (Description description) { try { return description.getClassName(); } catch (NoSuchMethodError e) { final String displayName = description.getDisplayName(); Matcher matcher = Pattern.compile("(.*)\\((.*)\\)").matcher(displayName); return matcher.matches() ? matcher.group(2) : displayName; } }
getClassName
57,827
String (Description description) { try { return description.getMethodName(); } catch (NoSuchMethodError e) { final String displayName = description.getDisplayName(); Matcher matcher = Pattern.compile("(.*)\\((.*)\\)").matcher(displayName); if (matcher.matches()) return matcher.group(1); return null; } }
getMethodName
57,828
TestNodePresentation (String fullName) { if (fullName == null) { return new TestNodePresentation(null, null); } int lastPointIdx = fullName.lastIndexOf('.'); String name = fullName; String comment = null; if (lastPointIdx >= 0) { name = fullName.substring(lastPointIdx + 1); comment = fullName.substring(0, lastPointIdx)...
getRootNodePresentation
57,829
String (String fqName, boolean splitBySlash) { if (fqName == null) return null; final int idx = fqName.indexOf("["); if (idx == 0) { //param name return fqName; } String fqNameWithoutParams = idx > 0 && fqName.endsWith("]") ? fqName.substring(0, idx) : fqName; int classEnd = splitBySlash ? fqNameWithoutParams.indexOf('...
getNodeName
57,830
String (Description description, String className, String methodName) { return "locationHint='java:test://" + MapSerializerUtil.escapeStr(className + "/" + getNodeName(methodName, true), MapSerializerUtil.STD_ESCAPER) + "'"; }
getTestLocation
57,831
String () { return myName; }
getName
57,832
String () { return myComment; }
getComment
57,833
Request (String suiteName, Class<?>[] classes) { try { return (Request)Class.forName("org.junit.internal.requests.ClassesRequest") .getConstructor(new Class[]{String.class, Class[].class}) .newInstance(new Object[]{suiteName, classes}); } catch (Exception e) { e.printStackTrace(); return null; } }
getClassesRequest
57,834
Request (final String suiteName, Class<?>[] classes, Map<String, Set<String>> classMethods, Class<?> category) { boolean canUseSuiteMethod = canUseSuiteMethod(classMethods); try { if (category != null) { try { Class.forName("org.junit.experimental.categories.Categories"); } catch (ClassNotFoundException e) { throw new ...
getClassesRequest
57,835
boolean (Map<String, Set<String>> classMethods) { for (Set<String> methods : classMethods.values()) { if (methods == null) { return true; } for (String methodName : methods) { if ("suite".equals(methodName)) { return true; } } } return classMethods.isEmpty(); }
canUseSuiteMethod
57,836
Description () { Description description = Description.createSuiteDescription(myName, getTestClass().getAnnotations()); try { final Method getFilteredChildrenMethod = ParentRunner.class.getDeclaredMethod("getFilteredChildren"); getFilteredChildrenMethod.setAccessible(true); Collection<?> filteredChildren = (Collection<...
getDescription
57,837
Description (Runner child) { final Description superDescription = super.describeChild(child); if (child instanceof ClassAwareSuiteMethod) { final Description description = Description.createSuiteDescription(((ClassAwareSuiteMethod)child).getKlass()); ArrayList<Description> children = superDescription.getChildren(); for...
describeChild
57,838
List<Runner> () { final List<Runner> children = new ArrayList<>(super.getChildren()); boolean containsSuiteInside = false; for (Runner child : children) { if (isSuite(child)) { containsSuiteInside = true; break; } } if (!containsSuiteInside) return children; try { final Set<String> allNames = new HashSet<>(); for (Runn...
getChildren
57,839
boolean (Object child) { return child instanceof Suite && !(child instanceof Parameterized) || child instanceof SuiteMethod; }
isSuite
57,840
void (Set<String> allNames, Object child) { try { if (child instanceof Suite) { final Method getChildrenMethod = Suite.class.getDeclaredMethod("getChildren"); getChildrenMethod.setAccessible(true); final List<?> tests = (List<?>)getChildrenMethod.invoke(child); for (Object test : tests) { final String displayName = des...
skipSuiteComponents
57,841
void (ArrayList<String> listeners, int count) { myListeners = listeners; myTestsListener = new JUnit4TestListener(); }
createListeners
57,842
int (String[] args, String name, int count, boolean sendTree) { try { final Request request = JUnit4TestRunnerUtil.buildRequest(args, name, sendTree); if (request == null) return -2; final Runner testRunner = request.getRunner(); Description description = getDescription(request, testRunner); if (description == null) { ...
startRunnerWithArgs
57,843
boolean (Description description) { return !description.isTest() && description.testCount() == 1; }
canCompress
57,844
Description (String[] args, String name) { final Request request = JUnit4TestRunnerUtil.buildRequest(args, name, false); if (request == null) return null; final Runner testRunner = request.getRunner(); try { return getDescription(request, testRunner); } catch (Exception e) { //noinspection HardCodedStringLiteral System...
getTestToStart
57,845
List<Description> (Description description) { return description.getChildren(); }
getChildTests
57,846
String (Description child) { return child.getClassName(); }
getTestClassName
57,847
String (Description child) { final String methodName = child.getMethodName(); return methodName != null ? child.getClassName() + "," + methodName : child.getClassName(); }
getStartDescription
57,848
void (Description description) { mySuccess = true; myJunitListener.testStarted(JUnit4ReflectionUtil.getClassName(description), JUnit4ReflectionUtil.getMethodName(description)); }
testStarted
57,849
void (Failure failure) { mySuccess = ComparisonFailureData.isAssertionError(failure.getException().getClass()); }
testFailure
57,850
void (Failure failure) { mySuccess = false; }
testAssumptionFailure
57,851
void (Description description) { mySuccess = false; }
testIgnored
57,852
void (Description description) { final String className = JUnit4ReflectionUtil.getClassName(description); final String methodName = JUnit4ReflectionUtil.getMethodName(description); if (myJunitListener instanceof IDEAJUnitListenerEx) { ((IDEAJUnitListenerEx)myJunitListener).testFinished(className, methodName, mySuccess)...
testFinished
57,853
void (Description description) { if (myJunitListener instanceof IDEAJUnitListenerEx) { ((IDEAJUnitListenerEx)myJunitListener).testRunStarted(description.getDisplayName()); } }
testRunStarted
57,854
void (Result result) { if (myJunitListener instanceof IDEAJUnitListenerEx) { ((IDEAJUnitListenerEx)myJunitListener).testRunFinished(myDisplayName); } }
testRunFinished
57,855
void (Class<?> category) { if (category != null) { try { final Categories.CategoryFilter categoryFilter = Categories.CategoryFilter.include(category); filter(categoryFilter); } catch (NoTestsRemainException e) { throw new RuntimeException(e); } } }
filterByCategory
57,856
String (String str) { return MapSerializerUtil.escapeStr(str, MapSerializerUtil.STD_ESCAPER); }
escapeName
57,857
void (Description description) { if (myRootName != null && !myRootName.equals("null") && !myRootName.startsWith("[")) { JUnitTestTreeNodeManager.TestNodePresentation rootNodePresentation = NODE_NAMES_MANAGER.getRootNodePresentation(myRootName); myPrintStream.println("##teamcity[rootName name = '" + escapeName(rootNodeP...
testRunStarted
57,858
void (Result result) { try { dumpQueue(true); } finally { for (int i = myStartedSuites.size() - 1; i>= 0; i--) { String className = JUnit4ReflectionUtil.getClassName(myStartedSuites.get(i)); if (!className.equals(myRootName)) { myPrintStream.println("##teamcity[testSuiteFinished name='" + escapeName(getShortName(classN...
testRunFinished
57,859
void (Description description) { testStarted(description, null); }
testStarted
57,860
void (Description description, String methodName) { final List<List<Description>> parents = myParents.get(description); if (myCurrentTest != null && (parents == null || parents.isEmpty() || !parents.get(0).contains(myCurrentTest))) { if (!myWaitingQueue.containsKey(description)) { myWaitingQueue.put(description, new Te...
testStarted
57,861
boolean (List<?> parents, Description currentClass, Description currentParent) { if (parents == null) { return !currentClass.equals(currentParent); } else { return System.identityHashCode(currentClass) != System.identityHashCode(currentParent); } }
isHierarchyDifferent
57,862
long () { return System.currentTimeMillis(); }
currentTime
57,863
void (Description description) { if (startedInParallel(description)) { TestEvent testEvent = myWaitingQueue.get(description); testEvent.setFinished(true); return; } testFinishedNoDumping(getFullMethodName(description)); dumpQueue(false); }
testFinished
57,864
boolean (Description description) { return myWaitingQueue.containsKey(description) && (myCurrentTest == null || !myCurrentTest.equals(description)); }
startedInParallel
57,865
void (final String methodName) { if (methodName != null) { final long duration = currentTime() - myCurrentTestStart; myPrintStream.println("##teamcity[testFinished name='" + escapeName(methodName.replaceFirst("/", ".")) + (duration > 0 ? "' duration='" + duration : "") + "']"); } myCurrentTest = null; }
testFinishedNoDumping
57,866
void (Failure failure) { testFailure(failure, failure.getDescription(), MapSerializerUtil.TEST_FAILED); }
testFailure
57,867
void (Failure failure, Description description, String messageName) { final boolean isIgnored = MapSerializerUtil.TEST_IGNORED.equals(messageName); String methodName = getFullMethodName(description); if (methodName == null) { //class setUp/tearDown failed if (!isIgnored) { classConfigurationStarted(description); testFa...
testFailure
57,868
void (Description description) { if (startedInParallel(description)) { TestEvent testEvent = myWaitingQueue.get(description); testEvent.setFinished(true); return; } myPrintStream.println("##teamcity[testFinished name='" + escapeName(TestListenerProtocol.CLASS_CONFIGURATION) + "']"); myCurrentTest = null; }
classConfigurationFinished
57,869
void (Description description) { if (myCurrentTest != null) { TestEvent value = new TestEvent(); value.setMethodName(TestListenerProtocol.CLASS_CONFIGURATION); myWaitingQueue.put(description, value); return; } myCurrentTest = description; myPrintStream.println("##teamcity[testStarted name='" + escapeName(TestListenerPr...
classConfigurationStarted
57,870
void (Failure failure, Description description, String messageName, String methodName) { final boolean isIgnored = MapSerializerUtil.TEST_IGNORED.equals(messageName); if (startedInParallel(description)) { TestEvent testEvent = myWaitingQueue.get(description); if (testEvent == null) { testEvent = new TestEvent(); myWait...
testFailure
57,871
boolean (Class<?> aClass) { if (aClass.getName().equals("org.opentest4j.MultipleFailuresError")) { return true; } Class<?> superclass = aClass.getSuperclass(); return superclass != null && isMultipleFailuresError(superclass); }
isMultipleFailuresError
57,872
String (Failure failure) { return failure.getTrace(); }
getTrace
57,873
void (Failure failure) { testFailure(failure, failure.getDescription(), MapSerializerUtil.TEST_IGNORED); }
testAssumptionFailure
57,874
String (Description description) { return getFullMethodName(description, null); }
getFullMethodName
57,875
String (Description description, Description parent) { return getFullMethodName(description, parent, false); }
getFullMethodName
57,876
String (Description description, Description parent, boolean acceptNull) { String methodName = myMethodNames.get(description); if (methodName == null) { methodName = JUnit4ReflectionUtil.getMethodName(description); if (methodName != null && (parent == null || !isParameter(parent))) { String shortName = getShortName(JUn...
getFullMethodName
57,877
void (Description description) { final String methodName = getFullMethodName(description); if (methodName == null) { for (final Description testDescription : description.getChildren()) { testIgnored(testDescription, getFullMethodName(testDescription));//todo } } else { testIgnored(description, methodName.replaceFirst("...
testIgnored
57,878
void (Description description, String methodName) { testStarted(description); Map<String, String> attrs = new HashMap<>(); try { final Ignore ignoredAnnotation = description.getAnnotation(Ignore.class); if (ignoredAnnotation != null) { final String val = ignoredAnnotation.value(); if (val != null) { attrs.put("message"...
testIgnored
57,879
void (boolean acceptUnfinished) { for (Iterator<Description> iterator = myWaitingQueue.keySet().iterator(); iterator.hasNext(); ) { Description description = iterator.next(); TestEvent testEvent = myWaitingQueue.get(description); if (acceptUnfinished || testEvent.isFinished()) { testStarted(description, testEvent.getMe...
dumpQueue
57,880
Failure () { return myFailure; }
getFailure
57,881
boolean () { return myIgnored; }
isIgnored
57,882
boolean () { return myFinished; }
isFinished
57,883
void (boolean finished) { myFinished = finished; }
setFinished
57,884
void (Failure failure) { myFailure = failure; }
setFailure
57,885
void (boolean ignored) { myIgnored = ignored; }
setIgnored
57,886
void (Map<String, String> attrs) { myAttrs = attrs; }
setAttrs
57,887
void (String methodName) { myMethodName = methodName; }
setMethodName
57,888
String () { return myMethodName; }
getMethodName
57,889
void (Description description, Description parent, List<Description> currentParents) { List<Description> pParents = new ArrayList<>(3); pParents.addAll(currentParents); if (parent != null) { final String parentClassName = JUnit4ReflectionUtil.getClassName(parent); if (!myRootName.equals(parentClassName)) { pParents.add...
sendTree
57,890
String (Description parentDescription, Description description, String parentClassName) { String locationHint = parentClassName; if (isParameter(parentDescription)) { final String displayName = description.getDisplayName(); final int paramIdx = displayName.indexOf(locationHint); if (paramIdx > -1) { locationHint = disp...
getSuiteLocation
57,891
String (String locationHint) { return " locationHint='java:suite://" + escapeName(locationHint) + "'"; }
getSuiteLocation
57,892
boolean (String methodName, String className) { return EMPTY_SUITE_WARNING.equals(methodName) && EMPTY_SUITE_NAME.equals(className); }
isWarning
57,893
boolean (Description description) { String displayName = description.getDisplayName(); return displayName.startsWith("[") && displayName.endsWith("]"); }
isParameter
57,894
void (Description description) { myRootName = JUnit4ReflectionUtil.getClassName(description); sendTree(description, null, new ArrayList<Description>()); myPrintStream.println("##teamcity[treeEnded]"); }
sendTree
57,895
String (String fqName) { return getShortName(fqName, false); }
getShortName
57,896
String (String fqName, boolean splitBySlash) { return NODE_NAMES_MANAGER.getNodeName(fqName, splitBySlash); }
getShortName
57,897
JUnitTestTreeNodeManager () { String junitNodeNamesManagerClassName = System.getProperty(JUnitTestTreeNodeManager.JUNIT_TEST_TREE_NODE_MANAGER_ARGUMENT); JUnitTestTreeNodeManager result = JUnitTestTreeNodeManager.JAVA_NODE_NAMES_MANAGER; if (junitNodeNamesManagerClassName != null) { try { Class<? extends JUnitTestTreeN...
getTestTreeNodeManager
57,898
void () { }
emptyTest1
57,899
void () { }
emptyTest2