Package net.sourceforge.pmd
Class AbstractLanguageVersionTest
- java.lang.Object
-
- net.sourceforge.pmd.AbstractLanguageVersionTest
-
public class AbstractLanguageVersionTest extends Object
Base test class forLanguageVersion
implementations.
Each language implementation should subclass this and provide a data method.@Parameters public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { { MyLanguageModule.NAME, MyLanguageModule.TERSE_NAME, "1.1", LanguageRegistry.getLanguage(MyLanguageModule.NAME).getVersion("1.1") }, { MyLanguageModule.NAME, MyLanguageModule.TERSE_NAME, "1.2", LanguageRegistry.getLanguage(MyLanguageModule.NAME).getVersion("1.2") }, // doesn't exist { MyLanguageModule.NAME, MyLanguageModule.TERSE_NAME, "1.3", null } });
For the parameters, see the constructor
AbstractLanguageVersionTest(String, String, String, LanguageVersion)
.
-
-
Constructor Summary
Constructors Constructor Description AbstractLanguageVersionTest(String name, String terseName, String version, LanguageVersion expected)
Creates a newAbstractLanguageVersionTest
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
testFindVersionsForLanguageNameAndVersion()
void
testGetLanguageVersionForTerseName()
void
testOldRegisteredRulesets()
If a rulesets.properties file still exists, test it as well.void
testRegisteredRulesets()
Makes sure, that for each language a "categories.properties" file exists.void
testVersionsAreDistinct()
-
-
-
Constructor Detail
-
AbstractLanguageVersionTest
public AbstractLanguageVersionTest(String name, String terseName, String version, LanguageVersion expected)
Creates a newAbstractLanguageVersionTest
- Parameters:
name
- the name under which the language module is registeredterseName
- the terse name under which the language module is registeredversion
- the specific version of the language versionexpected
- the expectedLanguageVersion
instance
-
-
Method Detail
-
testGetLanguageVersionForTerseName
public void testGetLanguageVersionForTerseName()
-
testFindVersionsForLanguageNameAndVersion
public void testFindVersionsForLanguageNameAndVersion()
-
testRegisteredRulesets
public void testRegisteredRulesets() throws Exception
Makes sure, that for each language a "categories.properties" file exists.- Throws:
Exception
- any error
-
testOldRegisteredRulesets
public void testOldRegisteredRulesets() throws Exception
If a rulesets.properties file still exists, test it as well.- Throws:
Exception
- any error
-
testVersionsAreDistinct
public void testVersionsAreDistinct()
-
-