Skip to content

Commit cf86175

Browse files
committed
style
1 parent d493b38 commit cf86175

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class HistoryServerSuite extends FunSuite with BeforeAndAfter with Matchers with
105105
// TODO multi-attempt stages
106106
)
107107

108-
//run a bunch of characterization tests -- just verify the behavior is the same as what is saved
108+
// run a bunch of characterization tests -- just verify the behavior is the same as what is saved
109109
// in the test resource folder
110110
cases.foreach { case (name, path) =>
111111
test(name) {
@@ -114,8 +114,9 @@ class HistoryServerSuite extends FunSuite with BeforeAndAfter with Matchers with
114114
jsonOpt should be ('defined)
115115
errOpt should be (None)
116116
val json = jsonOpt.get
117-
val exp = IOUtils.toString(new FileInputStream(new File(expRoot, path + "/json_expectation")))
118-
//compare the ASTs so formatting differences don't cause failures
117+
val exp = IOUtils.toString(new FileInputStream(
118+
new File(expRoot, path + "/json_expectation")))
119+
// compare the ASTs so formatting differences don't cause failures
119120
import org.json4s._
120121
import org.json4s.jackson.JsonMethods._
121122
val jsonAst = parse(json)
@@ -261,9 +262,12 @@ object HistoryServerSuite {
261262

262263
def getUrl(path: URL): String = {
263264
val (code, resultOpt, error) = getContentAndCode(path)
264-
if (code == 200)
265+
if (code == 200) {
265266
resultOpt.get
266-
else throw new RuntimeException("got code: " + code + " when getting " + path + " w/ error: " + error)
267+
} else {
268+
throw new RuntimeException(
269+
"got code: " + code + " when getting " + path + " w/ error: " + error)
270+
}
267271
}
268272

269273
}

core/src/test/scala/org/apache/spark/status/api/v1/SimpleDateParamTest.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import org.scalatest.{Matchers, FunSuite}
2121
class SimpleDateParamTest extends FunSuite with Matchers {
2222

2323
test("date parsing") {
24-
new SimpleDateParam("2015-02-20T23:21:17.190GMT").timestamp should be (1424474477190l)
25-
new SimpleDateParam("2015-02-20T17:21:17.190CST").timestamp should be (1424474477190l)
26-
new SimpleDateParam("2015-02-20").timestamp should be (1424390400000L) //GMT
24+
new SimpleDateParam("2015-02-20T23:21:17.190GMT").timestamp should be (1424474477190L)
25+
new SimpleDateParam("2015-02-20T17:21:17.190CST").timestamp should be (1424474477190L)
26+
new SimpleDateParam("2015-02-20").timestamp should be (1424390400000L) // GMT
2727
}
2828

2929
}

core/src/test/scala/org/apache/spark/ui/UISeleniumSuite.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,11 @@ class UISeleniumSuite extends FunSuite with WebBrowser with Matchers with Before
111111

112112
val updatedStorageJson = getJson(ui, "storage/rdd")
113113
updatedStorageJson.children.length should be (1)
114-
(updatedStorageJson \ "storageLevel").extract[String] should be (StorageLevels.MEMORY_ONLY.description)
114+
(updatedStorageJson \ "storageLevel").extract[String] should be (
115+
StorageLevels.MEMORY_ONLY.description)
115116
val updatedRddJson = getJson(ui, "storage/rdd/0")
116-
(updatedRddJson \ "storageLevel").extract[String] should be (StorageLevels.MEMORY_ONLY.description)
117+
(updatedRddJson \ "storageLevel").extract[String] should be (
118+
StorageLevels.MEMORY_ONLY.description)
117119
}
118120
}
119121

@@ -431,7 +433,7 @@ class UISeleniumSuite extends FunSuite with WebBrowser with Matchers with Before
431433
assert(sc.ui.isDefined)
432434

433435
withSpark(sc) { sc =>
434-
//run a few jobs & stages ...
436+
// run a few jobs & stages ...
435437
(0 until 5).foreach { idx =>
436438
// NOTE: if we reverse the order, things don't really behave nicely
437439
// 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
544546

545547
test("live UI json application list") {
546548
withSpark(newSparkContext()) { sc =>
547-
val appListRawJson = HistoryServerSuite.getUrl(new URL(sc.ui.get.appUIAddress + "/json/v1/applications"))
549+
val appListRawJson = HistoryServerSuite.getUrl(new URL(
550+
sc.ui.get.appUIAddress + "/json/v1/applications"))
548551
val appListJsonAst = JsonMethods.parse(appListRawJson)
549552
appListJsonAst.children.length should be (1)
550553
(appListJsonAst \ "completed").extract[Boolean] should be (false)

0 commit comments

Comments
 (0)