Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'JENKINS-25119-addendum' into JENKINS-28586
  • Loading branch information
jglick committed May 28, 2015
2 parents 6d46df1 + e7f8fa8 commit c5cb521
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -246,9 +246,14 @@ public static final class Special {
}
}

@Ignore("TODO not yet implemented")
@Issue("JENKINS-25119")
@Test public void defaultGroovyMethods() throws Exception {
assertEvaluate(new GenericWhitelist(), Arrays.asList(1, 4, 9), "([1, 2, 3] as int[]).collect({it * it})");
assertRejected(new ProxyWhitelist(), "staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods toInteger java.lang.String", "'123'.toInteger();");
assertEvaluate(new StaticWhitelist("staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods toInteger java.lang.String"), 123, "'123'.toInteger();");
assertEvaluate(new StaticWhitelist("staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods collect java.lang.Object groovy.lang.Closure"), Arrays.asList(1, 4, 9), "([1, 2, 3] as int[]).collect({x -> x * x})");
/* TODO No such property: it for class: Script1:
assertEvaluate(new StaticWhitelist("staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods collect java.lang.Object groovy.lang.Closure"), Arrays.asList(1, 4, 9), "([1, 2, 3] as int[]).collect({it * it})");
*/
}

@Test public void whitelistedIrrelevantInsideScript() throws Exception {
Expand Down

0 comments on commit c5cb521

Please sign in to comment.