1 19 20 package org.openide.filesystems; 21 22 import java.io.IOException ; 23 24 public class MfoOnSFSTestHid extends TestBaseHid { 25 FileSystem sfs = null; 26 27 public MfoOnSFSTestHid(String testName) { 28 super(testName); 29 sfs = this.testedFS; 30 } 31 32 33 protected String [] getResources (String testName) { 34 return new String [] {}; 35 } 36 37 38 public void testMove () throws IOException { 39 String whatRes = "Actions/System/org-openide-actions-GarbageCollectAction.instance"; 40 String whereRes = "Menu/Tools"; 41 42 FileObject what = sfs.findResource (whatRes); 43 if (what == null) { 44 what = FileUtil.createData(sfs.getRoot(), whatRes); 45 } 46 fsAssert("Expected in SystemFileSystem: " + whatRes,what != null); 47 FileObject where = sfs.findResource (whereRes); 48 if (where == null) { 49 where = FileUtil.createFolder(sfs.getRoot(), whereRes); 50 } 51 52 fsAssert("Expected in SystemFileSystem: " + whereRes,where != null); 53 54 FileLock flock = what.lock(); 55 try { 56 FileObject moveResult = what.move (flock,where,what.getName(),what.getExt()); 57 fsAssert("Move error",moveResult != null); 58 fsAssert("Move error",sfs.findResource (whatRes) == null); 59 fsAssert("Move error",sfs.findResource (whereRes) != null); 60 } finally { 61 flock.releaseLock(); 62 } 63 64 } 65 66 67 protected void setUp() throws Exception { 68 this.testedFS = sfs = Repository.getDefault().getDefaultFileSystem();; 69 } 70 71 } 72 | Popular Tags |