[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: JarEntry as VFS root does not return empty vfspath

mstruk do-not-reply at jboss.com
Fri Mar 14 18:07:59 EDT 2008


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#4136830

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136830



More information about the jboss-dev-forums mailing list