Consistent formatting

This commit is contained in:
Juergen Hoeller
2016-03-24 19:22:49 +01:00
parent 2cdb0cf690
commit 517ebd1d3e
101 changed files with 681 additions and 509 deletions

View File

@@ -61,7 +61,8 @@ public class ProtobufHttpMessageConverterTests {
public void extensionRegistryNull() {
try {
new ProtobufHttpMessageConverter(null);
} catch (Exception e) {
}
catch (Exception ex) {
fail("Unable to create ProtobufHttpMessageConverter with null extensionRegistry");
}
}

View File

@@ -150,8 +150,9 @@ public class WebAsyncManagerTests {
try {
this.asyncManager.startCallableProcessing(task);
fail("Expected Exception");
}catch(Exception e) {
assertEquals(exception, e);
}
catch (Exception ex) {
assertEquals(exception, ex);
}
assertFalse(this.asyncManager.hasConcurrentResult());
@@ -162,7 +163,6 @@ public class WebAsyncManagerTests {
@Test
public void startCallableProcessingPreProcessException() throws Exception {
Callable<Object> task = new StubCallable(21);
Exception exception = new Exception();
@@ -183,7 +183,6 @@ public class WebAsyncManagerTests {
@Test
public void startCallableProcessingPostProcessException() throws Exception {
Callable<Object> task = new StubCallable(21);
Exception exception = new Exception();
@@ -205,7 +204,6 @@ public class WebAsyncManagerTests {
@Test
public void startCallableProcessingPostProcessContinueAfterException() throws Exception {
Callable<Object> task = new StubCallable(21);
Exception exception = new Exception();
@@ -231,7 +229,6 @@ public class WebAsyncManagerTests {
@Test
public void startCallableProcessingWithAsyncTask() throws Exception {
AsyncTaskExecutor executor = mock(AsyncTaskExecutor.class);
given(this.asyncWebRequest.getNativeRequest(HttpServletRequest.class)).willReturn(this.servletRequest);
@@ -259,7 +256,6 @@ public class WebAsyncManagerTests {
@Test
public void startDeferredResultProcessing() throws Exception {
DeferredResult<String> deferredResult = new DeferredResult<String>(1000L);
String concurrentResult = "abc";
@@ -282,7 +278,6 @@ public class WebAsyncManagerTests {
@Test
public void startDeferredResultProcessingBeforeConcurrentHandlingException() throws Exception {
DeferredResult<Integer> deferredResult = new DeferredResult<Integer>();
Exception exception = new Exception();
@@ -295,7 +290,7 @@ public class WebAsyncManagerTests {
this.asyncManager.startDeferredResultProcessing(deferredResult);
fail("Expected Exception");
}
catch(Exception success) {
catch (Exception success) {
assertEquals(exception, success);
}
@@ -328,7 +323,6 @@ public class WebAsyncManagerTests {
@Test
public void startDeferredResultProcessingPostProcessException() throws Exception {
DeferredResult<Integer> deferredResult = new DeferredResult<Integer>();
Exception exception = new Exception();
@@ -371,6 +365,7 @@ public class WebAsyncManagerTests {
verify(this.asyncWebRequest).dispatch();
}
private final class StubCallable implements Callable<Object> {
private Object value;
@@ -388,6 +383,7 @@ public class WebAsyncManagerTests {
}
}
@SuppressWarnings("serial")
private static class SyncTaskExecutor extends SimpleAsyncTaskExecutor {

View File

@@ -49,7 +49,8 @@ public class Spr8510Tests {
try {
cll.contextInitialized(new ServletContextEvent(sc));
fail("expected exception");
} catch (Throwable t) {
}
catch (Throwable t) {
// assert that an attempt was made to load the correct XML
assertTrue(t.getMessage(), t.getMessage().endsWith(
"Could not open ServletContext resource [/programmatic.xml]"));
@@ -75,7 +76,8 @@ public class Spr8510Tests {
try {
cll.contextInitialized(new ServletContextEvent(sc));
fail("expected exception");
} catch (Throwable t) {
}
catch (Throwable t) {
// assert that an attempt was made to load the correct XML
assertTrue(t.getMessage(), t.getMessage().endsWith(
"Could not open ServletContext resource [/from-init-param.xml]"));
@@ -98,7 +100,8 @@ public class Spr8510Tests {
try {
cll.contextInitialized(new ServletContextEvent(sc));
fail("expected exception");
} catch (Throwable t) {
}
catch (Throwable t) {
// assert that an attempt was made to load the correct XML
assertTrue(t.getMessage().endsWith(
"Could not open ServletContext resource [/from-init-param.xml]"));
@@ -125,7 +128,8 @@ public class Spr8510Tests {
try {
cll.contextInitialized(new ServletContextEvent(sc));
fail("expected exception");
} catch (Throwable t) {
}
catch (Throwable t) {
// assert that an attempt was made to load the correct XML
System.out.println(t.getMessage());
assertTrue(t.getMessage().endsWith(
@@ -150,7 +154,8 @@ public class Spr8510Tests {
try {
cll.contextInitialized(new ServletContextEvent(sc));
fail("expected exception");
} catch (Throwable t) {
}
catch (Throwable t) {
// assert that an attempt was made to load the correct XML
System.out.println(t.getMessage());
assertTrue(t.getMessage().endsWith(

View File

@@ -101,7 +101,8 @@ public class Log4jWebConfigurerTests {
try {
assertLogOutput();
} finally {
}
finally {
Log4jWebConfigurer.shutdownLogging(sc);
}
assertTrue(MockLog4jAppender.closeCalled);
@@ -132,7 +133,8 @@ public class Log4jWebConfigurerTests {
try {
assertLogOutput();
} finally {
}
finally {
listener.contextDestroyed(new ServletContextEvent(sc));
}
assertTrue(MockLog4jAppender.closeCalled);