Skip to content

Commit

Permalink
For Scala 2.11 we can't have two methods of same name with default pa…
Browse files Browse the repository at this point in the history
…rams, adds wrappers and remove the default params
  • Loading branch information
holdenk committed Mar 24, 2016
1 parent a69a5ad commit 210aa04
Showing 1 changed file with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,24 @@ trait StreamingSuiteBase extends FunSuite with BeforeAndAfterAll with Logging
assert(output(i) === expected(i))
}

// Wrappers with ordered = false
def testOperation[U: ClassTag, V: ClassTag](
input: Seq[Seq[U]],
operation: DStream[U] => DStream[V],
expectedOutput: Seq[Seq[V]]
) (implicit equality: Equality[V]): Unit = {
testOperation(input, operation, expectedOutput, false)
}

def testOperation[U: ClassTag, V: ClassTag, W: ClassTag](
input1: Seq[Seq[U]],
input2: Seq[Seq[V]],
operation: (DStream[U], DStream[V]) => DStream[W],
expectedOutput: Seq[Seq[W]]
) (implicit equality: Equality[W]): Unit = {
testOperation(input1, input2, operation, expectedOutput, false)
}

/**
* Test unary DStream operation with a list of inputs, with number of
* batches to run same as the number of input values.
Expand All @@ -122,7 +140,7 @@ trait StreamingSuiteBase extends FunSuite with BeforeAndAfterAll with Logging
input: Seq[Seq[U]],
operation: DStream[U] => DStream[V],
expectedOutput: Seq[Seq[V]],
ordered: Boolean = false
ordered: Boolean
) (implicit equality: Equality[V]): Unit = {
val numBatches = input.size

Expand Down Expand Up @@ -150,7 +168,7 @@ trait StreamingSuiteBase extends FunSuite with BeforeAndAfterAll with Logging
input2: Seq[Seq[V]],
operation: (DStream[U], DStream[V]) => DStream[W],
expectedOutput: Seq[Seq[W]],
ordered: Boolean = false
ordered: Boolean
) (implicit equality: Equality[W]): Unit = {
assert(input1.length === input2.length, "Length of the input lists are not equal")

Expand Down

0 comments on commit 210aa04

Please sign in to comment.