hprange / wounit

The WOUnit framework contains a set of utilities for testing WebObjects applications using JUnit 4.7 or later capabilities.
http://hprange.github.io/wounit/
Apache License 2.0
19 stars 18 forks source link

ERXLocalizer is not initialized properly #25

Open hprange opened 12 years ago

hprange commented 12 years ago

The ERXLocalizer class is unable to find the *.strings. It shouldn't load those files by default, but the WOUnit could provide a mechanism to initialize the localizer properly if required.

jlafourc commented 11 years ago

Hi.

We face the same problems in our unit tests. Any solutions ?

hprange commented 11 years ago

Currently, you can load the localization configuration in a static method annotated with @BeforeClass:

@BeforeClass
public static void setup() {
    ERXLocalizer.initialize();
    ERXValidationFactory.defaultFactory().configureFactory();
}

You may also have to load the Properties file manually to define the available languages and the current language.

Anyway, you can write your assertions based on the validation keys instead of the localized validation values.