Consistent license header

This commit is contained in:
Juergen Hoeller
2016-04-11 20:49:38 +02:00
parent d695f65e7c
commit 537193a4e0
76 changed files with 834 additions and 687 deletions

View File

@@ -1,17 +1,17 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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. You may obtain a copy of
* the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.test.web.servlet.htmlunit;

View File

@@ -1,17 +1,17 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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. You may obtain a copy of
* the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.test.web.servlet.htmlunit;

View File

@@ -1,17 +1,17 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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. You may obtain a copy of
* the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.test.web.servlet.htmlunit;

View File

@@ -1,17 +1,17 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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. You may obtain a copy of
* the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.test.web.servlet.htmlunit;

View File

@@ -1,17 +1,17 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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. You may obtain a copy of
* the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.test.web.servlet.htmlunit;

View File

@@ -1,17 +1,17 @@
/*
* Copyright 2002-2016 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. You may obtain a copy of
* the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.test.web.servlet.htmlunit;

View File

@@ -1,17 +1,17 @@
/*
* Copyright 2002-2016 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. You may obtain a copy of
* the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.test.web.servlet.htmlunit;

View File

@@ -1,17 +1,17 @@
/*
* Copyright 2002-2016 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. You may obtain a copy of
* the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.test.web.servlet.htmlunit;
@@ -44,6 +44,7 @@ final class MockWebResponseBuilder {
private static final String DEFAULT_STATUS_MESSAGE = "N/A";
private final long startTime;
private final WebRequest webRequest;
@@ -59,6 +60,7 @@ final class MockWebResponseBuilder {
this.response = response;
}
public WebResponse build() throws IOException {
WebResponseData webResponseData = webResponseData();
long endTime = System.currentTimeMillis();

View File

@@ -1,17 +1,17 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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. You may obtain a copy of
* the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.test.web.servlet.htmlunit;
@@ -27,7 +27,9 @@ import com.gargoylesoftware.htmlunit.WebRequest;
* <p>For example, if you would like to match on the domain {@code code.jquery.com},
* you might want to use the following.
*
* <pre class="code">WebRequestMatcher cdnMatcher = new UrlRegexRequestMatcher(".*?//code.jquery.com/.*");</pre>
* <pre class="code">
* WebRequestMatcher cdnMatcher = new UrlRegexRequestMatcher(".*?//code.jquery.com/.*");
* </pre>
*
* @author Rob Winch
* @author Sam Brannen
@@ -38,6 +40,7 @@ public final class UrlRegexRequestMatcher implements WebRequestMatcher {
private final Pattern pattern;
public UrlRegexRequestMatcher(String regex) {
this.pattern = Pattern.compile(regex);
}
@@ -46,6 +49,7 @@ public final class UrlRegexRequestMatcher implements WebRequestMatcher {
this.pattern = pattern;
}
@Override
public boolean matches(WebRequest request) {
String url = request.getUrl().toExternalForm();

View File

@@ -1,17 +1,17 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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. You may obtain a copy of
* the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.test.web.servlet.htmlunit;

View File

@@ -1,17 +1,17 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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. You may obtain a copy of
* the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.test.web.servlet.htmlunit.webdriver;
@@ -69,7 +69,7 @@ public class MockMvcHtmlUnitDriverBuilder extends MockMvcWebConnectionBuilderSup
/**
* Create a new {@code MockMvcHtmlUnitDriverBuilder} based on the supplied
* {@link MockMvc} instance.
* @param mockMvc the {@code MockMvc} instance to use; never {@code null}
* @param mockMvc the {@code MockMvc} instance to use (never {@code null})
* @return the MockMvcHtmlUnitDriverBuilder to customize
*/
public static MockMvcHtmlUnitDriverBuilder mockMvcSetup(MockMvc mockMvc) {
@@ -81,7 +81,7 @@ public class MockMvcHtmlUnitDriverBuilder extends MockMvcWebConnectionBuilderSup
* Create a new {@code MockMvcHtmlUnitDriverBuilder} based on the supplied
* {@link WebApplicationContext}.
* @param context the {@code WebApplicationContext} to create a {@link MockMvc}
* instance from; never {@code null}
* instance from (never {@code null})
* @return the MockMvcHtmlUnitDriverBuilder to customize
*/
public static MockMvcHtmlUnitDriverBuilder webAppContextSetup(WebApplicationContext context) {
@@ -93,8 +93,8 @@ public class MockMvcHtmlUnitDriverBuilder extends MockMvcWebConnectionBuilderSup
* Create a new {@code MockMvcHtmlUnitDriverBuilder} based on the supplied
* {@link WebApplicationContext} and {@link MockMvcConfigurer}.
* @param context the {@code WebApplicationContext} to create a {@link MockMvc}
* instance from; never {@code null}
* @param configurer the {@code MockMvcConfigurer} to apply; never {@code null}
* instance from (never {@code null})
* @param configurer the {@code MockMvcConfigurer} to apply (never {@code null})
* @return the MockMvcHtmlUnitDriverBuilder to customize
*/
public static MockMvcHtmlUnitDriverBuilder webAppContextSetup(WebApplicationContext context,
@@ -122,7 +122,7 @@ public class MockMvcHtmlUnitDriverBuilder extends MockMvcWebConnectionBuilderSup
* {@linkplain #build built} by this builder should delegate to when
* processing non-{@linkplain WebRequestMatcher matching} requests.
* @param driver the {@code WebConnectionHtmlUnitDriver} to delegate to
* for requests that do not match; never {@code null}
* for requests that do not match (never {@code null})
* @return this builder for further customizations
* @see #build()
*/

View File

@@ -1,17 +1,17 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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. You may obtain a copy of
* the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.test.web.servlet.htmlunit.webdriver;
@@ -41,13 +41,14 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver {
private WebClient webClient;
public WebConnectionHtmlUnitDriver(BrowserVersion browserVersion) {
super(browserVersion);
}
public WebConnectionHtmlUnitDriver() {
}
public WebConnectionHtmlUnitDriver(BrowserVersion browserVersion) {
super(browserVersion);
}
public WebConnectionHtmlUnitDriver(boolean enableJavascript) {
super(enableJavascript);
}
@@ -58,12 +59,10 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver {
/**
* Modify the supplied {@link WebClient} and retain a reference to it
* so that its {@link WebConnection} is {@linkplain #getWebConnection
* accessible} for later use.
* <p>Delegates to {@link HtmlUnitDriver#modifyWebClient(WebClient)}
* for default behavior and to {@link #modifyWebClientInternal(WebClient)}
* for further customization.
* Modify the supplied {@link WebClient} and retain a reference to it so that its
* {@link WebConnection} is {@linkplain #getWebConnection accessible} for later use.
* <p>Delegates to {@link HtmlUnitDriver#modifyWebClient} for default behavior
* and to {@link #modifyWebClientInternal} for further customization.
* @param webClient the client to modify
* @return the modified client
* @see HtmlUnitDriver#modifyWebClient(WebClient)
@@ -78,8 +77,7 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver {
/**
* Modify the supplied {@link WebClient}.
* <p>The default implementation simply returns the supplied client
* unmodified.
* <p>The default implementation simply returns the supplied client unmodified.
* <p>Subclasses can override this method to customize the {@code WebClient}
* that the {@link HtmlUnitDriver} uses.
* @param webClient the client to modify
@@ -90,16 +88,15 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver {
}
/**
* Access the current {@link WebConnection} for the {@link WebClient}.
* @return the current {@code WebConnection}
* Return the current {@link WebClient}.
*/
public WebConnection getWebConnection() {
return this.webClient.getWebConnection();
public WebClient getWebClient() {
return this.webClient;
}
/**
* Set the {@link WebConnection} to be used with the {@link WebClient}.
* @param webConnection the {@code WebConnection} to use; never {@code null}
* @param webConnection the {@code WebConnection} to use (never {@code null})
*/
public void setWebConnection(WebConnection webConnection) {
Assert.notNull(webConnection, "WebConnection must not be null");
@@ -107,10 +104,11 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver {
}
/**
* Gets the current {@link WebClient}
* @return the current {@link WebClient}
* Access the current {@link WebConnection} for the {@link WebClient}.
* @return the current {@code WebConnection}
*/
public WebClient getWebClient() {
return this.webClient;
public WebConnection getWebConnection() {
return this.webClient.getWebConnection();
}
}

View File

@@ -1,14 +1,17 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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. You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.test.web.servlet.setup;