@Test public void testGetAllMessages() { Bundle bundle = getMockBundle(); List<I18nExtension> extensions = svc.addingBundle(bundle, null); assertThat(extensions).isNotEmpty(); Map<String, String> messages = svc.getAllMessages(Locale.FRENCH); assertThat(messages).contains( MapEntry.entry("welcome", "bonjour"), MapEntry.entry("lang", "français"), MapEntry.entry("autre", "autre"), MapEntry.entry("extra", "extra") ); messages = svc.getAllMessages(Locale.CHINA); assertThat(messages).contains( MapEntry.entry("welcome", "hello"), MapEntry.entry("lang", "english"), MapEntry.entry("extra", "extra") ); assertThat(messages).doesNotContainKey("autre"); }
public Map<String, String> getAllMessages(Locale locale) { return getAllMessages(new Locale[]{locale}); }
InternationalizationServiceSingleton implements InternationalizationService,
        BundleTrackerCustomizer<List<I18nExtension>> { public Map<String, String> getAllMessages(Locale locale) { return getAllMessages(new Locale[]{locale}); } }
InternationalizationServiceSingleton implements InternationalizationService,
        BundleTrackerCustomizer<List<I18nExtension>> { public Map<String, String> getAllMessages(Locale locale) { return getAllMessages(new Locale[]{locale}); } InternationalizationServiceSingleton(BundleContext context); }
InternationalizationServiceSingleton implements InternationalizationService,
        BundleTrackerCustomizer<List<I18nExtension>> { public Map<String, String> getAllMessages(Locale locale) { return getAllMessages(new Locale[]{locale}); } InternationalizationServiceSingleton(BundleContext context); @Validate void start(); @Invalidate void stop(); @Override Locale defaultLocale(); @Override Collection<ResourceBundle> bundles(); @Override Collection<ResourceBundle> bundles(Locale locale); String get(Locale[] locales, String key, Object... args); @Override String get(Locale locale, String key, Object... args); Map<String, String> getAllMessages(Locale locale); @Override Map<String, String> getAllMessages(Locale... locales); @Override String etag(Locale locale); @Override List<I18nExtension> addingBundle(Bundle bundle, BundleEvent event); @Override void modifiedBundle(Bundle bundle, BundleEvent event, List<I18nExtension> object); @Override void removedBundle(Bundle bundle, BundleEvent event, List<I18nExtension> list); }
InternationalizationServiceSingleton implements InternationalizationService,
        BundleTrackerCustomizer<List<I18nExtension>> { public Map<String, String> getAllMessages(Locale locale) { return getAllMessages(new Locale[]{locale}); } InternationalizationServiceSingleton(BundleContext context); @Validate void start(); @Invalidate void stop(); @Override Locale defaultLocale(); @Override Collection<ResourceBundle> bundles(); @Override Collection<ResourceBundle> bundles(Locale locale); String get(Locale[] locales, String key, Object... args); @Override String get(Locale locale, String key, Object... args); Map<String, String> getAllMessages(Locale locale); @Override Map<String, String> getAllMessages(Locale... locales); @Override String etag(Locale locale); @Override List<I18nExtension> addingBundle(Bundle bundle, BundleEvent event); @Override void modifiedBundle(Bundle bundle, BundleEvent event, List<I18nExtension> object); @Override void removedBundle(Bundle bundle, BundleEvent event, List<I18nExtension> list);  }