[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Alternative vfs jar implementation

mstruk do-not-reply at jboss.com
Thu May 22 16:35:37 EDT 2008


Ok ... I fixed most of the unit test failures (not yet commited). There is  one remaining category of failing tests that I need an opinion about. 

My ZipEntryContext rewrites a URL used to create it to always have vfszip: schema in order to ensure proper handling when accessing via URL. There are now 7 tests failing with variations of this issue:

ERROR: junit.framework.AssertionFailedError: expected:<vfsfile:/C:/Users/Devel/svnroot/jboss-vfs-alter/some.jar> but was:<vfszip:/C:/Users/Devel/svnroot/jboss-vfs-alter/some.jar>

A schema mismatch.

What happens here is that vfs context is created on directory. Then findChild() is called to get a jar child. It's expected that child's URL is directory URL + '/' + childName. But in this case child is a mount point of ZipEntryContext into FileSystemContext and has a different URL schema.

The question is if this expectation is part of the contract, and if it has some specific use-case behind it.

Seems to me that VirtualFileHandler.toURL() should be free to return whatever as long as the URL leads to a correct virtual file.

I would go and fix these tests to compare URL file part, but not schema. Does that sound ok?

cheers,

 - marko


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4152809#4152809

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



More information about the jboss-dev-forums mailing list