Skip to content

Commit

Permalink
Move testQuietly to SQLTestUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxwing committed Mar 3, 2016
1 parent 4642637 commit 2598e98
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import org.scalatest.time.SpanSugar._

import org.apache.spark.SparkException
import org.apache.spark.sql.{ContinuousQuery, Dataset, StreamTest}
import org.apache.spark.sql.catalyst.util.quietly
import org.apache.spark.sql.execution.streaming.{MemorySink, MemoryStream, StreamExecution, StreamingRelation}
import org.apache.spark.sql.test.SharedSQLContext

Expand All @@ -50,20 +49,6 @@ class ContinuousQueryManagerSuite extends StreamTest with SharedSQLContext with
sqlContext.streams.resetTerminated()
}

/**
* Disable stdout and stderr when running the test. To not output the logs to the console,
* ConsoleAppender's `follow` should be set to `true` so that it will honors reassignments of
* System.out or System.err. Otherwise, ConsoleAppender will still output to the console even if
* we change System.out and System.err.
*/
private def testQuietly(name: String)(f: => Unit): Unit = {
test(name) {
quietly {
f
}
}
}

testQuietly("listing") {
val (m1, ds1) = makeDataset
val (m2, ds2) = makeDataset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,20 @@ private[sql] trait SQLTestUtils
protected implicit def logicalPlanToSparkQuery(plan: LogicalPlan): DataFrame = {
DataFrame(sqlContext, plan)
}

/**
* Disable stdout and stderr when running the test. To not output the logs to the console,
* ConsoleAppender's `follow` should be set to `true` so that it will honors reassignments of
* System.out or System.err. Otherwise, ConsoleAppender will still output to the console even if
* we change System.out and System.err.
*/
protected def testQuietly(name: String)(f: => Unit): Unit = {
test(name) {
quietly {
f
}
}
}
}

private[sql] object SQLTestUtils {
Expand Down

0 comments on commit 2598e98

Please sign in to comment.