I took the 'fix setting of a name' approach and I have a working fix for this
issue. Still have to do some code cleanup before committing.
There is just one inconsistency left.
The unit test for this issue actually expects the wrong behavior (as far as I
understand).
This is the code:
| URL url = getResource("/vfs/context/jar/simple.jar");
| URL entry = new URL("jar:" + url.toString() + "!/child");
| JarContext context = new JarContext(entry);
| assertEquals("child", context.getRoot().getName()); // WRONG: we
should expect ""
| assertEquals("", context.getRoot().getPathName());
|
| url = getResource("/vfs/test/outer.jar");
| entry = new URL("jar:" + url.toString() + "!/jar2.jar ");
| context = new JarContext(entry);
| assertEquals("jar2.jar", context.getRoot().getName()); // WRONG: we
should expect ""
| assertEquals("", context.getRoot().getPathName());
|
It's wrong because root node should always have "" name, and ""
pathName.
If it doesn't it's a violation of naming rules:
fullUrl = contextUrl + pathName
pathName = parent.pathName + "/" + name
I can fix the unit test, and commit everything, unless someone finds something wrong with
my logic :)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136830#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...