Search in sources :

Example 1 with SourceLanguage

use of net.sourceforge.pmd.ant.SourceLanguage in project pmd by pmd.

the class AbstractLanguageVersionTest method testFindVersionsForLanguageNameAndVersion.

/**
 * Checks that the expected {@link LanguageVersion} can be found via
 * {@link #name} and {@link #version}.
 */
@Test
public void testFindVersionsForLanguageNameAndVersion() {
    SourceLanguage sourceLanguage = new SourceLanguage();
    sourceLanguage.setName(name);
    sourceLanguage.setVersion(version);
    Language language = LanguageRegistry.getLanguage(sourceLanguage.getName());
    LanguageVersion languageVersion = null;
    if (language != null) {
        languageVersion = language.getVersion(sourceLanguage.getVersion());
    }
    assertEquals(expected, languageVersion);
}
Also used : SourceLanguage(net.sourceforge.pmd.ant.SourceLanguage) SourceLanguage(net.sourceforge.pmd.ant.SourceLanguage) Language(net.sourceforge.pmd.lang.Language) LanguageVersion(net.sourceforge.pmd.lang.LanguageVersion) Test(org.junit.Test)

Aggregations

SourceLanguage (net.sourceforge.pmd.ant.SourceLanguage)1 Language (net.sourceforge.pmd.lang.Language)1 LanguageVersion (net.sourceforge.pmd.lang.LanguageVersion)1 Test (org.junit.Test)1