Lines 44-49
Link Here
|
44 |
|
44 |
|
45 |
package org.openide.filesystems; |
45 |
package org.openide.filesystems; |
46 |
|
46 |
|
|
|
47 |
import java.io.File; |
47 |
import java.io.IOException; |
48 |
import java.io.IOException; |
48 |
import java.util.ArrayList; |
49 |
import java.util.ArrayList; |
49 |
import java.util.Arrays; |
50 |
import java.util.Arrays; |
Lines 61-66
Link Here
|
61 |
} |
62 |
} |
62 |
|
63 |
|
63 |
|
64 |
|
|
|
65 |
@Override |
64 |
protected String[] getResources (String testName) { |
66 |
protected String[] getResources (String testName) { |
65 |
return resources; |
67 |
return resources; |
66 |
} |
68 |
} |
Lines 219-222
Link Here
|
219 |
assertEquals("1st test", "mal", t.getAttribute("x")); |
221 |
assertEquals("1st test", "mal", t.getAttribute("x")); |
220 |
assertEquals("2nd test", "mal", t.getAttribute("x")); |
222 |
assertEquals("2nd test", "mal", t.getAttribute("x")); |
221 |
} |
223 |
} |
|
|
224 |
|
225 |
public void testMultiFileSystemWithOverridenAttributes() throws Exception { |
226 |
MultiFileSystem mfs = (MultiFileSystem)this.testedFS; |
227 |
List<FileSystem> all = new ArrayList<FileSystem>(Arrays.asList(mfs.getDelegates())); |
228 |
File f = writeFile("layer.xml", |
229 |
"<filesystem>\n" |
230 |
+ " <folder name =\"org-sepix\">\n" |
231 |
+ " <folder name =\"Panes\">\n" |
232 |
+ " <file name=\"Demo.txt\">\n" |
233 |
+ " <attr name=\"position\" intvalue=\"100\"/>\n" |
234 |
+ " </file>\n" |
235 |
+ " </folder>\n" |
236 |
+ " </folder>\n" |
237 |
+ "</filesystem>"); |
238 |
XMLFileSystem xml = new XMLFileSystem(f.toURI().toURL()); |
239 |
all.add(xml); |
240 |
mfs.setDelegates(all.toArray(new FileSystem[0])); |
241 |
|
242 |
|
243 |
FileObject folder = mfs.findResource("org-sepix/Panes/"); |
244 |
|
245 |
for (FileObject fileObject : folder.getChildren()) { |
246 |
assertEquals("should be 100", 100, fileObject.getAttribute("position")); |
247 |
|
248 |
fileObject.setAttribute("position", 200); |
249 |
assertEquals("should be 200", 200, fileObject.getAttribute("position")); |
250 |
assertEquals("should be 200 still", 200, fileObject.getAttribute("position")); |
251 |
} |
252 |
} |
253 |
|
254 |
private File writeFile(String name, String content) throws IOException { |
255 |
File f = new File(getWorkDir(), name); |
256 |
java.io.FileWriter w = new java.io.FileWriter(f); |
257 |
w.write(content); |
258 |
w.close(); |
259 |
return f; |
260 |
} |
261 |
|
222 |
} |
262 |
} |