@@ -32,7 +32,7 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration
3232import org .mockito .Matchers ._
3333import org .mockito .Mockito ._
3434import org .scalatest .FunSuite
35- import org .scalatest .matchers . ShouldMatchers . _
35+ import org .scalatest .Matchers
3636
3737import scala .collection .JavaConversions ._
3838import scala .collection .mutable .{ HashMap => MutableHashMap }
@@ -41,7 +41,7 @@ import scala.util.Try
4141import org .apache .spark .SparkConf
4242import org .apache .spark .util .Utils
4343
44- class ClientBaseSuite extends FunSuite {
44+ class ClientBaseSuite extends FunSuite with Matchers {
4545
4646 test(" default Yarn application classpath" ) {
4747 ClientBase .getDefaultYarnApplicationClasspath should be(Some (Fixtures .knownDefYarnAppCP))
@@ -89,17 +89,19 @@ class ClientBaseSuite extends FunSuite {
8989
9090 ClientBase .populateClasspath(args, conf, sparkConf, env, None )
9191
92- val jars = env(" CLASSPATH" ).split(File .pathSeparator)
93- s " $SPARK, $USER, $ADDED" .split(" ," ).foreach({ jar =>
94- val uri = new URI (jar )
92+ val cp = env(" CLASSPATH" ).split(File .pathSeparator)
93+ s " $SPARK, $USER, $ADDED" .split(" ," ).foreach({ entry =>
94+ val uri = new URI (entry )
9595 if (ClientBase .LOCAL_SCHEME .equals(uri.getScheme())) {
96- jars should contain (uri.getPath())
96+ cp should contain (uri.getPath())
9797 } else {
98- jars should not contain (uri.getPath())
98+ cp should not contain (uri.getPath())
9999 }
100100 })
101- jars should not contain (ClientBase .SPARK_JAR )
102- jars should not contain (ClientBase .APP_JAR )
101+ cp should contain (s " $$ PWD " )
102+ cp should contain (s " $$ PWD ${File .separator}* " )
103+ cp should not contain (ClientBase .SPARK_JAR )
104+ cp should not contain (ClientBase .APP_JAR )
103105 }
104106
105107 test(" Jar path propagation through SparkConf" ) {
0 commit comments