mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Fix unittest issue when you are in a locale that uses comma for decimal separation.
This commit is contained in:
parent
ea5f318c9d
commit
6c770958f1
@ -18,12 +18,15 @@ package com.cloud.utils;
|
|||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class NumbersUtilTest {
|
public class NumbersUtilTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void toReadableSize() {
|
public void toReadableSize() {
|
||||||
|
Locale.setDefault(Locale.US); // Fixed locale for the test
|
||||||
assertEquals("1.0000 TB", NumbersUtil.toReadableSize((1024l * 1024l * 1024l * 1024l)));
|
assertEquals("1.0000 TB", NumbersUtil.toReadableSize((1024l * 1024l * 1024l * 1024l)));
|
||||||
assertEquals("1.00 GB", NumbersUtil.toReadableSize(1024 * 1024 * 1024));
|
assertEquals("1.00 GB", NumbersUtil.toReadableSize(1024 * 1024 * 1024));
|
||||||
assertEquals("1.00 MB", NumbersUtil.toReadableSize(1024 * 1024));
|
assertEquals("1.00 MB", NumbersUtil.toReadableSize(1024 * 1024));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user