Ardesco / driver-binary-downloader-maven-plugin

A Maven plugin that will download the WebDriver stand alone server executables for use in your mavenised Selenium project.
Apache License 2.0
92 stars 52 forks source link

Correct issue with extracting wire on windows. #37

Closed jackson-chris closed 8 years ago

jackson-chris commented 8 years ago

These changes will allow extraction of the wire executable when run on windows. The old code was trying to use a regular expression with String.endsWith() which doesn't support regular expressions. Instead we should be using String.matches() and use a more robust regular expression to match on. Since only the MARIONETTE driver requires the use of a regular expression we check for the driver type and if it is MARIONETTE we use matches, otherwise we still use endsWith. Note that wire archive is only in zip format on windows thus only the unzipFile was modified. I Added some test cases to check the regular expression. I tested this on windows and osx and seems to be working.

jackson-chris commented 8 years ago

When merged will you do a release with this update immediately? I'd like to use this tool in our CI process but this issue is preventing me from doing so as we have several developers using windows.

Ardesco commented 8 years ago

I'll look at this tonight, however my first impressions are:

AnthonyClink commented 8 years ago

This would be great... as of now im using the static file repo file but without marionette

Ardesco commented 8 years ago

I'm going to need to tweak this a bit, we can't use zipFileEntry.getName() because that will include a relative path (That's why BinaryType is a list of filenames, rather than a regex. There isn't a great way to get the correct filename without adding in some clever code to extract it from a relative path and hope you got the right part).

I'm going to base the change on what you have here but it's going to need some tweaking.

Ardesco commented 8 years ago

Looking at this in detail it would seem that they have changed the filenames for marionette since the initial implementation. The fix is actually relatively simple, just add the correct filenames into BinaryType.

I'm not going to merge this as it's got some issues that will come back and bit us in the arse in the future.