Skip to content

Commit 6221b37

Browse files
committed
clean up
1 parent 0cf9c08 commit 6221b37

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/FileStreamSourceSuite.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,13 @@ import java.net.URI
2323
import scala.util.Random
2424

2525
import org.apache.hadoop.fs.{FileStatus, Path, RawLocalFileSystem}
26-
import org.scalatest.mock.MockitoSugar
2726

2827
import org.apache.spark.SparkFunSuite
2928
import org.apache.spark.sql.execution.streaming.ExistsThrowsExceptionFileSystem._
3029
import org.apache.spark.sql.test.SharedSQLContext
3130
import org.apache.spark.sql.types.StructType
3231

33-
class FileStreamSourceSuite extends SparkFunSuite
34-
with SharedSQLContext
35-
with MockitoSugar {
32+
class FileStreamSourceSuite extends SparkFunSuite with SharedSQLContext {
3633

3734
import FileStreamSource._
3835

@@ -104,7 +101,9 @@ class FileStreamSourceSuite extends SparkFunSuite
104101
}
105102
}
106103

107-
/** FakeFileSystem to test fallback of the HDFSMetadataLog from FileContext to FileSystem API */
104+
/** Fake FileSystem to test whether the method `fs.exists` is called during
105+
* `DataSource.resolveRelation`.
106+
*/
108107
class ExistsThrowsExceptionFileSystem extends RawLocalFileSystem {
109108
override def getUri: URI = {
110109
URI.create(s"$scheme:///")
@@ -114,6 +113,7 @@ class ExistsThrowsExceptionFileSystem extends RawLocalFileSystem {
114113
throw new IllegalArgumentException("Exists shouldn't have been called!")
115114
}
116115

116+
/** Simply return an empty file for now. */
117117
override def listStatus(file: Path): Array[FileStatus] = {
118118
val emptyFile = new FileStatus()
119119
emptyFile.setPath(file)

0 commit comments

Comments
 (0)