Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2F734C2EB for ; Tue, 29 May 2012 05:19:59 +0000 (UTC) Received: (qmail 44131 invoked by uid 500); 29 May 2012 05:19:59 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 43932 invoked by uid 500); 29 May 2012 05:19:57 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 43893 invoked by uid 99); 29 May 2012 05:19:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 May 2012 05:19:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 May 2012 05:19:53 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9DC68238896F; Tue, 29 May 2012 05:19:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1343542 - /camel/trunk/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/CamelHBaseTestSupport.java Date: Tue, 29 May 2012 05:19:27 -0000 To: commits@camel.apache.org From: iocanel@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120529051927.9DC68238896F@eris.apache.org> Author: iocanel Date: Tue May 29 05:19:27 2012 New Revision: 1343542 URL: http://svn.apache.org/viewvc?rev=1343542&view=rev Log: [CAMEL-4743] Removed umask checking before using the hbase testing utility. Now catching the exception instead. Modified: camel/trunk/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/CamelHBaseTestSupport.java Modified: camel/trunk/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/CamelHBaseTestSupport.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/CamelHBaseTestSupport.java?rev=1343542&r1=1343541&r2=1343542&view=diff ============================================================================== --- camel/trunk/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/CamelHBaseTestSupport.java (original) +++ camel/trunk/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/CamelHBaseTestSupport.java Tue May 29 05:19:27 2012 @@ -17,15 +17,10 @@ package org.apache.camel.component.hbase; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; import org.apache.camel.CamelContext; import org.apache.camel.impl.DefaultCamelContext; import org.apache.camel.test.junit4.CamelTestSupport; import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.client.HTablePool; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -33,19 +28,20 @@ public abstract class CamelHBaseTestSupp protected static HBaseTestingUtility hbaseUtil = new HBaseTestingUtility(); protected static int numServers = 1; - protected static final String REQUIREDUMASK = "0022"; protected static final String DEFAULTTABLE = "DEFAULTTABLE"; protected static final String DEFAULTFAMILY = "DEFAULTFAMILY"; - protected static String actualMask = "0022"; + //The hbase testing utility has special requirements on the umask. + //We hold this value to check if the the minicluster has properly started and tests can be run. protected static Boolean systemReady = true; @BeforeClass public static void setUpClass() throws Exception { - systemReady = checkUmask(); - if (systemReady) { + try { hbaseUtil.startMiniCluster(numServers); + } catch (Exception e) { + systemReady = false; } } @@ -56,24 +52,6 @@ public abstract class CamelHBaseTestSupp } } - - protected static boolean checkUmask() throws IOException { - String operatingSystem = System.getProperty("os.name"); - if (!operatingSystem.startsWith("Win")) { - Process p = Runtime.getRuntime().exec("umask"); - InputStream is = p.getInputStream(); - BufferedReader reader = new BufferedReader(new InputStreamReader(is)); - StringBuilder sb = new StringBuilder(); - String line; - while ((line = reader.readLine()) != null) { - sb.append(line); - } - actualMask = sb.toString().trim(); - return REQUIREDUMASK.equals(actualMask); - } - return false; - } - @Override public CamelContext createCamelContext() throws Exception { CamelContext context = new DefaultCamelContext(createRegistry());