3
* ====================================================================
4
* Copyright (c) 2003-2004 CollabNet. All rights reserved.
6
* This software is licensed as described in the file COPYING, which
7
* you should have received as part of this distribution. The terms
8
* are also available at http://subversion.tigris.org/license-1.html.
9
* If newer versions of this license are posted there, you may use a
10
* newer version instead, at your option.
12
* This software consists of voluntary contributions made by many
13
* individuals. For exact contribution history, see the revision
14
* history and logs, available at http://subversion.tigris.org/.
15
* ====================================================================
18
package org.tigris.subversion.javahl.tests;
20
import junit.framework.TestCase;
21
import org.tigris.subversion.javahl.SVNAdmin;
25
* This class is used for testing the SVNAdmin class
27
* More methodes for testing are still needed
29
public class SVNAdminTests extends TestCase
32
* the objects, which is going to be tested
39
protected void setUp() throws Exception
42
testee = new SVNAdmin();
46
* cleanp after the test
49
protected void tearDown() throws Exception
56
* Test the basic SVNAdmin.create functionality
59
public void testCreate() throws Throwable
61
testee.create("testrep", false, false, null, SVNAdmin.BDB);
62
assertTrue("repository exists", new File("testrep").exists());
63
removeRepository("testrep");
64
assertFalse("repository deleted", new File("testrep").exists());
68
* remove a rempositryl
69
* @param pathName path name of the repository
72
protected void removeRepository(String pathName) throws Exception
74
File masterDir = new File(pathName);
75
removeDirOrFile(masterDir);
79
* remove a file or a directory with its content
80
* @param file the file or directory to be removed
82
private void removeDirOrFile(File file)
88
if(file.isDirectory())
90
File[] content = file.listFiles();
91
for(int i = 0; i < content.length; i++)
92
removeDirOrFile(content[i]);