Polishing

This commit is contained in:
Juergen Hoeller
2018-11-20 22:06:44 +01:00
parent a3d763d137
commit 8c7579eba8
8 changed files with 60 additions and 65 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,30 +20,24 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Test suite for {@link FastByteArrayOutputStream}
* Test suite for {@link FastByteArrayOutputStream}.
*
* @author Craig Andrews
*/
public class FastByteArrayOutputStreamTests {
private static final int INITIAL_CAPACITY = 256;
private FastByteArrayOutputStream os;
private final FastByteArrayOutputStream os = new FastByteArrayOutputStream(INITIAL_CAPACITY);;
private byte[] helloBytes;
@Before
public void setUp() throws Exception {
this.os = new FastByteArrayOutputStream(INITIAL_CAPACITY);
this.helloBytes = "Hello World".getBytes("UTF-8");
}
private final byte[] helloBytes = "Hello World".getBytes(StandardCharsets.UTF_8);;
@Test

View File

@@ -45,6 +45,7 @@ public class ObjectUtilsTests {
@Rule
public final ExpectedException exception = ExpectedException.none();
@Test
public void isCheckedException() {
assertTrue(ObjectUtils.isCheckedException(new Exception()));
@@ -807,7 +808,8 @@ public class ObjectUtilsTests {
assertThat(ObjectUtils.caseInsensitiveValueOf(Tropes.values(), "BAR"), is(Tropes.BAR));
exception.expect(IllegalArgumentException.class);
exception.expectMessage(is("constant [bogus] does not exist in enum type org.springframework.util.ObjectUtilsTests$Tropes"));
exception.expectMessage(
is("Constant [bogus] does not exist in enum type org.springframework.util.ObjectUtilsTests$Tropes"));
ObjectUtils.caseInsensitiveValueOf(Tropes.values(), "bogus");
}
@@ -818,6 +820,6 @@ public class ObjectUtilsTests {
}
enum Tropes { FOO, BAR, baz }
enum Tropes {FOO, BAR, baz}
}