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

org.scalatest.Rerunner.scala Maven / Gradle / Ivy

Go to download

ScalaTest is a free, open-source testing toolkit for Scala and Java programmers.

There is a newer version: 2.0.M6-SNAP4
Show newest version
/*
 * Copyright 2001-2008 Artima, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.scalatest

/**
 * Trait whose instances can rerun tests or other entities (such as suites). An object extending
 * this trait can be passed to a Reporter as part of a Report. The
 * test or other entity about which the report is made can then be rerun by invoking the
 * rerun method on the Rerunnable.
 *
 * @author Bill Venners
 */
@deprecated("We are considering removing Rerunner in ScalaTest 2.0 and would like to know if anyone is using it. If you are, please email [email protected] or and describe your use case. Thanks!")
trait Rerunner /* extends ((Reporter, Stopper, Filter, Map[String, Any], Option[Distributor], Tracker, ClassLoader) => Unit) */ {

  /**
   * Rerun a test or other entity (such as a suite), reporting results to the specified Reporter.
   *
   * @param reporter the Reporter to which results will be reported
   * @param stopper the Stopper that will be consulted to determine whether to stop execution early.
   * @param filter a Filter with which to filter tests based on their tags
   * @param configMap a Map of key-value pairs that can be used by the suite or test being rerun
   * @param distributor an optional Distributor, into which to put nested Suites, if any, to be executed
   *              by another entity, such as concurrently by a pool of threads. If None, nested Suites will be executed sequentially.
   * @param loader the ClassLoader from which to load classes needed to rerun
   *     the test or suite.
   *
   * @throws NullPointerException if any of the passed values are null.
   */
  def apply(reporter: Reporter, stopper: Stopper, filter: Filter,
            configMap: Map[String, Any], distributor: Option[Distributor], tracker: Tracker, loader: ClassLoader): Unit
}

/**
 * Companion object to Rerunner that holds a deprecated implicit conversion.
 */
object Rerunner {

  /**
   * Converts a Rerunner to a function type that prior to the ScalaTest 1.5 release the
   * Rerunner extended.
   *
   * 

* Prior to ScalaTest 1.5, Rerunner extended function type (Reporter, Stopper, Filter, Map[String, Any], Option[Distributor], Tracker, ClassLoader) => Unit. * This inheritance relationship was severed in 1.5 to make it possible to implement Rerunners in Java, a request by an IDE * vendor to isolate their ScalaTest integration from binary incompatibility between different Scala/ScalaTest releases. * To make a trait easily implementable in Java, it needs to have no concrete methods. Rerunner itself does not declare * any concrete methods, but (Reporter, Stopper, Filter, Map[String, Any], Option[Distributor], Tracker, ClassLoader) => Unit does. *

* *

* This implicit conversion was added in ScalaTest 1.5 to avoid breaking any source code that was actually using * Rerunner as an (Reporter, Stopper, Filter, Map[String, Any], Option[Distributor], Tracker, ClassLoader) => Unit function. It is unlikely anyone was actually doing that, but if you were * and now get the deprecation warning, please email [email protected] if you believe this implicit conversion should * be retained. If no one steps forward with a compelling justification, it will be removed in a future version of ScalaTest. *

*/ @deprecated("See the documentation for Rerunner.convertRerunnerToFunction for information") implicit def convertRerunnerToFunction(rerunner: Rerunner): (Reporter, Stopper, Filter, Map[String, Any], Option[Distributor], Tracker, ClassLoader) => Unit = (reporter: Reporter, stopper: Stopper, filter: Filter, configMap: Map[String, Any], distributor: Option[Distributor], tracker: Tracker, loader: ClassLoader) => rerunner(reporter, stopper, filter, configMap, distributor, tracker, loader) } /* * * Converts a Rerunner to a function type that prior to the ScalaTest 1.5 release the * Rerunner extended. * *

* Prior to ScalaTest 1.5, Rerunner extended function type FFF. * This inheritance relationship was severed in 1.5 to make it possible to implement Rerunners in Java, a request by an IDE * vendor to isolate their ScalaTest integration from binary incompatibility between different Scala/ScalaTest releases. * To make a trait easily implementable in Java, it needs to have no concrete methods. Rerunner itself does not declare * any concrete methods, but FFF does. *

* *

* This implicit conversion was added in ScalaTest 1.5 to avoid breaking any source code that was actually using * Rerunner as an FFF function. It is unlikely anyone was actually doing that, but if you were * and now get the deprecation warning, please email [email protected] if you believe this implicit conversion should * be retained. If no one steps forward with a compelling justification, it will be removed in a future version of ScalaTest. *

*/




© 2015 - 2024 Weber Informatics LLC | Privacy Policy