Skip to content

Commit

Permalink
Merge branch 'master' into 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
bonita-ci committed Jan 31, 2024
2 parents a28a43d + fbf3257 commit 47429d6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 2 additions & 0 deletions bpm/bonita-web-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ configurations {
all {
// Specify woodstox version to override the version pulled by jackson-dataformat-xml (transitive dep of restlet)
resolutionStrategy.force "com.fasterxml.woodstox:woodstox-core:${Deps.woodstoxCoreVersion}"
// Specify Guava version to override the version pulled by owasp-java-html-sanitizer
resolutionStrategy.force "com.google.guava:guava:${Deps.guavaVersion}" //forcing managed version (transitive dependency of owasp-java-html-sanitizer)
}
tests
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ public class LocaleUtils {

private static final String DEFAULT_APPLICATION = "portal";

private static final I18n i18n = I18n.getInstance();

private static final Map<String, String> AVAILABLE_LOCALES = i18n.getAvailableLocalesFor(DEFAULT_APPLICATION);
private static final Map<String, String> AVAILABLE_LOCALES = I18n.getInstance()
.getAvailableLocalesFor(DEFAULT_APPLICATION);

/**
* Logger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,21 @@
import java.util.Map;

import org.bonitasoft.web.toolkit.client.common.i18n.AbstractI18n;
import org.junit.After;
import org.junit.Test;

/**
* @author Emmanuel Duchastenier
*/
public class I18nTest {

@After
public void cleanup() {
System.clearProperty(I18n.I18N_CUSTOM_DIR_PROPERTY);
final I18n i18n = I18n.getInstance();
i18n.refresh();
}

@Test
public void getStreams_should_read_from_classpath() {
final List<InputStream> streams = I18n.getInstance().getStreams(AbstractI18n.LOCALE.fr);
Expand Down Expand Up @@ -67,8 +75,6 @@ public void loadLocale_should_read_from_FS_if_custom_property_set() {
final Map<String, String> translations = i18n.getLocale(AbstractI18n.LOCALE.es);

assertThat(translations.get("test key")).isEqualTo("valor de prueba en Espanol");

System.clearProperty(I18n.I18N_CUSTOM_DIR_PROPERTY);
}

@Test
Expand All @@ -81,8 +87,6 @@ public void loadLocale_should_override_value_if_custom_property_set() {
final Map<String, String> translations = i18n.getLocale(AbstractI18n.LOCALE.fr);

assertThat(translations.get("test key")).isEqualTo("Valeur modifiée");

System.clearProperty(I18n.I18N_CUSTOM_DIR_PROPERTY);
}

@Test
Expand All @@ -97,7 +101,5 @@ public void loadLocale_should_merge_values_from_classpath_and_filesystem() {
assertThat(translations.get("test key")).isEqualTo("Valeur modifiée");
assertThat(translations.get("about")).isEqualTo("Copyright Bonitasoft 2016");
assertThat(translations.get("web site title")).isEqualTo("Bienvenue dans Bonita Portal 7+");

System.clearProperty(I18n.I18N_CUSTOM_DIR_PROPERTY);
}
}
6 changes: 6 additions & 0 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ subprojects {
description "List runtime dependencies for a specified configuration"
configurations = [project.configurations.runtimeClasspath]
}
tasks.withType(Test).configureEach {
if (!project.hasProperty("createTestReports")) {
reports.html.required = false
reports.junitXml.required = false
}
}
testlogger {
showFullStackTraces false
showCauses true
Expand Down

0 comments on commit 47429d6

Please sign in to comment.