Changeset 6508
- Timestamp:
- Aug 8, 2014, 8:37:10 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-stable/src/test/TestDirectory.java
r6502 r6508 65 65 test_list(id1); 66 66 67 int[] pid = test_create_multiple("/foo", "/foo/bar1", "/foo/bar2", "/foo/bar1/sub1"); 68 67 69 if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter(); 70 if (pid != null && pid.length > 0) test_delete(pid[0], true); 68 71 test_delete(id_sub2, false); 69 72 … … 147 150 } 148 151 152 static int[] test_create_multiple(String... path) 153 { 154 if (!TestUtil.hasPermission(Permission.CREATE, Item.DIRECTORY)) return null; 155 int id[] = new int[path.length]; 156 DbControl dc = null; 157 try 158 { 159 dc = TestUtil.getDbControl(); 160 for (int i = 0; i < path.length; i++) 161 { 162 Path p = new Path(path[i], Path.Type.DIRECTORY); 163 Directory d = Directory.getNew(dc, p); 164 write_item(i, d); 165 id[i] = d.getId(); 166 } 167 dc.commit(); 168 write("--Create multiple by path OK"); 169 } 170 catch (Throwable ex) 171 { 172 write("--Create multiple by path FAILED"); 173 ex.printStackTrace(); 174 ok = false; 175 } 176 finally 177 { 178 if (dc != null) dc.close(); 179 } 180 return id; 181 } 182 183 149 184 static void test_load(int id) 150 185 {
Note: See TracChangeset
for help on using the changeset viewer.