diff options
| author | Robert Gemmell <robbie@apache.org> | 2009-10-20 14:45:21 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2009-10-20 14:45:21 +0000 |
| commit | 156f38b92810af655553c37c343fe9c177a8c039 (patch) | |
| tree | 766630933f865d1bba95a90848bf7cacdb9f70b1 /qpid/java | |
| parent | bc832b23f5484422ef373d09f6ad74971c2cd497 (diff) | |
| download | qpid-python-156f38b92810af655553c37c343fe9c177a8c039.tar.gz | |
QPID-2040: update test to ensure all test files created are cleared up
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@827586 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
| -rw-r--r-- | qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabaseTest.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabaseTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabaseTest.java index 20b8d0a7b4..a3dad19bb4 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabaseTest.java +++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabaseTest.java @@ -34,6 +34,7 @@ import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.security.Principal; +import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; @@ -47,12 +48,29 @@ public class PlainPasswordFilePrincipalDatabaseTest extends TestCase private Principal _principal = new UsernamePrincipal(TEST_USERNAME); private PlainPasswordFilePrincipalDatabase _database; + private List<File> _testPwdFiles = new ArrayList<File>(); public void setUp() throws Exception { _database = new PlainPasswordFilePrincipalDatabase(); + _testPwdFiles.clear(); } + public void tearDown() throws Exception + { + //clean up any additional files and their backups + for(File f : _testPwdFiles) + { + File oldPwdFile = new File(f.getAbsolutePath() + ".old"); + if(oldPwdFile.exists()) + { + oldPwdFile.delete(); + } + + f.delete(); + } + } + // ******* Test Methods ********** // public void testCreatePrincipal() @@ -368,6 +386,8 @@ public class PlainPasswordFilePrincipalDatabaseTest extends TestCase writer.flush(); writer.close(); + + _testPwdFiles.add(testFile); return testFile; |
