Class MethodCaseExtractor
- java.lang.Object
-
- io.testomat.junit.methodexporter.extractors.MethodCaseExtractor
-
public class MethodCaseExtractor extends java.lang.ObjectExtracts test case information from parsed Java compilation units. This class identifies test methods within AST nodes and converts them to ExporterTestCase objects containing all necessary export metadata.
-
-
Constructor Summary
Constructors Constructor Description MethodCaseExtractor()MethodCaseExtractor(MethodInfoExtractor methodInfoExtractor, LabelExtractor labelExtractor, FileFinder fileFinder)Constructor for testing
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ExporterTestCase>extractTestCases(com.github.javaparser.ast.CompilationUnit cu, java.lang.String filepath)Extracts test cases from a parsed compilation unit.
-
-
-
Constructor Detail
-
MethodCaseExtractor
public MethodCaseExtractor()
-
MethodCaseExtractor
public MethodCaseExtractor(MethodInfoExtractor methodInfoExtractor, LabelExtractor labelExtractor, FileFinder fileFinder)
Constructor for testing- Parameters:
methodInfoExtractor- the method info extractorlabelExtractor- the label extractorfileFinder- the file finder
-
-
Method Detail
-
extractTestCases
public java.util.List<ExporterTestCase> extractTestCases(com.github.javaparser.ast.CompilationUnit cu, java.lang.String filepath)
Extracts test cases from a parsed compilation unit. Identifies test methods and converts them to ExporterTestCase objects with complete metadata including names, labels, code bodies, and suite hierarchy.- Parameters:
cu- the parsed compilation unit to extract fromfilepath- the source file path for reference- Returns:
- list of extracted test cases
-
-