apex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [11/12] incubator-apex-malhar git commit: APEXMALHAR-2036 cleanup of intermediate test files
Date Fri, 01 Apr 2016 03:54:51 GMT
APEXMALHAR-2036 cleanup of intermediate test files


Project: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/commit/4d0fc75e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/tree/4d0fc75e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/diff/4d0fc75e

Branch: refs/heads/devel-3
Commit: 4d0fc75e691a401ffadccc37a9f94537bf72ee3b
Parents: c3f6951
Author: Chandni Singh <csingh@apache.org>
Authored: Mon Mar 28 21:43:35 2016 -0700
Committer: Chandni Singh <csingh@apache.org>
Committed: Tue Mar 29 15:35:39 2016 -0700

----------------------------------------------------------------------
 ...actFileInputOperatorFailureHandlingTest.java |  2 ++
 .../io/fs/AbstractFileInputOperatorTest.java    |  8 ++------
 .../io/fs/AbstractFileOutputOperatorTest.java   |  4 +++-
 .../AbstractWindowFileOutputOperatorTest.java   |  1 +
 .../lib/io/fs/FileSplitterBaseTest.java         | 21 +++++++++++++-------
 .../lib/io/fs/FileSplitterInputTest.java        |  4 ++--
 .../state/managed/BucketsFileSystemTest.java    |  5 +++--
 .../lib/state/managed/DefaultBucketTest.java    |  5 +++--
 .../IncrementalCheckpointManagerTest.java       |  5 +++--
 .../lib/state/managed/ManagedStateImplTest.java |  5 +++--
 .../state/managed/ManagedStateTestUtils.java    | 13 ------------
 .../state/managed/ManagedTimeStateImplTest.java |  5 +++--
 .../ManagedTimeUnifiedStateImplTest.java        |  5 +++--
 .../lib/state/managed/StateTrackerTest.java     |  5 +++--
 14 files changed, 45 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/4d0fc75e/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileInputOperatorFailureHandlingTest.java
----------------------------------------------------------------------
diff --git a/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileInputOperatorFailureHandlingTest.java
b/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileInputOperatorFailureHandlingTest.java
index 0669cdd..b50fe29 100644
--- a/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileInputOperatorFailureHandlingTest.java
+++ b/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileInputOperatorFailureHandlingTest.java
@@ -22,6 +22,7 @@ import com.datatorrent.api.*;
 
 import com.datatorrent.lib.helper.OperatorContextTestHelper;
 import com.datatorrent.lib.testbench.CollectorTestSink;
+import com.datatorrent.lib.util.TestUtils;
 import com.datatorrent.lib.util.TestUtils.TestInfo;
 import com.google.common.collect.*;
 import java.io.*;
@@ -120,6 +121,7 @@ public class AbstractFileInputOperatorFailureHandlingTest
 
     Assert.assertEquals("number tuples", 100, queryResults.collectedTuples.size());
     Assert.assertEquals("lines", allLines, new HashSet<String>(queryResults.collectedTuples));
