mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-8660 - Adding new StringUtils.getDefaultCharset() in order to wrap the Charset equivalet method.
- This test was added in order to cover the new StringUtils.getDefaultCharset().
- One cannot be sure that StringUtils.getPreferredCharset() will always be equals to Charset.defaultCharset()
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
This closes #616
This commit is contained in:
parent
245c976ad0
commit
d632d6312b
|
|
@ -52,6 +52,10 @@ public class StringUtils {
|
|||
return Charset.isSupported(UTF8);
|
||||
}
|
||||
|
||||
public static Charset getDefaultCharset() {
|
||||
return Charset.defaultCharset();
|
||||
}
|
||||
|
||||
public static String join(final Iterable<? extends Object> iterable, final String delim) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
if (iterable != null) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,11 @@ public class StringUtilsTest {
|
|||
|
||||
@Test
|
||||
public void testGetDefaultCharset() {
|
||||
assertEquals(StringUtils.getPreferredCharset(), Charset.defaultCharset());
|
||||
// Is this test irrelevant? Is wrapping the Charset.defaultCharset() too much?
|
||||
// This test was added in order to cover the new StringUtils.getDefaultCharset().
|
||||
// One cannot be sure that StringUtils.getPreferredCharset() will always be
|
||||
// equals to Charset.defaultCharset()
|
||||
assertEquals(StringUtils.getDefaultCharset(), Charset.defaultCharset());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Reference in New Issue