Background: I built component X. Component X has OSGI-INF/l10n/messages.properties. In component X, ResourceBundle.getBundle works fine when unit testing X in its own project.
Problem: When component X is referenced (via Maven) from separate project Y, Y invokes X, and the call to ResourceBundle.getBundle down inside X brings back a bundle missing the properties defined in X.
I've read the "Understanding Bundles Deployment" docs and looking at the framework code it looks like the DeploymentPreprocessor.java class is responsible to process the OSGI-INF/deployment-fragment.xml files and merge all the various component properties into a single messages.properties, messages_xx_yy.properties, etc. However, it does not appear that DeploymentPreprocessor.java runs in the unit test environment.
I could duplicate the properties X needs in the Y project, so that X doesn't fail. This seems bad. Does anyone have a best practice here? (Or maybe I'm just doing something wrong?)