+    TestUtils.deleteTargetTestClassFolder(testMeta.desc);
 
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/4d0fc75e/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileInputOperatorTest.java
----------------------------------------------------------------------
diff --git a/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileInputOperatorTest.java
b/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileInputOperatorTest.java
index e9cd0d2..511d42e 100644
--- a/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileInputOperatorTest.java
+++ b/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileInputOperatorTest.java
@@ -65,6 +65,7 @@ public class AbstractFileInputOperatorTest
     @Override
     protected void starting(org.junit.runner.Description description)
     {
+      TestUtils.deleteTargetTestClassFolder(description);
       String methodName = description.getMethodName();
       String className = description.getClassName();
       this.dir = "target/" + className + "/" + methodName;
@@ -76,12 +77,7 @@ public class AbstractFileInputOperatorTest
     @Override
     protected void finished(Description description)
     {
-      try {
-        FileUtils.deleteDirectory(new File("target/" + description.getClassName()));
-      }
-      catch (IOException e) {
-        throw new RuntimeException(e);
-      }
+      TestUtils.deleteTargetTestClassFolder(description);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/4d0fc75e/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperatorTest.java
----------------------------------------------------------------------
diff --git a/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperatorTest.java
b/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperatorTest.java
index 94c587b..67518ae 100644
--- a/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperatorTest.java
+++ b/library/src/test/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperatorTest.java
@@ -46,6 +46,7 @@ import org.apache.hadoop.fs.FileSystem;
 
 import com.datatorrent.lib.helper.OperatorContextTestHelper;
 import com.datatorrent.lib.testbench.RandomWordGenerator;
+import com.datatorrent.lib.util.TestUtils;
 import com.datatorrent.lib.util.TestUtils.TestInfo;
 
 import com.datatorrent.api.*;
@@ -71,6 +72,7 @@ public class AbstractFileOutputOperatorTest
     protected void starting(Description description)
     {
       super.starting(description);
+      TestUtils.deleteTargetTestClassFolder(description);
       try {
         FileUtils.forceMkdir(new File(getDir()));
         Attribute.AttributeMap.DefaultAttributeMap attributeMap = new Attribute.AttributeMap.DefaultAttributeMap();
@@ -87,7 +89,7 @@ public class AbstractFileOutputOperatorTest
     protected void finished(Description description)
     {
       super.finished(description);
-      FileUtils.deleteQuietly(new File(getDir()));
+      TestUtils.deleteTargetTestClassFolder(description);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/4d0fc75e/library/src/test/java/com/datatorrent/lib/io/fs/AbstractWindowFileOutputOperatorTest.java
----------------------------------------------------------------------
diff --git a/library/src/test/java/com/datatorrent/lib/io/fs/AbstractWindowFileOutputOperatorTest.java
b/library/src/test/java/com/datatorrent/lib/io/fs/AbstractWindowFileOutputOperatorTest.java
index 5961521..518a437 100644
--- a/library/src/test/java/com/datatorrent/lib/io/fs/AbstractWindowFileOutputOperatorTest.java
+++ b/library/src/test/java/com/datatorrent/lib/io/fs/AbstractWindowFileOutputOperatorTest.java
@@ -44,6 +44,7 @@ public class AbstractWindowFileOutputOperatorTest
       oper.setAlwaysWriteToTmp(false);
       oper.setup(testOperatorContext);
     }
+
   }
 
   public static OperatorContextTestHelper.TestIdOperatorContext testOperatorContext =

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/4d0fc75e/library/src/test/java/com/datatorrent/lib/io/fs/FileSplitterBaseTest.java
----------------------------------------------------------------------
diff --git a/library/src/test/java/com/datatorrent/lib/io/fs/FileSplitterBaseTest.java b/library/src/test/java/com/datatorrent/lib/io/fs/FileSplitterBaseTest.java
index 9e110be..ac8c7e2 100644
--- a/library/src/test/java/com/datatorrent/lib/io/fs/FileSplitterBaseTest.java
+++ b/library/src/test/java/com/datatorrent/lib/io/fs/FileSplitterBaseTest.java
@@ -31,7 +31,6 @@ import org.junit.runner.Description;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.commons.io.FileUtils;
 import org.apache.hadoop.conf.Configuration;
 
 import com.datatorrent.api.Attribute;
@@ -59,7 +58,7 @@ public class FileSplitterBaseTest
 {
   class BastTestMeta extends TestWatcher
   {
-    public String dataDirectory;
+    String dataDirectory;
 
     FileSplitterBase fileSplitter;
     CollectorTestSink<FileSplitterInput.FileMetadata> fileMetadataSink;
@@ -70,7 +69,7 @@ public class FileSplitterBaseTest
     @Override
     protected void starting(org.junit.runner.Description description)
     {
-
+      TestUtils.deleteTargetTestClassFolder(description);
       String methodName = description.getMethodName();
       String className = description.getClassName();
       this.dataDirectory = "target/" + className + "/" + methodName;
@@ -87,7 +86,6 @@ public class FileSplitterBaseTest
       attributes.put(Context.OperatorContext.SPIN_MILLIS, 500);
 
       context = new OperatorContextTestHelper.TestIdOperatorContext(0, attributes);
-      fileSplitter.setup(context);
 
       fileMetadataSink = new CollectorTestSink<>();
       TestUtils.setSink(fileSplitter.filesMetadataOutput, fileMetadataSink);
@@ -99,7 +97,7 @@ public class FileSplitterBaseTest
     @Override
     protected void finished(Description description)
     {
-      this.fileSplitter.teardown();
+      TestUtils.deleteTargetTestClassFolder(description);
     }
   }
 
@@ -109,6 +107,8 @@ public class FileSplitterBaseTest
   @Test
   public void testFileMetadata() throws InterruptedException
   {
+    baseTestMeta.fileSplitter.setup(baseTestMeta.context);
+
     baseTestMeta.fileSplitter.beginWindow(1);
     for (String filePath : baseTestMeta.filePaths) {
       baseTestMeta.fileSplitter.input.process(new FileSplitterInput.FileInfo(null, filePath));
@@ -122,11 +122,13 @@ public class FileSplitterBaseTest
     }
 
     baseTestMeta.fileMetadataSink.collectedTuples.clear();
+    baseTestMeta.fileSplitter.teardown();
   }
 
   @Test
   public void testBlockMetadataNoSplit() throws InterruptedException
   {
+    baseTestMeta.fileSplitter.setup(baseTestMeta.context);
     baseTestMeta.fileSplitter.beginWindow(1);
     for (String filePath : baseTestMeta.filePaths) {
       baseTestMeta.fileSplitter.input.process(new FileSplitterInput.FileInfo(null, filePath));
@@ -136,11 +138,13 @@ public class FileSplitterBaseTest
       BlockMetadata.FileBlockMetadata metadata = (BlockMetadata.FileBlockMetadata)blockMetadata;
       Assert.assertTrue("path: " + metadata.getFilePath(), baseTestMeta.filePaths.contains(metadata.getFilePath()));
     }
+    baseTestMeta.fileSplitter.teardown();
   }
 
   @Test
   public void testBlockMetadataWithSplit() throws InterruptedException
   {
+    baseTestMeta.fileSplitter.setup(baseTestMeta.context);
     baseTestMeta.fileSplitter.setBlockSize(2L);
     baseTestMeta.fileSplitter.beginWindow(1);
     for (String filePath : baseTestMeta.filePaths) {
@@ -155,11 +159,13 @@ public class FileSplitterBaseTest
       noOfBlocks += (int)Math.ceil(testFile.length() / (2 * 1.0));
     }
     Assert.assertEquals("Blocks", noOfBlocks, baseTestMeta.blockMetadataSink.collectedTuples.size());
+    baseTestMeta.fileSplitter.teardown();
   }
 
   @Test
   public void testBlocksThreshold() throws InterruptedException
   {
+    baseTestMeta.fileSplitter.setup(baseTestMeta.context);
     int noOfBlocks = 0;
     for (int i = 0; i < 12; i++) {
       File testFile = new File(baseTestMeta.dataDirectory, "file" + i + ".txt");
@@ -185,6 +191,7 @@ public class FileSplitterBaseTest
 
     Assert.assertEquals("Files", 12, baseTestMeta.fileMetadataSink.collectedTuples.size());
     Assert.assertEquals("Blocks", noOfBlocks, baseTestMeta.blockMetadataSink.collectedTuples.size());
+    baseTestMeta.fileSplitter.teardown();
   }
 
   @Test
@@ -198,7 +205,7 @@ public class FileSplitterBaseTest
     lc.runAsync();
     app.receiver.latch.await();
     Assert.assertEquals("no. of metadata", 12, app.receiver.count);
-    FileUtils.deleteQuietly(new File("target/SplitterInApp"));
+    lc.shutdown();
   }
 
   @ApplicationAnnotation(name = "TestApp")
@@ -209,7 +216,7 @@ public class FileSplitterBaseTest
     @Override
     public void populateDAG(DAG dag, Configuration configuration)
     {
-      dag.setAttribute(DAG.APPLICATION_PATH, "target/SplitterInApp");
+      dag.setAttribute(DAG.APPLICATION_PATH, baseTestMeta.dataDirectory);
       MockFileInput fileInput = dag.addOperator("Input", new MockFileInput());
       fileInput.filePaths = baseTestMeta.filePaths;
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/4d0fc75e/library/src/test/java/com/datatorrent/lib/io/fs/FileSplitterInputTest.java
----------------------------------------------------------------------
diff --git a/library/src/test/java/com/datatorrent/lib/io/fs/FileSplitterInputTest.java b/library/src/test/java/com/datatorrent/lib/io/fs/FileSplitterInputTest.java
index de05cbc..035ed07 100644
--- a/library/src/test/java/com/datatorrent/lib/io/fs/FileSplitterInputTest.java
+++ b/library/src/test/java/com/datatorrent/lib/io/fs/FileSplitterInputTest.java
@@ -92,7 +92,7 @@ public class FileSplitterInputTest
     @Override
     protected void starting(org.junit.runner.Description description)
     {
-
+      TestUtils.deleteTargetTestClassFolder(description);
       String methodName = description.getMethodName();
       String className = description.getClassName();
       this.dataDirectory = "target/" + className + "/" + methodName + "/data";
@@ -128,7 +128,7 @@ public class FileSplitterInputTest
     protected void finished(Description description)
     {
       this.fileSplitterInput.teardown();
-      FileUtils.deleteQuietly(new File("target/" + description.getClassName() + "/" + description.getMethodName()));
+      TestUtils.deleteTargetTestClassFolder(description);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/4d0fc75e/library/src/test/java/org/apache/apex/malhar/lib/state/managed/BucketsFileSystemTest.java
----------------------------------------------------------------------
diff --git a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/BucketsFileSystemTest.java
b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/BucketsFileSystemTest.java
index 51e9a13..ee6cf00 100644
--- a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/BucketsFileSystemTest.java
+++ b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/BucketsFileSystemTest.java
@@ -31,6 +31,7 @@ import org.junit.rules.TestWatcher;
 import org.junit.runner.Description;
 
 import com.datatorrent.lib.fileaccess.FileAccessFSImpl;
+import com.datatorrent.lib.util.TestUtils;
 import com.datatorrent.netlet.util.Slice;
 
 public class BucketsFileSystemTest
@@ -44,7 +45,7 @@ public class BucketsFileSystemTest
     @Override
     protected void starting(Description description)
     {
-      ManagedStateTestUtils.cleanTargetDir(description);
+      TestUtils.deleteTargetTestClassFolder(description);
 
       managedStateContext = new MockManagedStateContext(ManagedStateTestUtils.getOperatorContext(7));
       applicationPath = "target/" + description.getClassName() + "/" + description.getMethodName();
@@ -58,7 +59,7 @@ public class BucketsFileSystemTest
     @Override
     protected void finished(Description description)
     {
-      ManagedStateTestUtils.cleanTargetDir(description);
+      TestUtils.deleteTargetTestClassFolder(description);
     }
 
   }

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/4d0fc75e/library/src/test/java/org/apache/apex/malhar/lib/state/managed/DefaultBucketTest.java
----------------------------------------------------------------------
diff --git a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/DefaultBucketTest.java
b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/DefaultBucketTest.java
index cb8a97f..93f705b 100644
--- a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/DefaultBucketTest.java
+++ b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/DefaultBucketTest.java
@@ -30,6 +30,7 @@ import org.junit.runner.Description;
 
 import com.datatorrent.lib.fileaccess.FileAccess;
 import com.datatorrent.lib.fileaccess.FileAccessFSImpl;
+import com.datatorrent.lib.util.TestUtils;
 import com.datatorrent.netlet.util.Slice;
 
 public class DefaultBucketTest
@@ -44,7 +45,7 @@ public class DefaultBucketTest
     @Override
     protected void starting(Description description)
     {
-      ManagedStateTestUtils.cleanTargetDir(description);
+      TestUtils.deleteTargetTestClassFolder(description);
       managedStateContext = new MockManagedStateContext(ManagedStateTestUtils.getOperatorContext(9));
       applicationPath = "target/" + description.getClassName() + "/" + description.getMethodName();
       ((FileAccessFSImpl)managedStateContext.getFileAccess()).setBasePath(applicationPath
+ "/" + "bucket_data");
@@ -58,7 +59,7 @@ public class DefaultBucketTest
     protected void finished(Description description)
     {
       managedStateContext.getBucketsFileSystem().teardown();
-      ManagedStateTestUtils.cleanTargetDir(description);
+      TestUtils.deleteTargetTestClassFolder(description);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/4d0fc75e/library/src/test/java/org/apache/apex/malhar/lib/state/managed/IncrementalCheckpointManagerTest.java
----------------------------------------------------------------------
diff --git a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/IncrementalCheckpointManagerTest.java
b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/IncrementalCheckpointManagerTest.java
index ca64693..2e35b0a 100644
--- a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/IncrementalCheckpointManagerTest.java
+++ b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/IncrementalCheckpointManagerTest.java
@@ -44,6 +44,7 @@ import com.google.common.base.Preconditions;
 import com.datatorrent.api.Context;
 import com.datatorrent.lib.fileaccess.FileAccessFSImpl;
 import com.datatorrent.lib.util.KryoCloneUtils;
+import com.datatorrent.lib.util.TestUtils;
 import com.datatorrent.netlet.util.Slice;
 
 public class IncrementalCheckpointManagerTest
@@ -58,7 +59,7 @@ public class IncrementalCheckpointManagerTest
     @Override
     protected void starting(Description description)
     {
-      ManagedStateTestUtils.cleanTargetDir(description);
+      TestUtils.deleteTargetTestClassFolder(description);
       applicationPath = "target/" + description.getClassName() + "/" + description.getMethodName();
 
       Context.OperatorContext operatorContext = ManagedStateTestUtils.getOperatorContext(operatorId,
applicationPath);
@@ -78,7 +79,7 @@ public class IncrementalCheckpointManagerTest
     {
       managedStateContext.getTimeBucketAssigner().teardown();
       managedStateContext.getBucketsFileSystem().teardown();
-      ManagedStateTestUtils.cleanTargetDir(description);
+      TestUtils.deleteTargetTestClassFolder(description);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/4d0fc75e/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedStateImplTest.java
----------------------------------------------------------------------
diff --git a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedStateImplTest.java
b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedStateImplTest.java
index f86b5d3..bc8b1e8 100644
--- a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedStateImplTest.java
+++ b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedStateImplTest.java
@@ -32,6 +32,7 @@ import org.junit.runner.Description;
 import com.datatorrent.api.Context;
 import com.datatorrent.lib.fileaccess.FileAccessFSImpl;
 import com.datatorrent.lib.util.KryoCloneUtils;
+import com.datatorrent.lib.util.TestUtils;
 import com.datatorrent.netlet.util.Slice;
 
 public class ManagedStateImplTest
@@ -46,7 +47,7 @@ public class ManagedStateImplTest
     @Override
     protected void starting(Description description)
     {
-      ManagedStateTestUtils.cleanTargetDir(description);
+      TestUtils.deleteTargetTestClassFolder(description);
       managedState = new ManagedStateImpl();
       applicationPath = "target/" + description.getClassName() + "/" + description.getMethodName();
       ((FileAccessFSImpl)managedState.getFileAccess()).setBasePath(applicationPath + "/"
+ "bucket_data");
@@ -57,7 +58,7 @@ public class ManagedStateImplTest
     @Override
     protected void finished(Description description)
     {
-      ManagedStateTestUtils.cleanTargetDir(description);
+      TestUtils.deleteTargetTestClassFolder(description);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/4d0fc75e/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedStateTestUtils.java
----------------------------------------------------------------------
diff --git a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedStateTestUtils.java
b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedStateTestUtils.java
index f2251bd..4ba8905 100644
--- a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedStateTestUtils.java
+++ b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedStateTestUtils.java
@@ -47,19 +47,6 @@ import com.datatorrent.netlet.util.Slice;
 
 public class ManagedStateTestUtils
 {
-
-  static void cleanTargetDir(Description description)
-  {
-    try {
-      File out = new File("target/" + description.getClassName());
-      if (out.exists()) {
-        FileUtils.deleteDirectory(out);
-      }
-    } catch (IOException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
   static void transferBucketHelper(FileAccess fileAccess, long bucketId, Map<Slice, Bucket.BucketedValue>
unsavedBucket,
       int keysPerTimeBucket) throws IOException
   {

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/4d0fc75e/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedTimeStateImplTest.java
----------------------------------------------------------------------
diff --git a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedTimeStateImplTest.java
b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedTimeStateImplTest.java
index ac4db39..bde437c 100644
--- a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedTimeStateImplTest.java
+++ b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedTimeStateImplTest.java
@@ -36,6 +36,7 @@ import com.datatorrent.api.DAG;
 import com.datatorrent.lib.fileaccess.FileAccessFSImpl;
 import com.datatorrent.lib.helper.OperatorContextTestHelper;
 import com.datatorrent.lib.util.KryoCloneUtils;
+import com.datatorrent.lib.util.TestUtils;
 import com.datatorrent.netlet.util.Slice;
 
 public class ManagedTimeStateImplTest
@@ -49,7 +50,7 @@ public class ManagedTimeStateImplTest
     @Override
     protected void starting(Description description)
     {
-      ManagedStateTestUtils.cleanTargetDir(description);
+      TestUtils.deleteTargetTestClassFolder(description);
       managedState = new ManagedTimeStateImpl();
       applicationPath = "target/" + description.getClassName() + "/" + description.getMethodName();
       ((FileAccessFSImpl)managedState.getFileAccess()).setBasePath(applicationPath + "/"
+ "bucket_data");
@@ -60,7 +61,7 @@ public class ManagedTimeStateImplTest
     @Override
     protected void finished(Description description)
     {
-      ManagedStateTestUtils.cleanTargetDir(description);
+      TestUtils.deleteTargetTestClassFolder(description);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/4d0fc75e/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedTimeUnifiedStateImplTest.java
----------------------------------------------------------------------
diff --git a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedTimeUnifiedStateImplTest.java
b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedTimeUnifiedStateImplTest.java
index 523a10a..c7920de 100644
--- a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedTimeUnifiedStateImplTest.java
+++ b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/ManagedTimeUnifiedStateImplTest.java
@@ -33,6 +33,7 @@ import org.junit.runner.Description;
 import com.datatorrent.api.Context;
 import com.datatorrent.lib.fileaccess.FileAccessFSImpl;
 import com.datatorrent.lib.util.KryoCloneUtils;
+import com.datatorrent.lib.util.TestUtils;
 import com.datatorrent.netlet.util.Slice;
 
 public class ManagedTimeUnifiedStateImplTest
@@ -46,7 +47,7 @@ public class ManagedTimeUnifiedStateImplTest
     @Override
     protected void starting(Description description)
     {
-      ManagedStateTestUtils.cleanTargetDir(description);
+      TestUtils.deleteTargetTestClassFolder(description);
       managedState = new ManagedTimeUnifiedStateImpl();
       applicationPath = "target/" + description.getClassName() + "/" + description.getMethodName();
       ((FileAccessFSImpl)managedState.getFileAccess()).setBasePath(applicationPath + "/"
+ "bucket_data");
@@ -57,7 +58,7 @@ public class ManagedTimeUnifiedStateImplTest
     @Override
     protected void finished(Description description)
     {
-      ManagedStateTestUtils.cleanTargetDir(description);
+      TestUtils.deleteTargetTestClassFolder(description);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/4d0fc75e/library/src/test/java/org/apache/apex/malhar/lib/state/managed/StateTrackerTest.java
----------------------------------------------------------------------
diff --git a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/StateTrackerTest.java
b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/StateTrackerTest.java
index 8a3e521..95defb8 100644
--- a/library/src/test/java/org/apache/apex/malhar/lib/state/managed/StateTrackerTest.java
+++ b/library/src/test/java/org/apache/apex/malhar/lib/state/managed/StateTrackerTest.java
@@ -34,6 +34,7 @@ import com.google.common.collect.Lists;
 
 import com.datatorrent.api.Context;
 import com.datatorrent.lib.fileaccess.FileAccessFSImpl;
+import com.datatorrent.lib.util.TestUtils;
 import com.datatorrent.netlet.util.Slice;
 
 public class StateTrackerTest
@@ -47,7 +48,7 @@ public class StateTrackerTest
     @Override
     protected void starting(Description description)
     {
-      ManagedStateTestUtils.cleanTargetDir(description);
+      TestUtils.deleteTargetTestClassFolder(description);
       managedState = new MockManagedStateImpl();
       applicationPath = "target/" + description.getClassName() + "/" + description.getMethodName();
       ((FileAccessFSImpl)managedState.getFileAccess()).setBasePath(applicationPath + "/"
+ "bucket_data");
@@ -61,7 +62,7 @@ public class StateTrackerTest
     @Override
     protected void finished(Description description)
     {
-      ManagedStateTestUtils.cleanTargetDir(description);
+      TestUtils.deleteTargetTestClassFolder(description);
     }
   }
 


Mime
View raw message