Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9E7D3200B50 for ; Fri, 29 Jul 2016 19:02:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9D5B9160ACD; Fri, 29 Jul 2016 17:02:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AA9BA160AAE for ; Fri, 29 Jul 2016 19:02:44 +0200 (CEST) Received: (qmail 73578 invoked by uid 500); 29 Jul 2016 17:02:43 -0000 Mailing-List: contact commits-help@bigtop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: bigtop-dev@bigtop.apache.org Delivered-To: mailing list commits@bigtop.apache.org Received: (qmail 72912 invoked by uid 99); 29 Jul 2016 17:02:43 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2016 17:02:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 03C15ED495; Fri, 29 Jul 2016 17:02:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: oflebbe@apache.org To: commits@bigtop.apache.org Date: Fri, 29 Jul 2016 17:02:49 -0000 Message-Id: <5fa2006654e149a180e6120bca37f6db@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [08/51] [abbrv] bigtop git commit: BIGTOP-2434. Change Spark test to unpack jar file and retrieve resources archived-at: Fri, 29 Jul 2016 17:02:45 -0000 BIGTOP-2434. Change Spark test to unpack jar file and retrieve resources Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/5e4bf8e2 Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/5e4bf8e2 Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/5e4bf8e2 Branch: refs/heads/BIGTOP-2253 Commit: 5e4bf8e23f4f220fe7247df9ee4126fa72bb0557 Parents: d00485a Author: Dasha Boudnik Authored: Sun May 22 12:49:05 2016 -0700 Committer: Dasha Boudnik Committed: Sun May 22 12:49:05 2016 -0700 ---------------------------------------------------------------------- bigtop-tests/smoke-tests/spark/TestSpark.groovy | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/5e4bf8e2/bigtop-tests/smoke-tests/spark/TestSpark.groovy ---------------------------------------------------------------------- diff --git a/bigtop-tests/smoke-tests/spark/TestSpark.groovy b/bigtop-tests/smoke-tests/spark/TestSpark.groovy index b8bd26a..4a715b3 100644 --- a/bigtop-tests/smoke-tests/spark/TestSpark.groovy +++ b/bigtop-tests/smoke-tests/spark/TestSpark.groovy @@ -20,6 +20,10 @@ package org.apache.bigtop.itest.spark import org.junit.BeforeClass import org.junit.AfterClass + +import java.util.jar.JarFile +import java.util.zip.ZipInputStream + import static org.junit.Assert.assertNotNull import org.apache.bigtop.itest.shell.Shell import static org.junit.Assert.assertTrue @@ -42,7 +46,16 @@ class TestSpark { @BeforeClass static void setUp() { sh.exec("rm -f " + TEST_SPARKSQL_LOG) - sh.exec("hdfs dfs -put " + SPARK_HOME + "/examples examples") + // create HDFS examples/src/main/resources + sh.exec("hdfs dfs -mkdir -p examples/src/main/resources") + // extract people.txt file into it + String examplesJar = JarContent.getJarName("$SPARK_HOME/lib", 'spark-examples.*jar') + assertNotNull(examplesJar, "spark-examples.jar file wasn't found") + ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream("$SPARK_HOME/lib/$examplesJar")) + File examplesDir = new File('examples') + examplesDir.mkdirs() + zipInputStream.unzip(examplesDir.getName(), 'people') + sh.exec("hdfs dfs -put examples/* examples/src/main/resources") logError(sh) }