Class MethodCaseExtractor


  • public class MethodCaseExtractor
    extends java.lang.Object
    Extracts 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 Detail

      • MethodCaseExtractor

        public MethodCaseExtractor()
      • MethodCaseExtractor

        public MethodCaseExtractor​(MethodInfoExtractor methodInfoExtractor,
                                   LabelExtractor labelExtractor,
                                   FileFinder fileFinder)
        Constructor for testing
        Parameters:
        methodInfoExtractor - the method info extractor
        labelExtractor - the label extractor
        fileFinder - 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 from
        filepath - the source file path for reference
        Returns:
        list of extracted test cases