Class RunConfigurations
- All Implemented Interfaces:
ContextProvider, PropertyChangeSource, Rebindable
A beyond-parity capability with no NetBeans equivalent: it uses the platform
RunManager/ProgramRunnerUtil to enumerate configured run configurations and
execute them with the standard Run executor. Test configurations (JUnit/TestNG/etc.) run the
same way; their results appear in the IDE's Run/Test tool window. Capturing structured test
results programmatically is deferred (it requires attaching to the test process's event
listener).
- Author:
- anahata
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PatternRegex pattern to detect Maven/Gradle build status lines.private static final PatternRegex pattern to detect test failure and error details.private static final PatternRegex patterns to detect test runner summary lines across Maven, Gradle, JUnit, and TestNG.Fields inherited from class AnahataToolkit
childrenProviders, propertyChangeSupportFields inherited from class ToolContext
toolkit -
Constructor Summary
ConstructorsConstructorDescriptionConstructs the RunConfigurations toolkit (instantiated reflectively via its public no-arg constructor). -
Method Summary
Modifier and TypeMethodDescriptionprivate StringexecuteWithStructuredWait(com.intellij.openapi.project.Project project, com.intellij.execution.RunnerAndConfigurationSettings settings, int timeoutSeconds) Executes a configuration synchronously while capturing process output and waiting for termination.Lists every run configuration across all open projects.runConfiguration(String name, Integer timeoutSeconds) Launches a run configuration by name using the standard Run executor.Methods inherited from class AnahataToolkit
getChildrenProviders, getDescription, getId, getName, getParentProvider, getPropertyChangeSupport, initialize, isEffectivelyProviding, postActivate, rebindMethods inherited from class ToolContext
addAttachment, addAttachment, addAttachment, addAttachment, error, error, error, getAgi, getApplicationMap, getAsiContainer, getAsiContainerMap, getCall, getExecutorService, getModelId, getModelMessage, getResourceManager, getResponse, getSessionMap, getThreadSafeLogger, getTool, getToolContext, getToolkit, getToolManager, getTurnMap, isToolExecution, log, peekResponse, runAsyncMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContextProvider
getAgi, getContextPosition, getFlattenedHierarchy, getFullyQualifiedId, getHeader, getIconId, getInstructionsTokenCount, getRagTokenCount, getSystemInstructions, isProviding, populateMessage, setParentProvider, setProviding
-
Field Details
-
TEST_SUMMARY_PATTERN
Regex patterns to detect test runner summary lines across Maven, Gradle, JUnit, and TestNG. -
TEST_FAILURE_PATTERN
Regex pattern to detect test failure and error details. -
BUILD_STATUS_PATTERN
Regex pattern to detect Maven/Gradle build status lines.
-
-
Constructor Details
-
RunConfigurations
public RunConfigurations()Constructs the RunConfigurations toolkit (instantiated reflectively via its public no-arg constructor).
-
-
Method Details
-
listRunConfigurations
Lists every run configuration across all open projects.- Returns:
- a Markdown listing of configuration names, types and owning project.
-
runConfiguration
Launches a run configuration by name using the standard Run executor.The configuration is looked up across open projects. If a positive timeout is specified, this method subscribes to
ExecutionManager.EXECUTION_TOPIC, captures console output, waits for process termination, and returns a structured summary including exit code, duration, and test/build outcomes. Otherwise, execution runs asynchronously.- Parameters:
name- the exact configuration name.timeoutSeconds- optional timeout in seconds to wait for execution to complete. 0 ornulllaunches asynchronously without blocking.- Returns:
- a structured summary of the execution or a launch confirmation.
- Throws:
AgiToolException- if no configuration with that name exists or waiting is interrupted.
-
executeWithStructuredWait
private String executeWithStructuredWait(com.intellij.openapi.project.Project project, com.intellij.execution.RunnerAndConfigurationSettings settings, int timeoutSeconds) throws AgiToolException Executes a configuration synchronously while capturing process output and waiting for termination.- Parameters:
project- the host project.settings- the configuration settings.timeoutSeconds- timeout duration in seconds.- Returns:
- structured execution summary.
- Throws:
AgiToolException- if execution wait fails.
-

