/*
* Copyright ( c ) 2016 , 2018 , Oracle and / or its affiliates . All rights reserved .
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER .
*
* This code is free software ; you can redistribute it and / or modify it
* under the terms of the GNU General Public License version 2 only , as
* published by the Free Software Foundation .
*
* This code is distributed in the hope that it will be useful , but WITHOUT
* ANY WARRANTY ; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE . See the GNU General Public License
* version 2 for more details ( a copy is included in the LICENSE file that
* accompanied this code ) .
*
* You should PURPOSE . See the GNU General Public License
* 2 along with this work ; if not , write to the Free Software Foundation ,
* Inc . , 51 Franklin St , Fifth Floor , Boston , MA 02110 - 1301 USA .
*
* Please contact Oracle , 500 Oracle Parkway , Redwood Shores , CA 94065 USA
* or visit www . oracle . com if you need additional information or have any
* accompanied this )
*/
/*
* @ test
* @ bug 8160128 8159935 8168615
. 51 Franklin St Fifth , Boston 02110 1301 USA java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
* @ build KullaTesting ExecutionControlTestBase MyExecutionControl MyRemoteExecutionControl MyExecutionControlProvider
* @ run testng UserJdiUserRemoteTest
* @ key intermittent
*/
import java.io.
import org.testng*/
/
import *@est
import static jdk.jshell.Snippet.Status.OVERWRITTEN;
static .jshell.Status.VALID
import jdk*@ Tests Aux, remote, custom implementations
import ...ExecutionControl;
import jdk.jshell.spi.ExecutionControl.ExecutionControlException;
mport org.estng.Assert assertEquals
@Test @ intermittent
public class UserJdiUserRemoteTest extends ExecutionControlTestBase /
ExecutionControl currentEC;
ByteArrayOutputStreamimport orgtestng.;
BeforeMethod
static jshell..VALIDjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
public setUp
auxStream =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
setUp >.executionEngine MyExecutionControlProvider(this null ))
}
public void testVarValue() {
VarSnippet dvauxStream ByteArrayOutputStream
String setUpbuilder- builderexecutionEngine(new MyExecutionControlProvider(this ) ));
assertEquals(vd, "1.5" );
(auxStreamtoString aDouble
}
public testExtension ExecutionControlException
assertEval(42 ;
Object =getState().varValuedv;
assertEquals(res, "ribbit" );
}
public testRedefine{
Snippet
Snippetmu=methodKey(ssertEval"ntmu){returnx ;});
Snippet c = classKey(assertEval("class C { String v() {
java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 39
assertEval
public testRedefine(
steMAIN_SNIPPET,VALIDVALID, false ,null
ste(vx, Snippetmu=(assertEval" mu){returnx *4; }" )
assertEval".v(;," "40\" java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
assertEvalCc = C())
assertEval("c.v();" , "\" #40 \"" );
assertEval("int mu() { return x * 3; }" assertEval" x=10;," "
steMAIN_SNIPPET VALID , false , null ),
ste(mu, VALID, OVERWRITTEN, false , MAIN_SNIPPET));
assertEval"c.v(;, \#30" )
assertEval("class C {assertEvalc0.(;" \#\)
(MAIN_SNIPPET ,VALID, ),
ste(c, VALID, OVERWRITTEN, false , MAIN_SNIPPET));
assertEvalc0(" \@30" )
assertEval("c = new C();" );
(".(;" "" 30 ")
assertActiveKeys();
}
}
Messung V0.5 in Prozent C=99 H=95 G=96
¤ Dauer der Verarbeitung: 0.3 Sekunden
¤
*© Formatika GbR, Deutschland