Class AbstractLanguageVersionTest

  • public class AbstractLanguageVersionTest
    extends Object
    Base test class for LanguageVersion implementations.
    Each language implementation should subclass this and provide a data method.
         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 Detail

      • AbstractLanguageVersionTest

        public AbstractLanguageVersionTest​(String name,
                                           String terseName,
                                           String version,
                                           LanguageVersion expected)
        name - the name under which the language module is registered
        terseName - the terse name under which the language module is registered
        version - the specific version of the language version
        expected - the expected LanguageVersion instance
    • Method Detail

      • testGetLanguageVersionForTerseName

        public void testGetLanguageVersionForTerseName()
        Checks that the expected LanguageVersion can be found by the combination of terseName and version.
      • testFindVersionsForLanguageNameAndVersion

        public void testFindVersionsForLanguageNameAndVersion()
        Checks that the expected LanguageVersion can be found via name and version.
      • testRegisteredRulesets

        public void testRegisteredRulesets()
                                    throws Exception
        Makes sure, that for each language a "" file exists.
        Exception - any error
      • testOldRegisteredRulesets

        public void testOldRegisteredRulesets()
                                       throws Exception
        If a file still exists, test it as well.
        Exception - any error
      • testVersionsAreDistinct

        public void testVersionsAreDistinct()