Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

operator '^' for dynamic trigger must be escaped in regex #294

Merged
merged 2 commits into from Jul 19, 2016

Conversation

Projects
None yet
2 participants
@mbudnick
Copy link
Contributor

commented Jul 13, 2016

If you use "Dynamic Trigger Configuration" with line "b^**" there will be an exception "cannot parse" in GerritDynamicUrlProcessor line 154.
Operator "^" must be escaped if used in regex pattern.

@rsandell

This comment has been minimized.

Copy link
Member

commented Jul 14, 2016

Could you provide a unit test?

@mbudnick

This comment has been minimized.

Copy link
Contributor Author

commented Jul 14, 2016

I never wrote tests with mockito and powermock, I use jmockit. So I don't know how to mock url.openConnection() or test private methods.
There are also errors in test-classes and pom.xml when I import the project in my Eclipse and tests don't run.
So I can't provide a unit test.

@rsandell

This comment has been minimized.

Copy link
Member

commented Jul 14, 2016

You don't need to do any of that mocking or url connection stuff. Just copy and slightly modify this one https://github.com/jenkinsci/gerrit-trigger-plugin/blob/master/src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/spec/SpecGerritTriggerHudsonTest.java#L217
And you can run mvn test -Dtest=SpecGerritTriggerHudsonTest on the commandline to verify.

@mbudnick

This comment has been minimized.

Copy link
Contributor Author

commented Jul 19, 2016

I wrote a unit test for "b^**" (which was my problem). How can I add this to this pull request? Should I amend my first commit to include the test?

@rsandell

This comment has been minimized.

Copy link
Member

commented Jul 19, 2016

Just push a new commit to mbudnick:master no need to amend

@rsandell rsandell merged commit 19fcdcc into jenkinsci:master Jul 19, 2016

1 check passed

Jenkins This pull request looks good
Details
@rsandell

This comment has been minimized.

Copy link
Member

commented Jul 19, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.