Skip to content

Commit

Permalink
[JENKINS-29541] Reproduced problem in test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Aug 4, 2015
1 parent 92e5ffe commit 45f6ad3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Expand Up @@ -20,6 +20,7 @@ method java.lang.String trim
method java.lang.String matches java.lang.String
method java.lang.String split java.lang.String
method java.lang.String startsWith java.lang.String
method java.lang.String substring int int
method java.lang.String replace java.lang.CharSequence java.lang.CharSequence
method java.util.Collection contains java.lang.Object
method java.util.concurrent.Callable call
Expand Down
Expand Up @@ -88,6 +88,13 @@ public class SandboxInterceptorTest {
assertEvaluate(new StaticWhitelist("new " + clazz, "method " + clazz + " specialize java.lang.Object", "method " + clazz + " quote java.lang.Object"), expected, script);
}

@Ignore("TODO second line fails with: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (org.codehaus.groovy.runtime.GStringImpl substring java.lang.Integer java.lang.Integer)")
@Issue("JENKINS-29541")
@Test public void substringGString() throws Exception {
assertEvaluate(new GenericWhitelist(), "hell", "'hello world'.substring(0, 4)");
assertEvaluate(new GenericWhitelist(), "hell", "def place = 'world'; \"hello ${place}\".substring(0, 4)");
}

/**
* Tests the proper interception of builder-like method.
*/
Expand Down

0 comments on commit 45f6ad3

Please sign in to comment.