From 8d3cdda9a22a23794c0cd12b15279a80a31952e3 Mon Sep 17 00:00:00 2001
From: Imran Rashid <imran@quantifind.com>
Date: Thu, 7 Nov 2013 01:35:48 -0600
Subject: [PATCH] very basic regression test to make sure appId doesnt get
 dropped in future

---
 .../deploy/worker/ExecutorRunnerTest.scala     | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 core/src/test/scala/org/apache/spark/deploy/worker/ExecutorRunnerTest.scala

diff --git a/core/src/test/scala/org/apache/spark/deploy/worker/ExecutorRunnerTest.scala b/core/src/test/scala/org/apache/spark/deploy/worker/ExecutorRunnerTest.scala
new file mode 100644
index 0000000000..a3111e26dd
--- /dev/null
+++ b/core/src/test/scala/org/apache/spark/deploy/worker/ExecutorRunnerTest.scala
@@ -0,0 +1,18 @@
+package org.apache.spark.deploy.worker
+
+import org.scalatest.FunSuite
+import org.apache.spark.deploy.{ExecutorState, Command, ApplicationDescription}
+import java.io.File
+
+class ExecutorRunnerTest extends FunSuite {
+
+  test("command includes appId") {
+    def f(s:String) = new File(s)
+    val sparkHome = sys.props("user.dir")
+    val appDesc = new ApplicationDescription("app name", 8, 500, Command("foo", Seq(),Map()), sparkHome, "appUiUrl")
+    val appId = "12345-worker321-9876"
+    val er = new ExecutorRunner(appId, 1, appDesc, 8, 500, null, "blah", "worker321", f(sparkHome), f("ooga"), ExecutorState.RUNNING)
+
+    assert(er.buildCommandSeq().last === appId)
+  }
+}
-- 
GitLab