I'm not sure what you mean by "this pattern", but it is certainly system-dependent whether the URL you are now producing refers to the same underlying physical resource as the one your tests expect, or indeed, whether it can possibly refers to any physical resource at all. You should certainly fix the problem highlighted by the tests (and kudos to you for having tests that picked this up!).
In my experience, a double slash in a path normally arises one of two ways:
- from concatenating a path ending in a slash with one beginning with a slash, or
- from joining a two strings with a '/' delimiter, when the first one already ends with a slash or the second begins with one.
Supposing that one of those is what's happening here, the solution is probably to be very clear about what each parameter and variable represents, to provide only valid values for them, and to perform on them only operations that are correct for those entities.
Specifically, if you have a variable containing the value "/release/glassfish-3.1.2.2.zip", then what, exactly, is that variable supposed to represent? It is not a relative path, but apparently it's not a correct absolute path, either. I can't think of what a variable might represent in your module for such a value to be valid for it, so if one of your variables has such a value then that is probably incorrect. Alternatively, if you have a variable expected to contain a valid directory URL (which must end in a '/'), and in fact containing the valid directory URL "http::/
java.download.net/glassfish/", and you join the value of that variable to a relative path, then you should not put a '/' between the parts because you can rely on the base URL already containing one.
To the extent that you may not consider data fed to your module from outside to be completely reliable, you should consider implementing validation checks.
John