@@ -29,6 +29,7 @@ import org.easymock.{Capture, EasyMock}
2929import java .nio .ByteBuffer
3030import java .util .Collections
3131import java .util
32+ import scala .collection .mutable
3233
3334class MesosSchedulerBackendSuite extends FunSuite with LocalSparkContext with EasyMockSugar {
3435 test(" mesos resource offer is launching tasks" ) {
@@ -52,10 +53,12 @@ class MesosSchedulerBackendSuite extends FunSuite with LocalSparkContext with Ea
5253 offers.add(createOffer(1 , 101 , 1 ))
5354 offers.add(createOffer(1 , 99 , 1 ))
5455
55- val conf = new SparkConf
56- conf.set(" spark.executor.memory" , " 100m" )
57- conf.set(" spark.home" , " /path" )
58- val sc = new SparkContext (" local-cluster[2 , 1 , 512]" , " test" , conf)
56+ val sc = EasyMock .createMock(classOf [SparkContext ])
57+ EasyMock .expect(sc.executorMemory).andReturn(100 ).anyTimes()
58+ EasyMock .expect(sc.getSparkHome()).andReturn(Option (" /path" )).anyTimes()
59+ EasyMock .expect(sc.executorEnvs).andReturn(new mutable.HashMap ).anyTimes()
60+ EasyMock .expect(sc.conf).andReturn(new SparkConf ).anyTimes()
61+ EasyMock .replay(sc)
5962 val backend = new MesosSchedulerBackend (taskScheduler, sc, " master" )
6063 val workerOffers = Seq (backend.toWorkerOffer(offers.get(0 )))
6164 val taskDesc = new TaskDescription (1L , " s1" , " n1" , 0 , ByteBuffer .wrap(new Array [Byte ](0 )))
0 commit comments