de.smartics.testdoc.collect.extractor
Class AbstractExtractor

Package class diagram package AbstractExtractor
java.lang.Object
  extended by de.smartics.testdoc.collect.extractor.AbstractExtractor
Direct Known Subclasses:
TestDocMethodExtractor, TestDocTypeExtractor, TestDocVariableExtractor

public abstract class AbstractExtractor
     
     
extends Object

Base implementation for Extracting unit test doc information.

Author:
Robert Reiner

Field Summary
protected  de.smartics.testdoc.collect.extractor.CategoryExtractor categoryExtractor
          Extracts category information.
protected  Elements elementUtils
          The utilities of the APT interface.
protected  de.smartics.testdoc.collect.extractor.TestDocHintsExtractor hintExtractor
          Extracts hint information.
protected  SourceCodeHelper sourceCodeHelper
          The helper to access source code information.
protected  TypeElement testCaseType
          The test case that is analyzed.
protected  de.smartics.testdoc.collect.extractor.TestDocAnnotationExtractor uutExtractor
          Extracts UUT information.
 
Constructor Summary
protected AbstractExtractor(ExtractorConfig config, TypeElement testCaseType)
          Default constructor.
 
Method Summary
protected  String calculateTestSentence(de.smartics.testdoc.collect.extractor.TestDocHintsExtractor.Hints hints, String testName)
           
protected  ScenarioTestDoc createScenarioIfElementIsTestMethod(de.smartics.testdoc.collect.extractor.TestDocAnnotationExtractor.UutInfo uutInfo, String testCaseType, ExecutableElement testMethod)
           
protected static boolean hasAnnotation(Element method, Class<? extends Annotation> annotation)
           
protected static boolean hasNotAnnotation(Element method, Class<? extends Annotation> annotation)
           
protected static boolean isTestMethodWithoutUutAnnotation(Element element)
           
abstract  UnitTestDoc readTestDoc()
          Reads the test documentation from the element the extractor instance is associated with.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elementUtils

protected final Elements elementUtils
The utilities of the APT interface.


sourceCodeHelper

protected final SourceCodeHelper sourceCodeHelper
The helper to access source code information.


testCaseType

protected final TypeElement testCaseType
The test case that is analyzed.


categoryExtractor

protected final de.smartics.testdoc.collect.extractor.CategoryExtractor categoryExtractor
Extracts category information.


hintExtractor

protected final de.smartics.testdoc.collect.extractor.TestDocHintsExtractor hintExtractor
Extracts hint information.


uutExtractor

protected final de.smartics.testdoc.collect.extractor.TestDocAnnotationExtractor uutExtractor
Extracts UUT information.

Constructor Detail

AbstractExtractor

protected AbstractExtractor(ExtractorConfig config,
                            TypeElement testCaseType)
                     throws IllegalArgumentException
Default constructor.

Parameters:
config - the configuration to access processing information.
testCaseType - the test case that has an annotation that potentially specifies the unit under test.
Throws:
IllegalArgumentException - if the declaredUutField is not a field declaration within a class or any of the arguments is null.
Method Detail

readTestDoc

public abstract UnitTestDoc readTestDoc()
Reads the test documentation from the element the extractor instance is associated with.

Returns:
the test documentation read.

createScenarioIfElementIsTestMethod

protected ScenarioTestDoc createScenarioIfElementIsTestMethod(de.smartics.testdoc.collect.extractor.TestDocAnnotationExtractor.UutInfo uutInfo,
                                                              String testCaseType,
                                                              ExecutableElement testMethod)

calculateTestSentence

protected String calculateTestSentence(de.smartics.testdoc.collect.extractor.TestDocHintsExtractor.Hints hints,
                                       String testName)

isTestMethodWithoutUutAnnotation

protected static boolean isTestMethodWithoutUutAnnotation(Element element)

hasAnnotation

protected static boolean hasAnnotation(Element method,
                                       Class<? extends Annotation> annotation)

hasNotAnnotation

protected static boolean hasNotAnnotation(Element method,
                                          Class<? extends Annotation> annotation)


Copyright © 2010-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.