Class ProjectStructureManager
java.lang.Object
com.shaft.tools.io.internal.ProjectStructureManager
Initializes runtime project folders and service provider metadata files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSupported runtime execution modes used for listener bootstrapping. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDetects the active test runner from the current stack trace.identifyRunType(List<org.testng.xml.XmlSuite> suites) Detects the active test runner from the TestNG suites being altered.static voidPrepares project structure and listener registration files based on run type.
-
Constructor Details
-
ProjectStructureManager
public ProjectStructureManager()
-
-
Method Details
-
identifyRunType
Detects the active test runner from the current stack trace.- Returns:
- the inferred execution mode
-
identifyRunType
Detects the active test runner from the TestNG suites being altered.This overload exists specifically for
IAlterSuiteListener.alter(List), which TestNG invokes directly during its own suite-processing phase, before any test method (and therefore before any Cucumberio.cucumber.core.runner.Runnerstack frame) has run. At that pointidentifyRunType()'s stack probe can never observe Cucumber, even for a Cucumber-over-TestNG run (AbstractTestNGCucumberTests), so a caller at that call site is already known to be TestNG-driven — the only remaining question is whether TestNG is hosting a Cucumber runner. That is answered here by inspecting the suite's own class list instead of the call stack.- Parameters:
suites- the suites TestNG is about to run- Returns:
ProjectStructureManager.RunType.CUCUMBERwhen any suite (including suites reached transitively via<suite-file>) hosts a Cucumber TestNG runner class, whether declared directly in<classes>(with or without a<methods>filter) or discovered by a<packages>scan,ProjectStructureManager.RunType.TESTNGotherwise
-
initialize
Prepares project structure and listener registration files based on run type.- Parameters:
runType- current execution framework mode
-