private Description describeCause() { return Description.createTestDescription(classNames, "initializationError"); }
private Description describeCause(Throwable child) { return Description.createTestDescription(fTestClass, "initializationError"); }
AssumptionViolationRunner(TestClass testClass, String methodName, AssumptionViolatedException exception) { this.description = Description .createTestDescription(testClass.getJavaClass(), methodName + "() assumption violation"); this.exception = exception; }
@Override protected Description describeChild(DexClassNode child) { return Description.createTestDescription(testClass, "[" + child.className + "]"); }
@Override protected Description describeChild(DexClassNode child) { return Description.createTestDescription(testClass, "c [" + child.className + "]"); }
/** * Create a <code>Request</code> that, when processed, will run a single test. * This is done by filtering out all other tests. This method is used to support rerunning * single tests. * * @param clazz the class of the test * @param methodName the name of the test * @return a <code>Request</code> that will cause a single test be run */ public static Request method(Class<?> clazz, String methodName) { Description method = Description.createTestDescription(clazz, methodName); return Request.aClass(clazz).filterWith(method); }
/** * Create a <code>Request</code> that, when processed, will run a single test. * This is done by filtering out all other tests. This method is used to support rerunning * single tests. * * @param clazz the class of the test * @param methodName the name of the test * @return a <code>Request</code> that will cause a single test be run */ public static Request method(Class<?> clazz, String methodName) { Description method = Description.createTestDescription(clazz, methodName); return Request.aClass(clazz).filterWith(method); }
@Override protected Description describeChild(FrameworkMethod method) { Description description = methodDescriptions.get(method); if (description == null) { description = Description.createTestDescription(getTestClass().getJavaClass(), testName(method), method.getAnnotations()); methodDescriptions.putIfAbsent(method, description); } return description; }
private Description asDescription(Test test) { if (test instanceof Describable) { Describable facade = (Describable) test; return facade.getDescription(); } return Description.createTestDescription(getEffectiveClass(test), getName(test)); }
public void validateUnusedStubs(Class<?> testClass, RunNotifier notifier) { Collection<Invocation> unused = new UnusedStubbingsFinder().getUnusedStubbingsByLocation(mocks); if (unused.isEmpty()) { return; //whoa!!! All stubbings were used! } //Oups, there are unused stubbings Description unnecessaryStubbings = Description.createTestDescription(testClass, "unnecessary Mockito stubbings"); notifier.fireTestFailure(new Failure(unnecessaryStubbings, Reporter.formatUnncessaryStubbingException(testClass, unused))); }
private Description asDescription(Test test) { if (test instanceof Describable) { Describable facade = (Describable) test; return facade.getDescription(); } return Description.createTestDescription(getEffectiveClass(test), getName(test)); }
@Override protected Description describeChild(FrameworkMethod method) { return Description.createTestDescription(getTestClass().getJavaClass(), testName(method), method.getAnnotations()); }
protected Description methodDescription(Method method) { return Description.createTestDescription(getTestClass().getJavaClass(), testName(method), testAnnotations(method)); }
protected Description methodDescription(Method method) { return Description.createTestDescription(getTestClass().getJavaClass(), testName(method), testAnnotations(method)); }
private void run(CloserRule closer, final Runnable runnable) throws Throwable { closer.apply( new Statement() { @Override public void evaluate() { runnable.run(); } }, Description.createTestDescription( CloserRuleTest.class.getCanonicalName(), "baseRunner", UUID.randomUUID() ) ).evaluate(); } }
@Override protected Description describeChild(Path child) { return Description.createTestDescription(getTestClass().getJavaClass(), child.toString()); }
private void runTest(final LoggerContextRule rule, final Statement statement) { try { rule.apply(statement, Description .createTestDescription(getClass(), Thread.currentThread().getStackTrace()[1].getMethodName())) .evaluate(); } catch (final Throwable e) { Throwables.rethrow(e); } } }
@Override protected Description describeChild(FileSet child) { return Description.createTestDescription(getTestClass().getJavaClass(), child.name); }
private Description describeMethod(MethodInfo method) { Annotation[] anns = method.getReflection() == null ? new Annotation[0] : method.getAnnotations(); Description desc = Description.createTestDescription(spec.getReflection(), method.getName(), anns); method.setDescription(desc); return desc; } }
private IterationInfo createIterationInfo(Object[] dataValues, int estimatedNumIterations) { IterationInfo result = new IterationInfo(currentFeature, dataValues, estimatedNumIterations); String iterationName = currentFeature.getIterationNameProvider().getName(result); result.setName(iterationName); Description description = Description.createTestDescription(spec.getReflection(), iterationName, currentFeature.getFeatureMethod().getAnnotations()); result.setDescription(description); return result; }