Class LocaleFilesTest

java.lang.Object
org.djunits.unit.LocaleFilesTest

public class LocaleFilesTest extends Object
LocaleFilesTest validates all locale property bundles for formatting rules and ensures abbreviations resolve in their locale.

Copyright (c) 2025-2026 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djunits.org. The DJUNITS project is distributed under a three-clause BSD-style license.

Author:
Alexander Verbraeck
  • Constructor Details

    • LocaleFilesTest

      public LocaleFilesTest()
  • Method Details

    • testAllLocaleFilesKeyFormat

      @Test public void testAllLocaleFilesKeyFormat()
      Validate that all keys in each locale bundle match one of the allowed patterns. Also ensure abbr values are non-blank when present.
    • testLocalizedAbbreviationsResolveForAllLocales

      @Test public <U extends UnitInterface<U, ?>> void testLocalizedAbbreviationsResolveForAllLocales()
      For every locale, ensure each 'unit. <Q>.<K>.abbr' token resolves to the registered US unit for that (Q,K) pair when that pair exists in the US map. Also check that localizedUnitTextualAbbr(locale, Q, K) returns the same token. Stores and restores default locale per iteration.
      Type Parameters:
      U - A generic unit type to use in the method