Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,33 @@
*/
package org.apache.maven.cling.transfer;

import java.util.Locale;

import org.apache.maven.api.services.MessageBuilder;
import org.apache.maven.cling.transfer.FileSizeFormat.ScaleUnit;
import org.apache.maven.internal.impl.DefaultMessageBuilder;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

class FileSizeFormatTest {
// Locale like DE uses "," and not "."
// For simplicity’s sake let test in US
static Locale original;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to use https://junit-pioneer.org/docs/default-locale-timezone/ for this (and yes I'm a maintainer of this project, together with Nicolai Parlog and others)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created https://issues.apache.org/jira/browse/MNG-8459 to follow up, right now am interested in fixing this single failure only.


@BeforeAll
static void beforeAll() {
original = Locale.getDefault();
Locale.setDefault(Locale.US);
}

@AfterAll
static void afterAll() {
Locale.setDefault(original);
}

@Test
void testNegativeSize() {
Expand Down
Loading