You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lens.apache.org by pr...@apache.org on 2015/08/11 14:21:12 UTC

[49/50] [abbrv] incubator-lens git commit: LENS-721 : All tests should use project workspace for test data

LENS-721 : All tests should use project workspace for test data


Project: http://git-wip-us.apache.org/repos/asf/incubator-lens/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-lens/commit/55f03d38
Tree: http://git-wip-us.apache.org/repos/asf/incubator-lens/tree/55f03d38
Diff: http://git-wip-us.apache.org/repos/asf/incubator-lens/diff/55f03d38

Branch: refs/heads/current-release-line
Commit: 55f03d38bcb2f3532b285746f9b7f7fb9d85b51b
Parents: bab05e4
Author: Rajat Khandelwal <pr...@apache.org>
Authored: Tue Aug 11 17:11:11 2015 +0530
Committer: Amareshwari Sriramadasu <am...@apache.org>
Committed: Tue Aug 11 17:11:11 2015 +0530

----------------------------------------------------------------------
 .../lens/cli/TestLensConnectionCliCommands.java | 12 ++---
 .../apache/lens/cli/TestLensCubeCommands.java   |  4 +-
 .../lens/cli/TestLensDimensionCommands.java     |  4 +-
 .../cli/TestLensDimensionTableCommands.java     |  6 +--
 .../apache/lens/cli/TestLensFactCommands.java   |  6 +--
 .../TestLensFactCommandsWithMissingWeight.java  |  2 +-
 .../lens/cli/TestLensStorageCommands.java       |  4 +-
 .../resources/dim-local-storage-element.xml     |  6 +--
 lens-cli/src/test/resources/dim1-local-part.xml |  7 +--
 .../src/test/resources/dim1-local-parts.xml     |  3 +-
 lens-cli/src/test/resources/dim_table.xml       | 15 +++---
 lens-cli/src/test/resources/dim_table2.xml      | 13 ++---
 .../resources/fact-local-storage-element.xml    |  4 +-
 .../src/test/resources/fact1-local-part.xml     |  5 +-
 .../src/test/resources/fact1-local-parts.xml    |  3 +-
 lens-cli/src/test/resources/fact1.xml           | 17 +++---
 .../src/test/resources/fact_without_weight.xml  | 57 ++++++++++----------
 .../lens/cube/parse/TestCubeRewriter.java       | 12 ++---
 lens-cube/src/test/resources/hive-site.xml      |  4 +-
 .../src/test/resources/hive-site.xml            |  2 +-
 .../src/test/resources/hivedriver-site.xml      |  2 +-
 .../src/test/resources/hive-site.xml            |  2 +-
 .../org/apache/lens/ml/impl/ModelLoader.java    |  7 +--
 .../lib/query/TestFilePersistentFormatter.java  |  4 +-
 lens-server/pom.xml                             |  2 +
 .../server/metastore/TestMetastoreService.java  |  6 ++-
 .../lens/server/rewrite/TestRewriting.java      | 10 ++--
 .../stats/TestStatisticsLogFileScannerTask.java |  4 +-
 .../TestStatisticsLogPartitionHandler.java      | 15 +++---
 lens-server/src/test/resources/hive-site.xml    |  2 +-
 .../src/test/resources/hivedriver-site.xml      |  2 +-
 lens-server/src/test/resources/lens-site.xml    |  7 ++-
 .../src/test/resources/hive-site.xml            |  2 +-
 pom.xml                                         |  7 ++-
 34 files changed, 139 insertions(+), 119 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/java/org/apache/lens/cli/TestLensConnectionCliCommands.java
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/java/org/apache/lens/cli/TestLensConnectionCliCommands.java b/lens-cli/src/test/java/org/apache/lens/cli/TestLensConnectionCliCommands.java
index ae04b3f..558e97f 100644
--- a/lens-cli/src/test/java/org/apache/lens/cli/TestLensConnectionCliCommands.java
+++ b/lens-cli/src/test/java/org/apache/lens/cli/TestLensConnectionCliCommands.java
@@ -140,7 +140,7 @@ public class TestLensConnectionCliCommands extends LensCliApplicationTest {
 
     File f = null;
     try {
-      String filename = "/tmp/data";
+      String filename = "target/data";
       f = createNewPath(filename);
 
       String result = commands.addFile(filename);
@@ -208,7 +208,7 @@ public class TestLensConnectionCliCommands extends LensCliApplicationTest {
 
     File jar = null;
     try {
-      String filename = "/tmp/data.jar";
+      String filename = "target/data.jar";
       jar = createNewPath(filename);
 
       String result = commands.addJar(filename);
@@ -288,21 +288,21 @@ public class TestLensConnectionCliCommands extends LensCliApplicationTest {
     File file = null;
     File jar = null;
     try {
-      String fileName = "/tmp/data.txt";
+      String fileName = "target/data.txt";
       file = createNewPath(fileName);
       commands.addFile(fileName);
 
-      String jarName = "/tmp/data.jar";
+      String jarName = "target/data.jar";
       jar = createNewPath(jarName);
       commands.addJar(jarName);
 
       String fileResourcesList = commands.listResources("file");
       Assert.assertEquals(fileResourcesList.split("\n").length, 1);
-      Assert.assertTrue(fileResourcesList.split("\n")[0].contains("/tmp/data.txt"));
+      Assert.assertTrue(fileResourcesList.split("\n")[0].contains("target/data.txt"));
 
       String jarResourcesList = commands.listResources("jar");
       Assert.assertEquals(jarResourcesList.split("\n").length, 1);
-      Assert.assertTrue(jarResourcesList.split("\n")[0].contains("/tmp/data.jar"));
+      Assert.assertTrue(jarResourcesList.split("\n")[0].contains("target/data.jar"));
 
       String allResources = commands.listResources(null);
       Assert.assertEquals(allResources.split("\n").length, 2);

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/java/org/apache/lens/cli/TestLensCubeCommands.java
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/java/org/apache/lens/cli/TestLensCubeCommands.java b/lens-cli/src/test/java/org/apache/lens/cli/TestLensCubeCommands.java
index 8de61e6..39441c9 100644
--- a/lens-cli/src/test/java/org/apache/lens/cli/TestLensCubeCommands.java
+++ b/lens-cli/src/test/java/org/apache/lens/cli/TestLensCubeCommands.java
@@ -159,7 +159,7 @@ public class TestLensCubeCommands extends LensCliApplicationTest {
       "<property name=\"sample_cube.prop\" value=\"sample\" />"
         + "\n<property name=\"sample_cube.prop1\" value=\"sample1\" />\n");
 
-    File newFile = new File("/tmp/sample_cube1.xml");
+    File newFile = new File("target/sample_cube1.xml");
     try {
       Writer writer = new OutputStreamWriter(new FileOutputStream(newFile));
       writer.write(xmlContent);
@@ -173,7 +173,7 @@ public class TestLensCubeCommands extends LensCliApplicationTest {
 
       assertTrue(desc.contains(propString));
 
-      command.updateCube("sample_cube", new File("/tmp/sample_cube1.xml"));
+      command.updateCube("sample_cube", new File("target/sample_cube1.xml"));
       desc = command.describeCube("sample_cube");
       LOG.debug(desc);
       assertTrue(desc.contains(propString));

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/java/org/apache/lens/cli/TestLensDimensionCommands.java
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/java/org/apache/lens/cli/TestLensDimensionCommands.java b/lens-cli/src/test/java/org/apache/lens/cli/TestLensDimensionCommands.java
index fa96fcc..3a7c29a 100644
--- a/lens-cli/src/test/java/org/apache/lens/cli/TestLensDimensionCommands.java
+++ b/lens-cli/src/test/java/org/apache/lens/cli/TestLensDimensionCommands.java
@@ -126,7 +126,7 @@ public class TestLensDimensionCommands extends LensCliApplicationTest {
         "<property name=\"test_dim.prop\" value=\"test\" />"
           + "\n<property name=\"test_dim.prop1\" value=\"test1\" />\n");
 
-      File newFile = new File("/tmp/test_dim1.xml");
+      File newFile = new File("target/test_dim1.xml");
       Writer writer = new OutputStreamWriter(new FileOutputStream(newFile));
       writer.write(xmlContent);
       writer.close();
@@ -137,7 +137,7 @@ public class TestLensDimensionCommands extends LensCliApplicationTest {
       String propString1 = "name : test_dim.prop1  value : test1";
       Assert.assertTrue(desc.contains(propString));
 
-      command.updateDimension("test_dim", new File("/tmp/test_dim1.xml"));
+      command.updateDimension("test_dim", new File("target/test_dim1.xml"));
       desc = command.describeDimension("test_dim");
       log.debug(desc);
       Assert.assertTrue(desc.contains(propString));

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/java/org/apache/lens/cli/TestLensDimensionTableCommands.java
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/java/org/apache/lens/cli/TestLensDimensionTableCommands.java b/lens-cli/src/test/java/org/apache/lens/cli/TestLensDimensionTableCommands.java
index 60849aa..30f4ec1 100644
--- a/lens-cli/src/test/java/org/apache/lens/cli/TestLensDimensionTableCommands.java
+++ b/lens-cli/src/test/java/org/apache/lens/cli/TestLensDimensionTableCommands.java
@@ -155,10 +155,10 @@ public class TestLensDimensionTableCommands extends LensCliApplicationTest {
 
     String xmlContent = sb.toString();
 
-    xmlContent = xmlContent.replace("<property name=\"dim2.prop\" value=\"d2\" />",
+    xmlContent = xmlContent.replace("<property name=\"dim2.prop\" value=\"d2\"/>",
       "<property name=\"dim2.prop\" value=\"d1\"/>" + "\n<property name=\"dim2.prop1\" value=\"d2\"/>\n");
 
-    File newFile = new File("/tmp/local-dim1.xml");
+    File newFile = new File("target/local-dim1.xml");
     try {
       Writer writer = new OutputStreamWriter(new FileOutputStream(newFile));
       writer.write(xmlContent);
@@ -171,7 +171,7 @@ public class TestLensDimensionTableCommands extends LensCliApplicationTest {
       String propString2 = "name : dim2.prop1  value : d2";
       assertTrue(desc.contains(propString));
 
-      command.updateDimensionTable("dim_table2", new File("/tmp/local-dim1.xml"));
+      command.updateDimensionTable("dim_table2", new File("target/local-dim1.xml"));
       desc = command.describeDimensionTable("dim_table2");
       log.debug(desc);
       assertTrue(desc.contains(propString1));

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/java/org/apache/lens/cli/TestLensFactCommands.java
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/java/org/apache/lens/cli/TestLensFactCommands.java b/lens-cli/src/test/java/org/apache/lens/cli/TestLensFactCommands.java
index 0cbf7db..448d0f6 100644
--- a/lens-cli/src/test/java/org/apache/lens/cli/TestLensFactCommands.java
+++ b/lens-cli/src/test/java/org/apache/lens/cli/TestLensFactCommands.java
@@ -148,10 +148,10 @@ public class TestLensFactCommands extends LensCliApplicationTest {
 
       String xmlContent = sb.toString();
 
-      xmlContent = xmlContent.replace("<property name=\"fact1.prop\" value=\"f1\" />\n",
+      xmlContent = xmlContent.replace("<property name=\"fact1.prop\" value=\"f1\"/>\n",
         "<property name=\"fact1.prop\" value=\"f1\"/>" + "\n<property name=\"fact1.prop1\" value=\"f2\"/>\n");
 
-      File newFile = new File("/tmp/local-fact1.xml");
+      File newFile = new File("target/local-fact1.xml");
       Writer writer = new OutputStreamWriter(new FileOutputStream(newFile));
       writer.write(xmlContent);
       writer.close();
@@ -163,7 +163,7 @@ public class TestLensFactCommands extends LensCliApplicationTest {
 
       assertTrue(desc.contains(propString));
 
-      command.updateFactTable("fact1", new File("/tmp/local-fact1.xml"));
+      command.updateFactTable("fact1", new File("target/local-fact1.xml"));
       desc = command.describeFactTable("fact1");
       log.debug(desc);
       assertTrue(desc.contains(propString), "The sample property value is not set");

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/java/org/apache/lens/cli/TestLensFactCommandsWithMissingWeight.java
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/java/org/apache/lens/cli/TestLensFactCommandsWithMissingWeight.java b/lens-cli/src/test/java/org/apache/lens/cli/TestLensFactCommandsWithMissingWeight.java
index 6fe2f09..9fce233 100644
--- a/lens-cli/src/test/java/org/apache/lens/cli/TestLensFactCommandsWithMissingWeight.java
+++ b/lens-cli/src/test/java/org/apache/lens/cli/TestLensFactCommandsWithMissingWeight.java
@@ -117,7 +117,7 @@ public class TestLensFactCommandsWithMissingWeight extends LensCliApplicationTes
     LensFactCommands command = getCommand();
     String factList = command.showFacts(null);
     Assert.assertEquals(command.showFacts(CUBE_NAME), "No fact found for " + CUBE_NAME);
-    Assert.assertEquals("No fact found", factList, "Fact tables should not be found.");
+    Assert.assertEquals(factList, "No fact found", "Fact tables should not be found.");
     // add local storage before adding fact table
     TestLensStorageCommands.addLocalStorage(FACT_LOCAL);
     URL factSpec = TestLensFactCommandsWithMissingWeight.class.getClassLoader().getResource(FACT_XML_FILE);

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/java/org/apache/lens/cli/TestLensStorageCommands.java
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/java/org/apache/lens/cli/TestLensStorageCommands.java b/lens-cli/src/test/java/org/apache/lens/cli/TestLensStorageCommands.java
index 1284c99..8bccac2 100644
--- a/lens-cli/src/test/java/org/apache/lens/cli/TestLensStorageCommands.java
+++ b/lens-cli/src/test/java/org/apache/lens/cli/TestLensStorageCommands.java
@@ -85,7 +85,7 @@ public class TestLensStorageCommands extends LensCliApplicationTest {
   public static synchronized void addLocalStorage(String storageName) throws IOException {
     LensStorageCommands command = getCommand();
     URL storageSpec = TestLensStorageCommands.class.getClassLoader().getResource("local-storage.xml");
-    File newFile = new File("/tmp/local-" + storageName + ".xml");
+    File newFile = new File("target/local-" + storageName + ".xml");
     try {
       StringBuilder sb = new StringBuilder();
       BufferedReader bufferedReader = new BufferedReader(new FileReader(storageSpec.getFile()));
@@ -139,7 +139,7 @@ public class TestLensStorageCommands extends LensCliApplicationTest {
         "<property name=\"storage.url\" value=\"file:///\"/>"
             + "\n<property name=\"storage.prop1\" value=\"v1\" />\n");
 
-    String updateFilePath = "/tmp/" + storageName + ".xml";
+    String updateFilePath = "target/" + storageName + ".xml";
     File newFile = new File(updateFilePath);
     try {
       Writer writer = new OutputStreamWriter(new FileOutputStream(newFile));

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/resources/dim-local-storage-element.xml
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/resources/dim-local-storage-element.xml b/lens-cli/src/test/resources/dim-local-storage-element.xml
index 7a58aa3..6503261 100644
--- a/lens-cli/src/test/resources/dim-local-storage-element.xml
+++ b/lens-cli/src/test/resources/dim-local-storage-element.xml
@@ -25,9 +25,9 @@
     <update_period>DAILY</update_period>
   </update_periods>
   <storage_name>dim_local</storage_name>
-  <table_desc external="true" field_delimiter="," table_location="/tmp/examples/local">
-  <part_cols>
-    <column comment="Time column" name="dt" type="STRING" />
+  <table_desc external="true" field_delimiter="," table_location="${project.build.directory}/metastore/examples/local">
+    <part_cols>
+      <column comment="Time column" name="dt" type="STRING"/>
     </part_cols>
     <time_part_cols>dt</time_part_cols>
   </table_desc>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/resources/dim1-local-part.xml
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/resources/dim1-local-part.xml b/lens-cli/src/test/resources/dim1-local-part.xml
index a57f6a7..cc1e4f0 100644
--- a/lens-cli/src/test/resources/dim1-local-part.xml
+++ b/lens-cli/src/test/resources/dim1-local-part.xml
@@ -19,10 +19,11 @@
   under the License.
 
 -->
-<x_partition fact_or_dimension_table_name="dim_table2" location="/tmp/dim_table2" update_period="DAILY"
+<x_partition fact_or_dimension_table_name="dim_table2" location="${project.build.directory}/metastore/dim_table2"
+  update_period="DAILY"
   xmlns="uri:lens:cube:0.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-   xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
+  xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
   <time_partition_spec>
-    <part_spec_element key="dt" value="2014-03-27T12:00:00" />
+    <part_spec_element key="dt" value="2014-03-27T12:00:00"/>
   </time_partition_spec>
 </x_partition>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/resources/dim1-local-parts.xml
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/resources/dim1-local-parts.xml b/lens-cli/src/test/resources/dim1-local-parts.xml
index 8edc5c7..68fba8e 100644
--- a/lens-cli/src/test/resources/dim1-local-parts.xml
+++ b/lens-cli/src/test/resources/dim1-local-parts.xml
@@ -21,7 +21,8 @@
 -->
 <x_partition_list xmlns="uri:lens:cube:0.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
-  <partition fact_or_dimension_table_name="dim_table2" location="/tmp/dim_table2" update_period="DAILY">
+  <partition fact_or_dimension_table_name="dim_table2" location="${project.build.directory}/metastore/dim_table2"
+    update_period="DAILY">
     <time_partition_spec>
       <part_spec_element key="dt" value="2014-03-27T12:00:00"/>
     </time_partition_spec>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/resources/dim_table.xml
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/resources/dim_table.xml b/lens-cli/src/test/resources/dim_table.xml
index 96b2244..3bc9600 100644
--- a/lens-cli/src/test/resources/dim_table.xml
+++ b/lens-cli/src/test/resources/dim_table.xml
@@ -22,13 +22,13 @@
 <x_dimension_table dimension_name="test_dim" table_name="dim_table" weight="100.0" xmlns="uri:lens:cube:0.1"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
   <columns>
-    <column comment="ID" name="id" type="INT" />
-    <column comment="name" name="name" type="STRING" />
-    <column comment="more details" name="detail" type="STRING" />
-    <column comment="d2 ID" name="d2id" type="INT" />
+    <column comment="ID" name="id" type="INT"/>
+    <column comment="name" name="name" type="STRING"/>
+    <column comment="more details" name="detail" type="STRING"/>
+    <column comment="d2 ID" name="d2id" type="INT"/>
   </columns>
   <properties>
-    <property name="dim1.prop" value="d1" />
+    <property name="dim1.prop" value="d1"/>
   </properties>
   <storage_tables>
     <storage_table>
@@ -36,9 +36,10 @@
         <update_period>HOURLY</update_period>
       </update_periods>
       <storage_name>local</storage_name>
-      <table_desc external="true" field_delimiter="," table_location="/tmp/examples/local">
+      <table_desc external="true" field_delimiter=","
+        table_location="${project.build.directory}/metastore/examples/local">
         <part_cols>
-          <column comment="Time column" name="dt" type="STRING" />
+          <column comment="Time column" name="dt" type="STRING"/>
         </part_cols>
         <time_part_cols>dt</time_part_cols>
       </table_desc>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/resources/dim_table2.xml
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/resources/dim_table2.xml b/lens-cli/src/test/resources/dim_table2.xml
index 000f061..4c3f7d9 100644
--- a/lens-cli/src/test/resources/dim_table2.xml
+++ b/lens-cli/src/test/resources/dim_table2.xml
@@ -22,13 +22,13 @@
 <x_dimension_table dimension_name="test_dim" table_name="dim_table2" weight="100.0" xmlns="uri:lens:cube:0.1"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
   <columns>
-    <column comment="ID" name="id" type="INT" />
-    <column comment="name" name="name" type="STRING" />
-    <column comment="more details for dim2" name="detail2" type="STRING" />
+    <column comment="ID" name="id" type="INT"/>
+    <column comment="name" name="name" type="STRING"/>
+    <column comment="more details for dim2" name="detail2" type="STRING"/>
   </columns>
 
   <properties>
-    <property name="dim2.prop" value="d2" />
+    <property name="dim2.prop" value="d2"/>
   </properties>
   <storage_tables>
     <storage_table>
@@ -36,9 +36,10 @@
         <update_period>HOURLY</update_period>
       </update_periods>
       <storage_name>dim_local</storage_name>
-      <table_desc external="true" field_delimiter="," table_location="/tmp/examples/dim1">
+      <table_desc external="true" field_delimiter=","
+        table_location="${project.build.directory}/metastore/examples/dim1">
         <part_cols>
-          <column comment="Time column" name="dt" type="STRING" />
+          <column comment="Time column" name="dt" type="STRING"/>
         </part_cols>
         <time_part_cols>dt</time_part_cols>
       </table_desc>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/resources/fact-local-storage-element.xml
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/resources/fact-local-storage-element.xml b/lens-cli/src/test/resources/fact-local-storage-element.xml
index d9bb111..6f30a1c 100644
--- a/lens-cli/src/test/resources/fact-local-storage-element.xml
+++ b/lens-cli/src/test/resources/fact-local-storage-element.xml
@@ -26,9 +26,9 @@
     <update_period>DAILY</update_period>
   </update_periods>
   <storage_name>fact_local</storage_name>
-  <table_desc external="true" field_delimiter="," table_location="/tmp/examples/local">
+  <table_desc external="true" field_delimiter="," table_location="${project.build.directory}/metastore/examples/local">
     <part_cols>
-      <column comment="Time column" name="dt" type="STRING" />
+      <column comment="Time column" name="dt" type="STRING"/>
     </part_cols>
     <time_part_cols>dt</time_part_cols>
   </table_desc>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/resources/fact1-local-part.xml
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/resources/fact1-local-part.xml b/lens-cli/src/test/resources/fact1-local-part.xml
index 46e76c3..acad735 100644
--- a/lens-cli/src/test/resources/fact1-local-part.xml
+++ b/lens-cli/src/test/resources/fact1-local-part.xml
@@ -19,10 +19,11 @@
   under the License.
 
 -->
-<x_partition fact_or_dimension_table_name="fact1" location="/tmp/fact1" update_period="HOURLY"
+<x_partition fact_or_dimension_table_name="fact1" location="${project.build.directory}/metastore/fact1"
+  update_period="HOURLY"
   xmlns="uri:lens:cube:0.1"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
   <time_partition_spec>
-  <part_spec_element key="dt" value="2014-03-27T12:00:00" />
+    <part_spec_element key="dt" value="2014-03-27T12:00:00"/>
   </time_partition_spec>
 </x_partition>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/resources/fact1-local-parts.xml
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/resources/fact1-local-parts.xml b/lens-cli/src/test/resources/fact1-local-parts.xml
index 9ca7d1f..698b910 100644
--- a/lens-cli/src/test/resources/fact1-local-parts.xml
+++ b/lens-cli/src/test/resources/fact1-local-parts.xml
@@ -21,7 +21,8 @@
 -->
 <x_partition_list xmlns="uri:lens:cube:0.1"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
-  <partition fact_or_dimension_table_name="fact1" location="/tmp/fact1" update_period="HOURLY">
+  <partition fact_or_dimension_table_name="fact1" location="${project.build.directory}/metastore/fact1"
+    update_period="HOURLY">
     <time_partition_spec>
       <part_spec_element key="dt" value="2014-03-27T12:00:00"/>
     </time_partition_spec>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/resources/fact1.xml
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/resources/fact1.xml b/lens-cli/src/test/resources/fact1.xml
index f46fa5c..f6d1f9c 100644
--- a/lens-cli/src/test/resources/fact1.xml
+++ b/lens-cli/src/test/resources/fact1.xml
@@ -22,14 +22,14 @@
 <x_fact_table cube_name="sample_cube" name="fact1" weight="100.0" xmlns="uri:lens:cube:0.1"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
   <columns>
-    <column comment="" name="dim1" type="INT" />
-    <column comment="" name="measure1" type="BIGINT" />
-    <column comment="" name="measure2" type="INT" />
-    <column comment="" name="measure3" type="FLOAT" />
+    <column comment="" name="dim1" type="INT"/>
+    <column comment="" name="measure1" type="BIGINT"/>
+    <column comment="" name="measure2" type="INT"/>
+    <column comment="" name="measure3" type="FLOAT"/>
   </columns>
   <properties>
-    <property name="fact1.prop" value="f1" />
-    <property name="cube.fact.is.aggregated" value="true" />
+    <property name="fact1.prop" value="f1"/>
+    <property name="cube.fact.is.aggregated" value="true"/>
   </properties>
   <storage_tables>
     <storage_table>
@@ -39,9 +39,10 @@
         <update_period>MONTHLY</update_period>
       </update_periods>
       <storage_name>fact_local</storage_name>
-      <table_desc external="true" field_delimiter="," table_location="/tmp/examples/fact1_local">
+      <table_desc external="true" field_delimiter=","
+        table_location="${project.build.directory}/metastore/examples/fact1_local">
         <part_cols>
-          <column comment="Time column" name="dt" type="STRING" />
+          <column comment="Time column" name="dt" type="STRING"/>
         </part_cols>
         <time_part_cols>dt</time_part_cols>
       </table_desc>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cli/src/test/resources/fact_without_weight.xml
----------------------------------------------------------------------
diff --git a/lens-cli/src/test/resources/fact_without_weight.xml b/lens-cli/src/test/resources/fact_without_weight.xml
index fc0c670..8371b0b 100644
--- a/lens-cli/src/test/resources/fact_without_weight.xml
+++ b/lens-cli/src/test/resources/fact_without_weight.xml
@@ -20,31 +20,32 @@
 
 -->
 <x_fact_table cube_name="cube_with_no_weight_facts" name="fact_without_wt" xmlns="uri:lens:cube:0.1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd " >
-    <columns>
-        <column comment="" name="dim1" type="INT" />
-        <column comment="" name="measure1" type="BIGINT" />
-        <column comment="" name="measure2" type="INT" />
-        <column comment="" name="measure3" type="FLOAT" />
-    </columns>
-    <properties>
-        <property name="fact_without_wt.prop" value="f1" />
-        <property name="cube.fact.is.aggregated" value="true" />
-    </properties>
-    <storage_tables>
-        <storage_table>
-            <update_periods>
-                <update_period>HOURLY</update_period>
-                <update_period>DAILY</update_period>
-                <update_period>MONTHLY</update_period>
-            </update_periods>
-            <storage_name>fact_local_without_wt</storage_name>
-            <table_desc external="true" field_delimiter="," table_location="/tmp/examples/fact_local_without_wt">
-                <part_cols>
-                    <column comment="Time column" name="dt" type="STRING" />
-                </part_cols>
-                <time_part_cols>dt</time_part_cols>
-            </table_desc>
-        </storage_table>
-    </storage_tables>
-</x_fact_table>
\ No newline at end of file
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
+  <columns>
+    <column comment="" name="dim1" type="INT"/>
+    <column comment="" name="measure1" type="BIGINT"/>
+    <column comment="" name="measure2" type="INT"/>
+    <column comment="" name="measure3" type="FLOAT"/>
+  </columns>
+  <properties>
+    <property name="fact_without_wt.prop" value="f1"/>
+    <property name="cube.fact.is.aggregated" value="true"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+      </update_periods>
+      <storage_name>fact_local_without_wt</storage_name>
+      <table_desc external="true" field_delimiter=","
+        table_location="${project.build.directory}/metastore/examples/fact_local_without_wt">
+        <part_cols>
+          <column comment="Time column" name="dt" type="STRING"/>
+        </part_cols>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cube/src/test/java/org/apache/lens/cube/parse/TestCubeRewriter.java
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/java/org/apache/lens/cube/parse/TestCubeRewriter.java b/lens-cube/src/test/java/org/apache/lens/cube/parse/TestCubeRewriter.java
index 434313e..fb8f61a 100644
--- a/lens-cube/src/test/java/org/apache/lens/cube/parse/TestCubeRewriter.java
+++ b/lens-cube/src/test/java/org/apache/lens/cube/parse/TestCubeRewriter.java
@@ -246,25 +246,25 @@ public class TestCubeRewriter extends TestQueryRewrite {
   public void testCubeInsert() throws Exception {
     Configuration conf = getConf();
     conf.set(CubeQueryConfUtil.DRIVER_SUPPORTED_STORAGES, "C2");
-    String hqlQuery = rewrite("insert overwrite directory" + " '/tmp/test' select SUM(msr2) from testCube where "
+    String hqlQuery = rewrite("insert overwrite directory" + " 'target/test' select SUM(msr2) from testCube where "
       + TWO_DAYS_RANGE, conf);
     Map<String, String> wh = getWhereForDailyAndHourly2days(cubeName, "C2_testfact");
-    String expected = "insert overwrite directory '/tmp/test' "
+    String expected = "insert overwrite directory 'target/test' "
       + getExpectedQuery(cubeName, "select sum(testcube.msr2) FROM ", null, null, wh);
     compareQueries(expected, hqlQuery);
 
-    hqlQuery = rewrite("insert overwrite directory" + " '/tmp/test' cube select SUM(msr2) from testCube where "
+    hqlQuery = rewrite("insert overwrite directory" + " 'target/test' cube select SUM(msr2) from testCube where "
       + TWO_DAYS_RANGE, conf);
     compareQueries(expected, hqlQuery);
 
-    hqlQuery = rewrite("insert overwrite local directory" + " '/tmp/test' select SUM(msr2) from testCube where "
+    hqlQuery = rewrite("insert overwrite local directory" + " 'target/test' select SUM(msr2) from testCube where "
       + TWO_DAYS_RANGE, conf);
     wh = getWhereForDailyAndHourly2days(cubeName, "C2_testfact");
-    expected = "insert overwrite local directory '/tmp/test' "
+    expected = "insert overwrite local directory 'target/test' "
       + getExpectedQuery(cubeName, "select sum(testcube.msr2) FROM ", null, null, wh);
     compareQueries(expected, hqlQuery);
 
-    hqlQuery = rewrite("insert overwrite local directory" + " '/tmp/test' cube select SUM(msr2) from testCube where "
+    hqlQuery = rewrite("insert overwrite local directory" + " 'target/test' cube select SUM(msr2) from testCube where "
       + TWO_DAYS_RANGE, conf);
     compareQueries(expected, hqlQuery);
 

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-cube/src/test/resources/hive-site.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/hive-site.xml b/lens-cube/src/test/resources/hive-site.xml
index 0bcb2b2..8456f8b 100644
--- a/lens-cube/src/test/resources/hive-site.xml
+++ b/lens-cube/src/test/resources/hive-site.xml
@@ -32,12 +32,12 @@
 
   <property>
     <name>hive.metastore.warehouse.dir</name>
-    <value>/tmp/hive/warehouse</value>
+    <value>${project.build.directory}/hive/warehouse</value>
   </property>
 
   <property>
     <name>hive.querylog.location</name>
-    <value>${test.tmp.dir}/tmp</value>
+    <value>${project.build.directory}/query_logs</value>
     <description>Location of the structured hive logs</description>
   </property>
 

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-driver-hive/src/test/resources/hive-site.xml
----------------------------------------------------------------------
diff --git a/lens-driver-hive/src/test/resources/hive-site.xml b/lens-driver-hive/src/test/resources/hive-site.xml
index a35dc11..de5af50 100644
--- a/lens-driver-hive/src/test/resources/hive-site.xml
+++ b/lens-driver-hive/src/test/resources/hive-site.xml
@@ -32,7 +32,7 @@
 
   <property>
     <name>hive.metastore.warehouse.dir</name>
-    <value>/tmp/hive/warehouse</value>
+    <value>${project.build.directory}/hive/warehouse</value>
   </property>
 
   <property>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-driver-hive/src/test/resources/hivedriver-site.xml
----------------------------------------------------------------------
diff --git a/lens-driver-hive/src/test/resources/hivedriver-site.xml b/lens-driver-hive/src/test/resources/hivedriver-site.xml
index 3f37b7a..613938d 100644
--- a/lens-driver-hive/src/test/resources/hivedriver-site.xml
+++ b/lens-driver-hive/src/test/resources/hivedriver-site.xml
@@ -32,7 +32,7 @@
 
   <property>
     <name>hive.metastore.warehouse.dir</name>
-    <value>/tmp/hive/warehouse</value>
+    <value>${project.build.directory}/hive/warehouse</value>
   </property>
 
   <property>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-driver-jdbc/src/test/resources/hive-site.xml
----------------------------------------------------------------------
diff --git a/lens-driver-jdbc/src/test/resources/hive-site.xml b/lens-driver-jdbc/src/test/resources/hive-site.xml
index a1dfe5a..2cb1d8d 100644
--- a/lens-driver-jdbc/src/test/resources/hive-site.xml
+++ b/lens-driver-jdbc/src/test/resources/hive-site.xml
@@ -32,7 +32,7 @@
 
   <property>
     <name>hive.metastore.warehouse.dir</name>
-    <value>/tmp/hive/warehouse</value>
+    <value>${project.build.directory}/hive/warehouse</value>
   </property>
 
   <property>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-ml-lib/src/main/java/org/apache/lens/ml/impl/ModelLoader.java
----------------------------------------------------------------------
diff --git a/lens-ml-lib/src/main/java/org/apache/lens/ml/impl/ModelLoader.java b/lens-ml-lib/src/main/java/org/apache/lens/ml/impl/ModelLoader.java
index 4fc45d3..8a69545 100644
--- a/lens-ml-lib/src/main/java/org/apache/lens/ml/impl/ModelLoader.java
+++ b/lens-ml-lib/src/main/java/org/apache/lens/ml/impl/ModelLoader.java
@@ -18,9 +18,7 @@
  */
 package org.apache.lens.ml.impl;
 
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
+import java.io.*;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
@@ -36,7 +34,6 @@ import org.apache.hadoop.hive.conf.HiveConf;
 
 import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
-
 import lombok.extern.slf4j.Slf4j;
 
 /**
@@ -57,7 +54,7 @@ public final class ModelLoader {
   public static final String TEST_REPORT_BASE_DIR = "lens.ml.test.basedir";
 
   /** The Constant TEST_REPORT_BASE_DIR_DEFAULT. */
-  public static final String TEST_REPORT_BASE_DIR_DEFAULT = "file:///tmp/ml_reports";
+  public static final String TEST_REPORT_BASE_DIR_DEFAULT = MODEL_PATH_BASE_DIR_DEFAULT + "/ml_reports";
 
   // Model cache settings
   /** The Constant MODEL_CACHE_SIZE. */

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-query-lib/src/test/java/org/apache/lens/lib/query/TestFilePersistentFormatter.java
----------------------------------------------------------------------
diff --git a/lens-query-lib/src/test/java/org/apache/lens/lib/query/TestFilePersistentFormatter.java b/lens-query-lib/src/test/java/org/apache/lens/lib/query/TestFilePersistentFormatter.java
index 8c39fd8..7617e06 100644
--- a/lens-query-lib/src/test/java/org/apache/lens/lib/query/TestFilePersistentFormatter.java
+++ b/lens-query-lib/src/test/java/org/apache/lens/lib/query/TestFilePersistentFormatter.java
@@ -45,12 +45,12 @@ public class TestFilePersistentFormatter extends TestAbstractFileFormatter {
   /**
    * The part file dir.
    */
-  private Path partFileDir = new Path("file:///tmp/partcsvfiles");
+  private Path partFileDir = new Path("target/partcsvfiles");
 
   /**
    * The part file text dir.
    */
-  private Path partFileTextDir = new Path("file:///tmp/parttextfiles");
+  private Path partFileTextDir = new Path("target/parttextfiles");
 
   /**
    * Creates the part files.

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-server/pom.xml
----------------------------------------------------------------------
diff --git a/lens-server/pom.xml b/lens-server/pom.xml
index f5f82c1..a0a718e 100644
--- a/lens-server/pom.xml
+++ b/lens-server/pom.xml
@@ -256,9 +256,11 @@
     <testResources>
       <testResource>
         <directory>${project.basedir}/testdata</directory>
+        <filtering>true</filtering>
       </testResource>
       <testResource>
         <directory>${project.basedir}/src/test/resources</directory>
+        <filtering>true</filtering>
       </testResource>
     </testResources>
     <plugins>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-server/src/test/java/org/apache/lens/server/metastore/TestMetastoreService.java
----------------------------------------------------------------------
diff --git a/lens-server/src/test/java/org/apache/lens/server/metastore/TestMetastoreService.java b/lens-server/src/test/java/org/apache/lens/server/metastore/TestMetastoreService.java
index 877f707..308ce33 100644
--- a/lens-server/src/test/java/org/apache/lens/server/metastore/TestMetastoreService.java
+++ b/lens-server/src/test/java/org/apache/lens/server/metastore/TestMetastoreService.java
@@ -22,6 +22,7 @@ import static org.apache.lens.cube.metadata.UpdatePeriod.*;
 
 import static org.testng.Assert.*;
 
+import java.io.File;
 import java.util.*;
 
 import javax.ws.rs.BadRequestException;
@@ -48,6 +49,7 @@ import org.apache.lens.server.api.metastore.CubeMetastoreService;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.time.DateUtils;
+import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.metastore.TableType;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;
 import org.apache.hadoop.hive.ql.session.SessionState;
@@ -944,7 +946,7 @@ public class TestMetastoreService extends LensJerseyTest {
     xs1.setFieldDelimiter("\t");
     xs1.setLineDelimiter("\n");
     xs1.setMapKeyDelimiter("\r");
-    xs1.setTableLocation("/tmp/" + name);
+    xs1.setTableLocation(new Path(new File("target").getAbsolutePath(), name).toString());
     xs1.setExternal(true);
     xs1.setPartCols(new XColumns());
     xs1.setTableParameters(new XProperties());
@@ -1849,7 +1851,7 @@ public class TestMetastoreService extends LensJerseyTest {
   private XPartition createPartition(String cubeTableName, final List<XTimePartSpecElement> timePartSpecs) {
 
     XPartition xp = cubeObjectFactory.createXPartition();
-    xp.setLocation("file:///tmp/part/test_part");
+    xp.setLocation(new Path(new File("target").getAbsolutePath(), "part/test_part").toString());
     xp.setFactOrDimensionTableName(cubeTableName);
     xp.setNonTimePartitionSpec(new XPartSpec());
     xp.setTimePartitionSpec(new XTimePartSpec());

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-server/src/test/java/org/apache/lens/server/rewrite/TestRewriting.java
----------------------------------------------------------------------
diff --git a/lens-server/src/test/java/org/apache/lens/server/rewrite/TestRewriting.java b/lens-server/src/test/java/org/apache/lens/server/rewrite/TestRewriting.java
index 9628865..affefe1 100644
--- a/lens-server/src/test/java/org/apache/lens/server/rewrite/TestRewriting.java
+++ b/lens-server/src/test/java/org/apache/lens/server/rewrite/TestRewriting.java
@@ -204,7 +204,7 @@ public class TestRewriting {
       "lens.MethodMetricGauge.TestRewriting-MockDriver-1-RewriteUtil-rewriteQuery-toHQL")));
     conf.unset(LensConfConstants.QUERY_METRIC_UNIQUE_ID_CONF_KEY);
 
-    q2 = "insert overwrite directory '/tmp/rewrite' cube select name from table";
+    q2 = "insert overwrite directory 'target/rewrite' cube select name from table";
     Assert.assertTrue(RewriteUtil.isCubeQuery(q2));
     cubeQueries = RewriteUtil.findCubePositions(q2, hconf);
     Assert.assertEquals(cubeQueries.size(), 1);
@@ -212,7 +212,7 @@ public class TestRewriting {
     ctx = new QueryContext(q2, null, lensConf, conf, drivers);
     runRewrites(RewriteUtil.rewriteQuery(ctx));
 
-    q2 = "insert overwrite local directory '/tmp/rewrite' cube select name from table";
+    q2 = "insert overwrite local directory 'target/rewrite' cube select name from table";
     Assert.assertTrue(RewriteUtil.isCubeQuery(q2));
     cubeQueries = RewriteUtil.findCubePositions(q2, hconf);
     Assert.assertEquals(cubeQueries.size(), 1);
@@ -220,7 +220,7 @@ public class TestRewriting {
     ctx = new QueryContext(q2, null, lensConf, conf, drivers);
     runRewrites(RewriteUtil.rewriteQuery(ctx));
 
-    q2 = "insert overwrite local directory '/tmp/example-output' cube select id,name from dim_table";
+    q2 = "insert overwrite local directory 'target/example-output' cube select id,name from dim_table";
     Assert.assertTrue(RewriteUtil.isCubeQuery(q2));
     cubeQueries = RewriteUtil.findCubePositions(q2, hconf);
     Assert.assertEquals(cubeQueries.size(), 1);
@@ -244,7 +244,7 @@ public class TestRewriting {
     ctx = new QueryContext(q2, null, lensConf, conf, drivers);
     runRewrites(RewriteUtil.rewriteQuery(ctx));
 
-    q2 = "insert overwrite directory '/tmp/rewrite' select * from (cube select name from table) a";
+    q2 = "insert overwrite directory 'target/rewrite' select * from (cube select name from table) a";
     Assert.assertTrue(RewriteUtil.isCubeQuery(q2));
     cubeQueries = RewriteUtil.findCubePositions(q2, hconf);
     Assert.assertEquals(cubeQueries.size(), 1);
@@ -321,7 +321,7 @@ public class TestRewriting {
     Assert.assertEquals(cubeQueries.get(0).query, "cube select name from table");
     Assert.assertEquals(cubeQueries.get(1).query, "cube select name2 from table2");
 
-    q2 = "insert overwrite directory '/tmp/rewrite' "
+    q2 = "insert overwrite directory 'target/rewrite' "
       + "select * from (cube select name from table union all cube select name2 from table2) u";
     Assert.assertTrue(RewriteUtil.isCubeQuery(q2));
     cubeQueries = RewriteUtil.findCubePositions(q2, hconf);

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogFileScannerTask.java
----------------------------------------------------------------------
diff --git a/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogFileScannerTask.java b/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogFileScannerTask.java
index 3d1de92..551096e 100644
--- a/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogFileScannerTask.java
+++ b/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogFileScannerTask.java
@@ -65,8 +65,8 @@ public class TestStatisticsLogFileScannerTask {
    */
   @BeforeMethod
   public void createTestLogFile() throws Exception {
-    f = new File("/tmp/test.log.2014-08-05-11-28");
-    hidden = new File("/tmp/.test.log.2014-08-05-11-28.swp");
+    f = new File("target/test.log.2014-08-05-11-28");
+    hidden = new File("target/.test.log.2014-08-05-11-28.swp");
     hidden.createNewFile();
     f.createNewFile();
   }

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogPartitionHandler.java
----------------------------------------------------------------------
diff --git a/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogPartitionHandler.java b/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogPartitionHandler.java
index f59131b..6e123b8 100644
--- a/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogPartitionHandler.java
+++ b/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogPartitionHandler.java
@@ -36,10 +36,7 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.metastore.api.Database;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;
-import org.apache.hadoop.hive.ql.metadata.Hive;
-import org.apache.hadoop.hive.ql.metadata.HiveException;
-import org.apache.hadoop.hive.ql.metadata.Partition;
-import org.apache.hadoop.hive.ql.metadata.Table;
+import org.apache.hadoop.hive.ql.metadata.*;
 
 import org.testng.Assert;
 import org.testng.annotations.Test;
@@ -61,7 +58,7 @@ public class TestStatisticsLogPartitionHandler {
   @Test
   public void testPartitionHandler() throws Exception {
     HiveConf conf = configureHiveTables();
-    String fileName = "/tmp/lensstats.log";
+    String fileName = "target/lensstats.log";
     File f = createDummyFile(fileName);
     StatisticsLogPartitionHandler handler = new StatisticsLogPartitionHandler();
     handler.initialize(conf);
@@ -75,8 +72,12 @@ public class TestStatisticsLogPartitionHandler {
     Partition p = partitionSet.iterator().next();
     Assert.assertEquals(p.getTable().getTableName(), EVENT_NAME);
     Assert.assertEquals(p.getTable().getDbName(), LensConfConstants.DEFAULT_STATISTICS_DATABASE);
-    Assert.assertEquals(p.getDataLocation(), new Path(LensConfConstants.DEFAULT_STATISTICS_WAREHOUSE, EVENT_NAME
-      + "/random/" + EVENT_NAME + ".log"));
+    Assert.assertEquals(p.getDataLocation(),
+      new Path(
+        conf.get(LensConfConstants.STATISTICS_WAREHOUSE_KEY, LensConfConstants.DEFAULT_STATISTICS_WAREHOUSE),
+        EVENT_NAME + "/random/" + EVENT_NAME + ".log"
+      )
+    );
     Assert.assertFalse(f.exists());
     h.dropTable(LensConfConstants.DEFAULT_STATISTICS_DATABASE, EVENT_NAME, true, true);
   }

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-server/src/test/resources/hive-site.xml
----------------------------------------------------------------------
diff --git a/lens-server/src/test/resources/hive-site.xml b/lens-server/src/test/resources/hive-site.xml
index 5e694dd..441f274 100644
--- a/lens-server/src/test/resources/hive-site.xml
+++ b/lens-server/src/test/resources/hive-site.xml
@@ -34,7 +34,7 @@
 
   <property>
     <name>hive.metastore.warehouse.dir</name>
-    <value>/tmp/hive/warehouse</value>
+    <value>${project.build.directory}/hive/warehouse</value>
   </property>
 
   <property>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-server/src/test/resources/hivedriver-site.xml
----------------------------------------------------------------------
diff --git a/lens-server/src/test/resources/hivedriver-site.xml b/lens-server/src/test/resources/hivedriver-site.xml
index cd9c655..f2aed88 100644
--- a/lens-server/src/test/resources/hivedriver-site.xml
+++ b/lens-server/src/test/resources/hivedriver-site.xml
@@ -38,7 +38,7 @@
 
   <property>
     <name>hive.metastore.warehouse.dir</name>
-    <value>/tmp/hive/warehouse</value>
+    <value>${project.build.directory}/hive/warehouse</value>
   </property>
 
   <property>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-server/src/test/resources/lens-site.xml
----------------------------------------------------------------------
diff --git a/lens-server/src/test/resources/lens-site.xml b/lens-server/src/test/resources/lens-site.xml
index 5d93e74..4cf94d5 100644
--- a/lens-server/src/test/resources/lens-site.xml
+++ b/lens-server/src/test/resources/lens-site.xml
@@ -136,7 +136,6 @@
     <value>session,query,metastore,scheduler,quota,mocknonlens</value>
   </property>
 
-
   <property>
     <name>lens.server.mocknonlens.service.impl</name>
     <value>org.apache.lens.server.MockNonLensService</value>
@@ -161,6 +160,12 @@
   </property>
 
   <property>
+    <name>lens.server.statistics.warehouse.dir</name>
+    <value>file://${project.build.directory}/lens/statistics/warehouse</value>
+    <description>Default top level location where stats are moved by the log statistics store.</description>
+  </property>
+
+  <property>
     <name>lens.server.estimate.timeout.millis</name>
     <value>120000</value>
   </property>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/lens-storage-db/src/test/resources/hive-site.xml
----------------------------------------------------------------------
diff --git a/lens-storage-db/src/test/resources/hive-site.xml b/lens-storage-db/src/test/resources/hive-site.xml
index a1dfe5a..2cb1d8d 100644
--- a/lens-storage-db/src/test/resources/hive-site.xml
+++ b/lens-storage-db/src/test/resources/hive-site.xml
@@ -32,7 +32,7 @@
 
   <property>
     <name>hive.metastore.warehouse.dir</name>
-    <value>/tmp/hive/warehouse</value>
+    <value>${project.build.directory}/hive/warehouse</value>
   </property>
 
   <property>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/55f03d38/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 71c3e78..523b0b0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -89,7 +89,6 @@
     <testng.version>6.8</testng.version>
     <mockito.version>1.9.5</mockito.version>
     <powermock.version>1.4.12</powermock.version>
-    <test.tmp.dir>${basedir}/target/tmp</test.tmp.dir>
 
     <!-- maven plugins -->
     <jaxb2.plugin.version>0.12.3</jaxb2.plugin.version>
@@ -404,6 +403,12 @@
         <filtering>true</filtering>
       </resource>
     </resources>
+    <testResources>
+      <testResource>
+        <directory>src/test/resources</directory>
+        <filtering>true</filtering>
+      </testResource>
+    </testResources>
 
     <pluginManagement>
       <plugins>