Skip to content

Commit

Permalink
[CALCITE-6580] Remove Locale.setDefault
Browse files Browse the repository at this point in the history
* Remove its usage in tests where possible
* Needed for a few tests that are testing locale translations
* If a test uses Locale.setDefault, then it is isolated to avoid affecting other tests
  • Loading branch information
normanj-bitquill committed Sep 13, 2024
1 parent 91fe118 commit 9281a3e
Show file tree
Hide file tree
Showing 4 changed files with 502 additions and 659 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import net.hydromatic.quidem.Quidem;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;

import java.sql.Connection;
Expand Down Expand Up @@ -70,18 +69,10 @@ public static void main(String[] args) throws Exception {
}
}

private Locale originalLocale;

@BeforeEach public void setup() {
originalLocale = Locale.getDefault();
Locale.setDefault(Locale.US);
MaterializationService.setThreadLocal();
}

@AfterEach public void cleanup() {
Locale.setDefault(originalLocale);
}

/** For {@link QuidemTest#test(String)} parameters. */
@Override public Collection<String> getPath() {
// Start with a test file we know exists, then find the directory and list
Expand Down
Loading

0 comments on commit 9281a3e

Please sign in to comment.