Polishing
This commit is contained in:
@@ -91,8 +91,8 @@ public class XpathExpectationsHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse the content, evaluate the XPath expression as a {@link Node}, and
|
* Parse the content, evaluate the XPath expression as a {@link Node},
|
||||||
* assert it with the given {@code Matcher<Node>}.
|
* and assert it with the given {@code Matcher<Node>}.
|
||||||
*/
|
*/
|
||||||
public void assertNode(byte[] content, String encoding, final Matcher<? super Node> matcher) throws Exception {
|
public void assertNode(byte[] content, String encoding, final Matcher<? super Node> matcher) throws Exception {
|
||||||
Document document = parseXmlByteArray(content, encoding);
|
Document document = parseXmlByteArray(content, encoding);
|
||||||
@@ -105,7 +105,6 @@ public class XpathExpectationsHelper {
|
|||||||
* @param xml the content to parse
|
* @param xml the content to parse
|
||||||
* @param encoding optional content encoding, if provided as metadata (e.g. in HTTP headers)
|
* @param encoding optional content encoding, if provided as metadata (e.g. in HTTP headers)
|
||||||
* @return the parsed document
|
* @return the parsed document
|
||||||
* @throws Exception
|
|
||||||
*/
|
*/
|
||||||
protected Document parseXmlByteArray(byte[] xml, String encoding) throws Exception {
|
protected Document parseXmlByteArray(byte[] xml, String encoding) throws Exception {
|
||||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2014 the original author or authors.
|
* Copyright 2002-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.web.context.request.async;
|
package org.springframework.web.context.request.async;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.web.context.request.async;
|
package org.springframework.web.context.request.async;
|
||||||
|
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
@@ -51,16 +52,12 @@ public interface CallableProcessingInterceptor {
|
|||||||
/**
|
/**
|
||||||
* Invoked <em>before</em> the start of concurrent handling in the original
|
* Invoked <em>before</em> the start of concurrent handling in the original
|
||||||
* thread in which the {@code Callable} is submitted for concurrent handling.
|
* thread in which the {@code Callable} is submitted for concurrent handling.
|
||||||
*
|
* <p>This is useful for capturing the state of the current thread just prior to
|
||||||
* <p>
|
|
||||||
* This is useful for capturing the state of the current thread just prior to
|
|
||||||
* invoking the {@link Callable}. Once the state is captured, it can then be
|
* invoking the {@link Callable}. Once the state is captured, it can then be
|
||||||
* transferred to the new {@link Thread} in
|
* transferred to the new {@link Thread} in
|
||||||
* {@link #preProcess(NativeWebRequest, Callable)}. Capturing the state of
|
* {@link #preProcess(NativeWebRequest, Callable)}. Capturing the state of
|
||||||
* Spring Security's SecurityContextHolder and migrating it to the new Thread
|
* Spring Security's SecurityContextHolder and migrating it to the new Thread
|
||||||
* is a concrete example of where this is useful.
|
* is a concrete example of where this is useful.
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param request the current request
|
* @param request the current request
|
||||||
* @param task the task for the current async request
|
* @param task the task for the current async request
|
||||||
* @throws Exception in case of errors
|
* @throws Exception in case of errors
|
||||||
@@ -71,7 +68,6 @@ public interface CallableProcessingInterceptor {
|
|||||||
* Invoked <em>after</em> the start of concurrent handling in the async
|
* Invoked <em>after</em> the start of concurrent handling in the async
|
||||||
* thread in which the {@code Callable} is executed and <em>before</em> the
|
* thread in which the {@code Callable} is executed and <em>before</em> the
|
||||||
* actual invocation of the {@code Callable}.
|
* actual invocation of the {@code Callable}.
|
||||||
*
|
|
||||||
* @param request the current request
|
* @param request the current request
|
||||||
* @param task the task for the current async request
|
* @param task the task for the current async request
|
||||||
* @throws Exception in case of errors
|
* @throws Exception in case of errors
|
||||||
@@ -83,7 +79,6 @@ public interface CallableProcessingInterceptor {
|
|||||||
* async thread in which the {@code Callable} is executed. This method may
|
* async thread in which the {@code Callable} is executed. This method may
|
||||||
* be invoked later than {@code afterTimeout} or {@code afterCompletion}
|
* be invoked later than {@code afterTimeout} or {@code afterCompletion}
|
||||||
* depending on when the {@code Callable} finishes processing.
|
* depending on when the {@code Callable} finishes processing.
|
||||||
*
|
|
||||||
* @param request the current request
|
* @param request the current request
|
||||||
* @param task the task for the current async request
|
* @param task the task for the current async request
|
||||||
* @param concurrentResult the result of concurrent processing, which could
|
* @param concurrentResult the result of concurrent processing, which could
|
||||||
@@ -97,7 +92,6 @@ public interface CallableProcessingInterceptor {
|
|||||||
* the {@code Callable} task completes. Implementations may return a value,
|
* the {@code Callable} task completes. Implementations may return a value,
|
||||||
* including an {@link Exception}, to use instead of the value the
|
* including an {@link Exception}, to use instead of the value the
|
||||||
* {@link Callable} did not return in time.
|
* {@link Callable} did not return in time.
|
||||||
*
|
|
||||||
* @param request the current request
|
* @param request the current request
|
||||||
* @param task the task for the current async request
|
* @param task the task for the current async request
|
||||||
* @return a concurrent result value; if the value is anything other than
|
* @return a concurrent result value; if the value is anything other than
|
||||||
@@ -110,7 +104,6 @@ public interface CallableProcessingInterceptor {
|
|||||||
/**
|
/**
|
||||||
* Invoked from a container thread when async processing completes for any
|
* Invoked from a container thread when async processing completes for any
|
||||||
* reason including timeout or network error.
|
* reason including timeout or network error.
|
||||||
*
|
|
||||||
* @param request the current request
|
* @param request the current request
|
||||||
* @param task the task for the current async request
|
* @param task the task for the current async request
|
||||||
* @throws Exception in case of errors
|
* @throws Exception in case of errors
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.web.context.request.async;
|
package org.springframework.web.context.request.async;
|
||||||
|
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2014 the original author or authors.
|
* Copyright 2002-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.web.context.request.async;
|
package org.springframework.web.context.request.async;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.web.context.request.async;
|
package org.springframework.web.context.request.async;
|
||||||
|
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2014 the original author or authors.
|
* Copyright 2002-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.web.context.request.async;
|
package org.springframework.web.context.request.async;
|
||||||
|
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2014 the original author or authors.
|
* Copyright 2002-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.web.context.request.async;
|
package org.springframework.web.context.request.async;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|||||||
Reference in New Issue
Block a user