Repository: spark Updated Branches: refs/heads/master 0c9a8eaed -> 975643c25
[SPARK-6118] making package name of deploy.worker.CommandUtils and deploy.CommandUtilsSuite consistent https://issues.apache.org/jira/browse/SPARK-6118 I found that the object CommandUtils is placed under deploy.worker package, while CommandUtilsSuite is under deploy Conventionally, we put the implementation and unit test class under the same package here, to minimize the change, I move CommandUtilsSuite to worker package, **However, CommandUtils seems to contain some general methods (though only used by worker.* classes currently**, we may also consider to replace CommonUtils Author: CodingCat <zhunans...@gmail.com> Closes #4856 from CodingCat/SPARK-6118 and squashes the following commits: cb93700 [CodingCat] making package name consistent Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/975643c2 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/975643c2 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/975643c2 Branch: refs/heads/master Commit: 975643c256e548601bf9015c8840c947df5446bf Parents: 0c9a8ea Author: CodingCat <zhunans...@gmail.com> Authored: Tue Mar 3 10:32:57 2015 +0000 Committer: Sean Owen <so...@cloudera.com> Committed: Tue Mar 3 10:32:57 2015 +0000 ---------------------------------------------------------------------- .../apache/spark/deploy/CommandUtilsSuite.scala | 37 -------------------- .../spark/deploy/worker/CommandUtilsSuite.scala | 36 +++++++++++++++++++ 2 files changed, 36 insertions(+), 37 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/975643c2/core/src/test/scala/org/apache/spark/deploy/CommandUtilsSuite.scala ---------------------------------------------------------------------- diff --git a/core/src/test/scala/org/apache/spark/deploy/CommandUtilsSuite.scala b/core/src/test/scala/org/apache/spark/deploy/CommandUtilsSuite.scala deleted file mode 100644 index 7915ee7..0000000 --- a/core/src/test/scala/org/apache/spark/deploy/CommandUtilsSuite.scala +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.deploy - -import org.apache.spark.deploy.worker.CommandUtils -import org.apache.spark.util.Utils - -import org.scalatest.{FunSuite, Matchers} - -class CommandUtilsSuite extends FunSuite with Matchers { - - test("set libraryPath correctly") { - val appId = "12345-worker321-9876" - val sparkHome = sys.props.getOrElse("spark.test.home", fail("spark.test.home is not set!")) - val cmd = new Command("mainClass", Seq(), Map(), Seq(), Seq("libraryPathToB"), Seq()) - val builder = CommandUtils.buildProcessBuilder(cmd, 512, sparkHome, t => t) - val libraryPath = Utils.libraryPathEnvName - val env = builder.environment - env.keySet should contain(libraryPath) - assert(env.get(libraryPath).startsWith("libraryPathToB")) - } -} http://git-wip-us.apache.org/repos/asf/spark/blob/975643c2/core/src/test/scala/org/apache/spark/deploy/worker/CommandUtilsSuite.scala ---------------------------------------------------------------------- diff --git a/core/src/test/scala/org/apache/spark/deploy/worker/CommandUtilsSuite.scala b/core/src/test/scala/org/apache/spark/deploy/worker/CommandUtilsSuite.scala new file mode 100644 index 0000000..1c27d83 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/deploy/worker/CommandUtilsSuite.scala @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.deploy.worker + +import org.apache.spark.deploy.Command +import org.apache.spark.util.Utils +import org.scalatest.{FunSuite, Matchers} + +class CommandUtilsSuite extends FunSuite with Matchers { + + test("set libraryPath correctly") { + val appId = "12345-worker321-9876" + val sparkHome = sys.props.getOrElse("spark.test.home", fail("spark.test.home is not set!")) + val cmd = new Command("mainClass", Seq(), Map(), Seq(), Seq("libraryPathToB"), Seq()) + val builder = CommandUtils.buildProcessBuilder(cmd, 512, sparkHome, t => t) + val libraryPath = Utils.libraryPathEnvName + val env = builder.environment + env.keySet should contain(libraryPath) + assert(env.get(libraryPath).startsWith("libraryPathToB")) + } +} --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org