Permalink
Browse files

Removed deprecated code segments

  • Loading branch information...
1 parent 5178f29 commit 39aac2af4088e57f5cff8f0915a31adccd345777 @rlegendi committed Jun 29, 2012
@@ -72,6 +72,7 @@ object ScalaTestNotifier {
getDecodedName(name)
}
+ // TODO This is exact copy&paste code from ScalaTestNotifier - should it be publicly visible?
private def getDecodedName(name: String): Option[String] = {
val decoded = NameTransformer.decode(name)
if (decoded == name) None else Some(decoded)
@@ -41,113 +41,4 @@ object Specs2Bridge {
// one way to make things nicer is to add "implicit" to your getContent definition. This way, any spec can be seen as the list
// of Fragments it is holding
implicit def getContentFor(spec: SpecificationStructure): Fragments = spec.content
-
- def createExecuteSpecification(name: SpecName, fs: Seq[ExecutedFragment], args: Arguments = Arguments()): ExecutingSpecification =
- ExecutingSpecification.create(name, fs, args)
-
- // TODO This is exact copy&paste code from ScalaTestNotifier - should it be publicly visible?
- private def getDecodedName(name: String): Option[String] = {
- val decoded = NameTransformer.decode(name)
- if (decoded == name) None else Some(decoded)
- }
-
- def notifyScalaTest(spec2: SpecificationStructure, tracker: Tracker, reporter: Reporter) = (executed: Seq[ExecutedFragment]) => {
-
- // TODO Probably I will need some nice descriptions like JUnitDescriptionsFragments.mapper() has
-
- // TODO Chee Seng: Why are we calling nextOrdinal() for a new suite name each time?
-
- // TODO Utility methods for suiteId( spec ) = spec.getClass.getSimpleName, etc.
-
- executed foreach {
- case (res @ ExecutedResult(_, result, timer, _, _)) => {
- //notifier.fireTestStarted(desc)
-
- val testName = res.text(spec2.content.arguments).toString
- val exampleName = testName + " (exampleName)"
-
- //val duration = res.stats.time.toInt //System.currentTimeMillis() - exampleStart
- // TODO Is this the correct time to use here?
- val duration = timer.totalMillis
-
- //val formatter = ScalaTestBridge.getIndentedText(exampleName, indentLevel + 1, true)
- val formatter = ScalaTestBridge.getIndentedText(testName, 2, true)
-
- res.message // TODO I should use this
-
- val name = Utils.suiteNameFor(spec2)
- val id = Utils.suiteIdFor(spec2)
-
- reporter(TestStarting(tracker.nextOrdinal(), name, id, Some(id),
- getDecodedName(name), testName, exampleName,
- getDecodedName(testName), Some(MotionToSuppress), None, Some(id)))
-
- /* TODO Required ScalaTest notifications:
- * TestStarting ---
- * TestSucceeded ---
- * TestFailed ---
- * TestIgnored
- * TestPending ---
- * TestCanceled
- * SuiteStarting
- * SuiteCompleted
- * SuiteAborted
- * RunStarting
- * RunCompleted
- * RunStopped
- * RunAborted
- * InfoProvided
- * MarkupProvided
- * ScopeOpened ---
- * ScopeClosed ---
- */
-
- // TODO Ask Eric: When do the DecoratedResults are used?
- // ERIC: this is used to display the html table for a DataTable when reporting to html files
-
- // TODO Indenting?
-
- result match {
- case f @ Failure(m, e, st, d) =>
- // notifier.fireTestFailure(new notification.Failure(desc, junitFailure(f)))
- //reporter(TestFailed(tracker.nextOrdinal(), e.getMessage, spec.getClass.getSimpleName, spec.getClass.getName, Some(spec.getClass.getName), getDecodedName(spec.getClass.getSimpleName), testName, exampleName, getDecodedName(testName), Some(e), Some(duration), Some(formatter), None))
- reporter(TestFailed(tracker.nextOrdinal(), m, name, id, Some(id),
- getDecodedName(name), testName, exampleName, getDecodedName(testName),
- Some(f.exception), Some(duration), Some(formatter), None))
-
- case e @ Error(m, st) =>
- // notifier.fireTestFailure(new notification.Failure(desc, args.traceFilter(e.exception)))
- reporter(TestFailed(tracker.nextOrdinal(), m, name, id, Some(id),
- getDecodedName(name), testName, exampleName, getDecodedName(name),
- Some(e.exception), Some(duration), Some(formatter), None))
- case DecoratedResult(_, f @ Failure(m, e, st, d)) =>
- // notifier.fireTestFailure(new notification.Failure(desc, junitFailure(f)))
- reporter(TestFailed(tracker.nextOrdinal(), m, name, id, Some(id),
- getDecodedName(name), testName, exampleName, getDecodedName(name),
- Some(f.exception), Some(duration), Some(formatter), None))
-
- case DecoratedResult(_, e @ Error(m, st)) =>
- // notifier.fireTestFailure(new notification.Failure(desc, args.traceFilter(e.exception)))
- reporter(TestFailed(tracker.nextOrdinal(), m, name, id, Some(id),
- getDecodedName(name), testName, exampleName, getDecodedName(name),
- Some(e.exception), Some(duration), Some(formatter), None))
-
- case Pending(_) | Skipped(_, _) =>
- // notifier.fireTestIgnored(desc)
- reporter(TestPending(tracker.nextOrdinal(), name, id, Some(id),
- getDecodedName(name), testName, exampleName, getDecodedName(testName), None, Some(formatter)))
-
- case Success(_, _) | DecoratedResult(_, _) =>
- reporter(TestSucceeded(tracker.nextOrdinal(), name, id, Some(id),
- getDecodedName(name), testName, exampleName, getDecodedName(testName), Some(duration), Some(formatter), None))
- }
- //notifier.fireTestFinished(desc)
- //reporter()
- }
- case ExecutedSpecStart(_, _, _) => //notifier.fireTestRunStarted(desc) // TODO: Should we care?
- case ExecutedSpecEnd(_, _, _) => //notifier.fireTestRunFinished(new org.junit.runner.Result)
- case _ => // don't do anything otherwise too many tests will be counted
- }
- }
-
}

0 comments on commit 39aac2a

Please sign in to comment.