From 1055aa86aaa653f59403f23674931a98436c3198 Mon Sep 17 00:00:00 2001 From: Natalia Ukhorskaya Date: Thu, 9 Oct 2014 15:58:31 +0400 Subject: [PATCH] Debugger tests: do not check breakpoint line and file extension for JDK classes --- .../debugger/tinyApp/outs/doNotSkipClassloader.out | 2 +- .../tinyApp/outs/stepIntoSpecificKotlinClasses.out | 2 +- idea/testData/debugger/tinyApp/outs/stepIntoStdlib.out | 4 ++-- .../jet/plugin/debugger/KotlinDebuggerTestBase.kt | 9 ++++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/idea/testData/debugger/tinyApp/outs/doNotSkipClassloader.out b/idea/testData/debugger/tinyApp/outs/doNotSkipClassloader.out index 8e3db3bdf17..bf5585e692d 100644 --- a/idea/testData/debugger/tinyApp/outs/doNotSkipClassloader.out +++ b/idea/testData/debugger/tinyApp/outs/doNotSkipClassloader.out @@ -2,7 +2,7 @@ LineBreakpoint created at doNotSkipClassloader.kt:7 !JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! doNotSkipClassloader.DoNotSkipClassloaderPackage Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' doNotSkipClassloader.kt:6 -ClassLoader.class:98 +ClassLoader.!EXT! Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' Process finished with exit code 0 diff --git a/idea/testData/debugger/tinyApp/outs/stepIntoSpecificKotlinClasses.out b/idea/testData/debugger/tinyApp/outs/stepIntoSpecificKotlinClasses.out index 4b864c62ac6..5b843eb2e43 100644 --- a/idea/testData/debugger/tinyApp/outs/stepIntoSpecificKotlinClasses.out +++ b/idea/testData/debugger/tinyApp/outs/stepIntoSpecificKotlinClasses.out @@ -4,7 +4,7 @@ Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socke stepIntoSpecificKotlinClasses.kt:7 MyJavaClass.java:11 stepIntoSpecificKotlinClasses.kt:7 -Intrinsics.class +Intrinsics.!EXT! stepIntoSpecificKotlinClasses.kt:7 stepIntoSpecificKotlinClasses.kt:8 Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' diff --git a/idea/testData/debugger/tinyApp/outs/stepIntoStdlib.out b/idea/testData/debugger/tinyApp/outs/stepIntoStdlib.out index f2f842bec75..176e67202f0 100644 --- a/idea/testData/debugger/tinyApp/outs/stepIntoStdlib.out +++ b/idea/testData/debugger/tinyApp/outs/stepIntoStdlib.out @@ -2,8 +2,8 @@ LineBreakpoint created at stepIntoStdlib.kt:6 !JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! stepIntoStdlib.StepIntoStdlibPackage Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' stepIntoStdlib.kt:5 -KotlinPackage.class -_Mapping.kt +KotlinPackage.!EXT! +_Mapping.!EXT! Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' Process finished with exit code 0 diff --git a/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinDebuggerTestBase.kt b/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinDebuggerTestBase.kt index 07f457decd1..b6fa82d54ac 100644 --- a/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinDebuggerTestBase.kt +++ b/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinDebuggerTestBase.kt @@ -24,6 +24,8 @@ import com.intellij.debugger.impl.PositionUtil import com.intellij.execution.process.ProcessOutputTypes import com.intellij.openapi.roots.libraries.LibraryUtil import org.jetbrains.jet.plugin.JetJdkAndLibraryProjectDescriptor +import com.intellij.openapi.roots.JdkOrderEntry +import com.intellij.openapi.util.io.FileUtil abstract class KotlinDebuggerTestBase : KotlinDebuggerTestCase() { @@ -61,9 +63,10 @@ abstract class KotlinDebuggerTestBase : KotlinDebuggerTestCase() { return@runReadAction println("VirtualFile for position is null", ProcessOutputTypes.SYSTEM) } - val isInStdlib = LibraryUtil.findLibraryEntry(virtualFile, getProject())?.getPresentableName() == JetJdkAndLibraryProjectDescriptor.LIBRARY_NAME - if (isInStdlib) { - return@runReadAction println(virtualFile.getName(), ProcessOutputTypes.SYSTEM) + val libraryEntry = LibraryUtil.findLibraryEntry(virtualFile, getProject()) + if (libraryEntry != null && (libraryEntry is JdkOrderEntry || + libraryEntry.getPresentableName() == JetJdkAndLibraryProjectDescriptor.LIBRARY_NAME)) { + return@runReadAction println(FileUtil.getNameWithoutExtension(virtualFile.getName()) + ".!EXT!", ProcessOutputTypes.SYSTEM) } println(virtualFile.getName() + ":" + sourcePosition.getLine(), ProcessOutputTypes.SYSTEM)