1
1
package spark .jobserver
2
2
3
- import java . nio . file . Paths
3
+ import scala . collection . mutable
4
4
5
5
import com .typesafe .config .ConfigFactory
6
6
import spark .jobserver .JobManagerActor .KillJob
7
- import scala .collection .mutable
8
- import spark .jobserver .io .JobDAO
9
7
10
8
object JobManagerSpec extends JobSpecConfig
11
9
12
10
abstract class JobManagerSpec extends JobSpecBase (JobManagerSpec .getNewSystem) {
13
11
import scala .concurrent .duration ._
12
+
14
13
import CommonMessages ._
15
14
import JobManagerSpec .MaxJobsPerContext
16
15
import akka .testkit ._
@@ -95,7 +94,7 @@ abstract class JobManagerSpec extends JobSpecBase(JobManagerSpec.getNewSystem) {
95
94
uploadTestJar()
96
95
manager ! JobManagerActor .StartJob (" demo" , wordCountClass, stringConfig, syncEvents ++ errorEvents)
97
96
expectMsgPF(startJobWait, " Did not get JobResult" ) {
98
- case JobResult (_, result : Map [ String , Int ] ) => println(" I got results! " + result)
97
+ case JobResult (_, result) => println(" I got results! " + result)
99
98
}
100
99
expectNoMsg()
101
100
}
@@ -129,7 +128,7 @@ abstract class JobManagerSpec extends JobSpecBase(JobManagerSpec.getNewSystem) {
129
128
manager ! JobManagerActor .StartJob (" demo" , classPrefix + " ConfigCheckerJob" , jobConfig,
130
129
syncEvents ++ errorEvents)
131
130
expectMsgPF(startJobWait, " Did not get JobResult" ) {
132
- case JobResult (_, keys : Seq [String ]) =>
131
+ case JobResult (_, keys : Seq [_ ]) =>
133
132
keys should contain (" foo" )
134
133
}
135
134
}
@@ -203,10 +202,10 @@ abstract class JobManagerSpec extends JobSpecBase(JobManagerSpec.getNewSystem) {
203
202
uploadTestJar()
204
203
manager ! JobManagerActor .StartJob (" demo" , classPrefix + " LongPiJob" , stringConfig, allEvents)
205
204
expectMsgPF(5 .seconds.dilated, " Did not get JobResult" ) {
206
- case JobStarted (id, _, _) => {
205
+ case JobStarted (id, _, _) =>
207
206
manager ! KillJob (id)
208
207
expectMsgClass(classOf [JobKilled ])
209
- }
208
+
210
209
}
211
210
}
212
211
@@ -219,12 +218,13 @@ abstract class JobManagerSpec extends JobSpecBase(JobManagerSpec.getNewSystem) {
219
218
val jobJarDepsConfigs = ConfigFactory .parseString(
220
219
s """
221
220
|dependent-jar-uris = ["file:// $getExtrasJarPath"]
222
- """ .stripMargin)
221
+ """ .stripMargin
222
+ )
223
223
224
224
manager ! JobManagerActor .StartJob (" demo" , classPrefix + " jobJarDependenciesJob" , jobJarDepsConfigs,
225
225
syncEvents ++ errorEvents)
226
226
expectMsgPF(startJobWait, " Did not get JobResult" ) {
227
- case JobResult (_, result : Map [ String , Long ] ) => println(" I got results! " + result)
227
+ case JobResult (_, result) => println(" I got results! " + result)
228
228
}
229
229
expectNoMsg()
230
230
}
0 commit comments