Support integer properties in breakpoint comments in debugger tests

GitOrigin-RevId: 27a65ac9b0ca9e4d3519d19b1d324d22eb5ff607
This commit is contained in:
Roland Illig
2023-03-08 11:06:40 +00:00
committed by intellij-monorepo-bot
parent 89b1cc2ee6
commit 4e1d336e51
2 changed files with 16 additions and 2 deletions
@@ -108,6 +108,20 @@ public final class BreakpointComment {
throw error("Invalid boolean value '" + value + "' for '" + name + "'", index.get(name));
}
/**
* Reads a named integer property of the breakpoint.
*/
public @Nullable Integer readIntValue(@NotNull String name) {
String value = readValue(name);
if (value == null) return null;
try {
return Integer.parseInt(value);
}
catch (NumberFormatException e) {
throw error("Invalid integer value '" + value + "' for '" + name + "'", index.get(name));
}
}
/**
* Parses a string like {@code "Included,-ExceptionTest,-com.intellij.rt.*"} into
* two lists of included and excluded class filters.
@@ -446,10 +446,10 @@ public abstract class ExecutionWithDebuggerToolsTestCase extends ExecutionTestCa
systemPrintln("LogExpression = " + logExpression);
}
String passCount = comment.readValue("Pass count");
Integer passCount = comment.readIntValue("Pass count");
if (passCount != null) {
breakpoint.setCountFilterEnabled(true);
breakpoint.setCountFilter(Integer.parseInt(passCount));
breakpoint.setCountFilter(passCount);
systemPrintln("Pass count = " + passCount);
}