updated coding rules.
[utils] / support / general / src / test / java / org / wamblee / io / TestData.java
index 58bea68ec119becf74222451cf497c40ba3b8f06..1418f6b1227b532312cc7c172d0520f1dff23aab 100644 (file)
@@ -34,8 +34,8 @@ import junit.framework.Assert;
  */
 public final class TestData {
 
-       private Object _testcase;
-       private File _root;
+       private Object testcase;
+       private File root;
 
        /**
         * Test data to be constructed in the setUp of a test. {@link #clean()} must
@@ -43,9 +43,9 @@ public final class TestData {
         * test.
         */
        public TestData(Object aTestcase) {
-               _testcase = aTestcase;
-               _root = getTestRootDir(aTestcase);
-               FileSystemUtils.createDir(_root);
+               testcase = aTestcase;
+               root = getTestRootDir(aTestcase);
+               FileSystemUtils.createDir(root);
        }
 
        /**
@@ -59,7 +59,7 @@ public final class TestData {
 
        public void createFile(String aRelative, String aFile, InputStream aContents) {
                FileSystemUtils
-                               .createFile(new File(_root, aRelative), aFile, aContents);
+                               .createFile(new File(root, aRelative), aFile, aContents);
        }
 
        public void createFile(String aFile, String aContents) {
@@ -68,7 +68,7 @@ public final class TestData {
 
        public void createFile(String aRelative, String aFile, String aContents) {
                InputStream is = new ByteArrayInputStream(aContents.getBytes());
-               FileSystemUtils.createFile(new File(_root, aRelative), aFile, is);
+               FileSystemUtils.createFile(new File(root, aRelative), aFile, is);
        }
        
        public void deleteFile(String aFile) {
@@ -76,7 +76,7 @@ public final class TestData {
        }
 
        public void deleteFile(String aRelative, String aFile) {
-               FileSystemUtils.delete(new File(_root, aFile));
+               FileSystemUtils.delete(new File(root, aFile));
        }
 
        /**
@@ -85,15 +85,15 @@ public final class TestData {
         * @return Temporary directory.
         */
        public File getTmpDir() {
-               return new File(_root, "tmpdir");
+               return new File(root, "tmpdir");
        }
 
        /**
         * Cleans up the test output directory.
         */
        public void clean() {
-               FileSystemUtils.deleteDirRecursively(_root);
-               FileSystemUtils.createDir(_root);
+               FileSystemUtils.deleteDirRecursively(root);
+               FileSystemUtils.createDir(root);
        }
 
        /**
@@ -103,7 +103,7 @@ public final class TestData {
         *            Source directory to copy.
         */
        public void copyDir(File aSrc) {
-               FileSystemUtils.copyDir(aSrc, _root);
+               FileSystemUtils.copyDir(aSrc, root);
        }
 
        /**
@@ -118,7 +118,7 @@ public final class TestData {
        public void copyResource(String aResource, String aRelativePath) {
                try {
                        InputStream is = new ClassPathResource(aResource).getInputStream();
-                       FileOutputStream fos = new FileOutputStream(new File(_root,
+                       FileOutputStream fos = new FileOutputStream(new File(root,
                                        aRelativePath));
                        FileSystemUtils.copyStream(is, fos);
                } catch (IOException e) {
@@ -139,7 +139,7 @@ public final class TestData {
        }
 
        public void createDir(String aRelative) {
-               FileSystemUtils.createDir(new File(_root, aRelative));
+               FileSystemUtils.createDir(new File(root, aRelative));
        }
 
        /**
@@ -150,7 +150,7 @@ public final class TestData {
         *            cannot be removed.
         */
        public void delete(String aRelative) {
-               FileSystemUtils.delete(new File(_root, aRelative));
+               FileSystemUtils.delete(new File(root, aRelative));
        }
 
        /**
@@ -160,7 +160,7 @@ public final class TestData {
         *            Relative path.
         */
        public void deleteDir(String aRelative) {
-               FileSystemUtils.deleteDir(new File(_root, aRelative));
+               FileSystemUtils.deleteDir(new File(root, aRelative));
        }
 
        /**
@@ -170,7 +170,7 @@ public final class TestData {
         *            Relative path.
         */
        public void deleteDirRecursively(String aRelative) {
-               FileSystemUtils.deleteDir(new File(_root, aRelative));
+               FileSystemUtils.deleteDir(new File(root, aRelative));
        }
 
        /**
@@ -179,13 +179,13 @@ public final class TestData {
         * @return Root of the test output.
         */
        public File getRoot() {
-               return _root;
+               return root;
        }
 
        /**
         * Gets a file object for a relative path.
         */
        public File getFile(String aRelative) {
-               return new File(_root, aRelative);
+               return new File(root, aRelative);
        }
 }