diff options
author | Eduardo Pedroni <e.pedroni91@gmail.com> | 2015-07-24 22:29:10 +0200 |
---|---|---|
committer | Eduardo Pedroni <e.pedroni91@gmail.com> | 2015-07-24 22:29:10 +0200 |
commit | 3cb8dad3917cad4df95340253db5f5b743844f58 (patch) | |
tree | 39f17a8f90752f9b85a3572e845f92b3079eb0b6 /test/eu/equalparts/cardbase/testutils | |
parent | f3ce19d1c5be34575adeaed0cf991a609ac8a10f (diff) |
Did many CLI tests, have to rethink the MTGUniverse thing to make it more testable
Diffstat (limited to 'test/eu/equalparts/cardbase/testutils')
-rw-r--r-- | test/eu/equalparts/cardbase/testutils/TestFile.java | 23 | ||||
-rw-r--r-- | test/eu/equalparts/cardbase/testutils/TestUtils.java | 24 |
2 files changed, 0 insertions, 47 deletions
diff --git a/test/eu/equalparts/cardbase/testutils/TestFile.java b/test/eu/equalparts/cardbase/testutils/TestFile.java deleted file mode 100644 index ac666a9..0000000 --- a/test/eu/equalparts/cardbase/testutils/TestFile.java +++ /dev/null @@ -1,23 +0,0 @@ -package eu.equalparts.cardbase.testutils; - -import java.io.File; - -public class TestFile extends File implements AutoCloseable { - - /** - * - */ - private static final long serialVersionUID = 3716372675161543906L; - - public TestFile(String pathname) { - super(pathname); - } - - @Override - public void close() throws Exception { - delete(); - } - - - -} diff --git a/test/eu/equalparts/cardbase/testutils/TestUtils.java b/test/eu/equalparts/cardbase/testutils/TestUtils.java deleted file mode 100644 index ba590c8..0000000 --- a/test/eu/equalparts/cardbase/testutils/TestUtils.java +++ /dev/null @@ -1,24 +0,0 @@ -package eu.equalparts.cardbase.testutils; - -public class TestUtils { - - public static TestFile createValidTestFile(String fileName) throws Exception { - TestFile testFile = new TestFile(fileName); - if (!testFile.exists()) { - if (testFile.createNewFile()) { - if (testFile.canWrite()) { - return testFile; - } else { - throw new IllegalArgumentException("Cannot write to " + testFile.getAbsolutePath() + ", aborting..."); - } - } else { - throw new IllegalArgumentException(testFile.getAbsolutePath() + " could not be created, aborting..."); - } - } else { - throw new IllegalArgumentException(testFile.getAbsolutePath() + " already exists, aborting..."); - } - } - - - -} |