<commit_before>package org.ybiquitous.messages.scala

import java.util.Locale

import org.hamcrest.CoreMatchers._
import org.junit.Test
import org.junit.Assert.assertThat

class MessageKeyTest {

  @Test def simple() {
    val key = MessageKey("test.key")
    assertThat(key.get(1, 2, "3"), is("1 足す 2 は 3"))
    assertThat(key.key, is("test.key"))
  }

  @Test def locale() {<commit_msg>fix test depending on default locale (environment)<commit_after>package org.ybiquitous.messages.scala

import java.util.Locale

import org.hamcrest.CoreMatchers._
import org.junit.{ Test, Before, After }
import org.junit.Assert.assertThat

class MessageKeyTest {

  private var saveLocale: Locale = _

  @Before def before() {
    saveLocale = Locale.getDefault
    Locale.setDefault(Locale.JAPAN)
  }

  @After def after() {
    Locale.setDefault(saveLocale)
  }

  @Test def simple() {
    val key = MessageKey("test.key")
    assertThat(key.get(1, 2, "3"), is("1 足す 2 は 3"))
    assertThat(key.key, is("test.key"))
  }

  @Test def locale() {
{'fraction_non_alphanumeric': 0.13262342691190707, 'fraction_numerical': 0.011616650532429816, 'mean_word_length': 3.9004739336492893, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5015427', 'n_tokens_mistral': 369, 'n_tokens_neox': 355, 'n_words': 85}