1 19 20 package org.openide.loaders; 21 22 import org.openide.filesystems.*; 23 import java.beans.*; 24 import org.netbeans.junit.*; 25 26 34 public class DataFolderSlowDeletionTest extends LoggingTestCaseHid { 35 private FileObject folder; 36 private FileObject[] children; 38 private DataFolder df; 39 private DataObject do0; 40 41 42 43 public DataFolderSlowDeletionTest (String name) { 44 super (name); 45 } 46 47 51 public static NbTestSuite suite () { 52 return NbTestSuite.linearSpeedSuite(DataFolderSlowDeletionTest.class, 2, 3); 53 } 54 55 60 protected void setUp() throws Exception { 61 clearWorkDir(); 62 TestUtilHid.destroyLocalFileSystem(getName()); 63 64 int count = getTestNumber (); 65 String [] resources = new String [count]; 66 for (int i=0; i<resources.length; i++) resources[i] = "folder/file" + i + ".txt"; 67 FileSystem fs = TestUtilHid.createLocalFileSystem(getWorkDir(), resources); 68 folder = fs.findResource("folder"); 69 70 folder = FileUtil.toFileObject(FileUtil.toFile(folder)); 72 73 74 children = folder.getChildren(); 75 df = DataFolder.findFolder (folder); 76 do0 = DataObject.find(children[0]); 77 } 78 79 80 81 85 private void performSlowDeletionTest () throws Exception { 86 folder.delete(); 87 } 88 89 93 public void testSlowDeletionPrime1000() throws Exception { 94 performSlowDeletionTest(); 95 } 96 97 101 public void testSlowDeletion1000() throws Exception { 102 performSlowDeletionTest(); 103 } 104 105 public void testSlowDeletion3000() throws Exception { 106 performSlowDeletionTest(); 107 } 108 109 } 110 | Popular Tags |