Skip to content
Permalink
Browse files
[JENKINS-29541] Reproduced problem in test.
  • Loading branch information
jglick committed Aug 4, 2015
1 parent 92e5ffe commit 45f6ad3caa5e4fb0b9ce7dfd4bf0d1ab1f487a57
@@ -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
@@ -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.
*/

0 comments on commit 45f6ad3

Please sign in to comment.