diff --git a/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala b/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala index 3988a3fd36b34..00f9b382dd857 100644 --- a/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala @@ -105,7 +105,7 @@ class HistoryServerSuite extends FunSuite with BeforeAndAfter with Matchers with // TODO multi-attempt stages ) - //run a bunch of characterization tests -- just verify the behavior is the same as what is saved + // run a bunch of characterization tests -- just verify the behavior is the same as what is saved // in the test resource folder cases.foreach { case (name, path) => test(name) { @@ -114,8 +114,9 @@ class HistoryServerSuite extends FunSuite with BeforeAndAfter with Matchers with jsonOpt should be ('defined) errOpt should be (None) val json = jsonOpt.get - val exp = IOUtils.toString(new FileInputStream(new File(expRoot, path + "/json_expectation"))) - //compare the ASTs so formatting differences don't cause failures + val exp = IOUtils.toString(new FileInputStream( + new File(expRoot, path + "/json_expectation"))) + // compare the ASTs so formatting differences don't cause failures import org.json4s._ import org.json4s.jackson.JsonMethods._ val jsonAst = parse(json) @@ -261,9 +262,12 @@ object HistoryServerSuite { def getUrl(path: URL): String = { val (code, resultOpt, error) = getContentAndCode(path) - if (code == 200) + if (code == 200) { resultOpt.get - else throw new RuntimeException("got code: " + code + " when getting " + path + " w/ error: " + error) + } else { + throw new RuntimeException( + "got code: " + code + " when getting " + path + " w/ error: " + error) + } } } diff --git a/core/src/test/scala/org/apache/spark/status/api/v1/SimpleDateParamTest.scala b/core/src/test/scala/org/apache/spark/status/api/v1/SimpleDateParamTest.scala index be19d39edf6c4..5274df904d395 100644 --- a/core/src/test/scala/org/apache/spark/status/api/v1/SimpleDateParamTest.scala +++ b/core/src/test/scala/org/apache/spark/status/api/v1/SimpleDateParamTest.scala @@ -21,9 +21,9 @@ import org.scalatest.{Matchers, FunSuite} class SimpleDateParamTest extends FunSuite with Matchers { test("date parsing") { - new SimpleDateParam("2015-02-20T23:21:17.190GMT").timestamp should be (1424474477190l) - new SimpleDateParam("2015-02-20T17:21:17.190CST").timestamp should be (1424474477190l) - new SimpleDateParam("2015-02-20").timestamp should be (1424390400000L) //GMT + new SimpleDateParam("2015-02-20T23:21:17.190GMT").timestamp should be (1424474477190L) + new SimpleDateParam("2015-02-20T17:21:17.190CST").timestamp should be (1424474477190L) + new SimpleDateParam("2015-02-20").timestamp should be (1424390400000L) // GMT } } diff --git a/core/src/test/scala/org/apache/spark/ui/UISeleniumSuite.scala b/core/src/test/scala/org/apache/spark/ui/UISeleniumSuite.scala index cdd0b2898fe3b..f738bc15078ca 100644 --- a/core/src/test/scala/org/apache/spark/ui/UISeleniumSuite.scala +++ b/core/src/test/scala/org/apache/spark/ui/UISeleniumSuite.scala @@ -111,9 +111,11 @@ class UISeleniumSuite extends FunSuite with WebBrowser with Matchers with Before val updatedStorageJson = getJson(ui, "storage/rdd") updatedStorageJson.children.length should be (1) - (updatedStorageJson \ "storageLevel").extract[String] should be (StorageLevels.MEMORY_ONLY.description) + (updatedStorageJson \ "storageLevel").extract[String] should be ( + StorageLevels.MEMORY_ONLY.description) val updatedRddJson = getJson(ui, "storage/rdd/0") - (updatedRddJson \ "storageLevel").extract[String] should be (StorageLevels.MEMORY_ONLY.description) + (updatedRddJson \ "storageLevel").extract[String] should be ( + StorageLevels.MEMORY_ONLY.description) } } @@ -431,7 +433,7 @@ class UISeleniumSuite extends FunSuite with WebBrowser with Matchers with Before assert(sc.ui.isDefined) withSpark(sc) { sc => - //run a few jobs & stages ... + // run a few jobs & stages ... (0 until 5).foreach { idx => // NOTE: if we reverse the order, things don't really behave nicely // we lose the stage for a job we keep, and then the job doesn't know @@ -544,7 +546,8 @@ class UISeleniumSuite extends FunSuite with WebBrowser with Matchers with Before test("live UI json application list") { withSpark(newSparkContext()) { sc => - val appListRawJson = HistoryServerSuite.getUrl(new URL(sc.ui.get.appUIAddress + "/json/v1/applications")) + val appListRawJson = HistoryServerSuite.getUrl(new URL( + sc.ui.get.appUIAddress + "/json/v1/applications")) val appListJsonAst = JsonMethods.parse(appListRawJson) appListJsonAst.children.length should be (1) (appListJsonAst \ "completed").extract[Boolean] should be (false)