Class CpdTextComparisonTest
-
- All Implemented Interfaces:
public abstract class CpdTextComparisonTest extends BaseTextComparisonTest
CPD test comparing a dump of a file against a saved baseline. Each token is printed on a separate line.
-
-
Field Summary
Fields Modifier and Type Field Description private final CpdCapableLanguage
language
-
Constructor Summary
Constructors Constructor Description CpdTextComparisonTest(String langId, String extensionIncludingDot)
CpdTextComparisonTest(CpdCapableLanguage language, String extensionIncludingDot)
-
Method Summary
Modifier and Type Method Description final CpdCapableLanguage
getLanguage()
final CpdLexer
newCpdLexer(LanguagePropertyConfig config)
LanguagePropertyConfig
defaultProperties()
final Unit
doTest(String fileBaseName, String expectedSuffix, LanguagePropertyConfig config)
A test comparing the output of the tokenizer. final Unit
doTest(String fileBaseName, String expectedSuffix)
A test comparing the output of the tokenizer. final Unit
doTest(String fileBaseName)
A test comparing the output of the tokenizer. final LexException
expectLexException(String source, FileId fileName, LanguagePropertyConfig properties)
final LexException
expectLexException(String source, FileId fileName)
final LexException
expectLexException(String source)
final LexException
expectLexException(BaseTextComparisonTest.FileData fileData, LanguagePropertyConfig config)
final LexException
expectLexException(BaseTextComparisonTest.FileData fileData)
final BaseTextComparisonTest.FileData
sourceCodeOf(String text, FileId fileName)
final BaseTextComparisonTest.FileData
sourceCodeOf(String text)
final Tokens
tokenize(CpdLexer cpdLexer, BaseTextComparisonTest.FileData fileData)
-
-
Method Detail
-
getLanguage
final CpdCapableLanguage getLanguage()
-
newCpdLexer
final CpdLexer newCpdLexer(LanguagePropertyConfig config)
-
defaultProperties
LanguagePropertyConfig defaultProperties()
-
doTest
@JvmOverloads() final Unit doTest(String fileBaseName, String expectedSuffix, LanguagePropertyConfig config)
A test comparing the output of the tokenizer.
- Parameters:
fileBaseName
- Name of the source file (without extension or resource prefix)expectedSuffix
- Suffix to append to the expected file.config
- Properties to configure the tokenizer
-
doTest
@JvmOverloads() final Unit doTest(String fileBaseName, String expectedSuffix)
A test comparing the output of the tokenizer.
- Parameters:
fileBaseName
- Name of the source file (without extension or resource prefix)expectedSuffix
- Suffix to append to the expected file.
-
doTest
@JvmOverloads() final Unit doTest(String fileBaseName)
A test comparing the output of the tokenizer.
- Parameters:
fileBaseName
- Name of the source file (without extension or resource prefix)
-
expectLexException
@JvmOverloads() final LexException expectLexException(String source, FileId fileName, LanguagePropertyConfig properties)
-
expectLexException
@JvmOverloads() final LexException expectLexException(String source, FileId fileName)
-
expectLexException
@JvmOverloads() final LexException expectLexException(String source)
-
expectLexException
@JvmOverloads() final LexException expectLexException(BaseTextComparisonTest.FileData fileData, LanguagePropertyConfig config)
-
expectLexException
@JvmOverloads() final LexException expectLexException(BaseTextComparisonTest.FileData fileData)
-
sourceCodeOf
@JvmOverloads() final BaseTextComparisonTest.FileData sourceCodeOf(String text, FileId fileName)
-
sourceCodeOf
@JvmOverloads() final BaseTextComparisonTest.FileData sourceCodeOf(String text)
-
tokenize
final Tokens tokenize(CpdLexer cpdLexer, BaseTextComparisonTest.FileData fileData)
-
-
-
-