Applicable commons-logging excludes for libraries (HtmlUnit, Castor XML, Apache HttpClient)

Includes upgrade to HtmlUnit 2.26 and Selenium 3.3.1.

Issue: SPR-14512
This commit is contained in:
Juergen Hoeller
2017-04-06 09:52:56 +02:00
parent 45e7b350bd
commit 699064870f
2 changed files with 34 additions and 17 deletions

View File

@@ -371,9 +371,9 @@ project("spring-core") {
optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
optional("org.reactivestreams:reactive-streams")
optional("io.projectreactor:reactor-core")
optional "io.reactivex:rxjava:${rxjavaVersion}"
optional "io.reactivex:rxjava-reactive-streams:${rxjavaAdapterVersion}"
optional "io.reactivex.rxjava2:rxjava:${rxjava2Version}"
optional("io.reactivex:rxjava:${rxjavaVersion}")
optional("io.reactivex:rxjava-reactive-streams:${rxjavaAdapterVersion}")
optional("io.reactivex.rxjava2:rxjava:${rxjava2Version}")
optional("io.netty:netty-buffer:${nettyVersion}")
testCompile("io.projectreactor.addons:reactor-test")
testCompile("javax.xml.bind:jaxb-api:${jaxbVersion}")
@@ -524,6 +524,7 @@ project("spring-oxm") {
optional("org.codehaus.castor:castor-xml:1.4.1") {
exclude group: 'stax', module: 'stax-api'
exclude group: "org.springframework", module: "spring-context"
exclude group: "commons-logging", module: "commons-logging"
}
optional("com.thoughtworks.xstream:xstream:${xstreamVersion}") {
exclude group: 'xpp3', module: 'xpp3_min'
@@ -712,7 +713,7 @@ project("spring-web") {
}
optional("io.reactivex:rxjava:${rxjavaVersion}")
optional("io.reactivex:rxjava-reactive-streams:${rxjavaAdapterVersion}")
optional "io.reactivex.rxjava2:rxjava:${rxjava2Version}"
optional("io.reactivex.rxjava2:rxjava:${rxjava2Version}")
optional("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
optional("io.undertow:undertow-core:${undertowVersion}")
optional("org.jboss.xnio:xnio-api:${xnioVersion}")
@@ -721,8 +722,12 @@ project("spring-web") {
exclude group: "stax", module: "stax-api"
}
optional("com.fasterxml:aalto-xml:1.0.0")
optional("org.apache.httpcomponents:httpclient:${httpclientVersion}")
optional("org.apache.httpcomponents:httpasyncclient:${httpasyncVersion}")
optional("org.apache.httpcomponents:httpclient:${httpclientVersion}") {
exclude group: "commons-logging", module: "commons-logging"
}
optional("org.apache.httpcomponents:httpasyncclient:${httpasyncVersion}") {
exclude group: "commons-logging", module: "commons-logging"
}
optional("io.netty:netty-all:${nettyVersion}")
optional("com.squareup.okhttp3:okhttp:${okhttp3Version}")
optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
@@ -778,14 +783,16 @@ project("spring-webflux") {
dependencies {
compile(project(":spring-core"))
compile(project(":spring-web"))
compile "org.reactivestreams:reactive-streams"
compile "io.projectreactor:reactor-core"
compile("org.reactivestreams:reactive-streams")
compile("io.projectreactor:reactor-core")
optional(project(":spring-context-support")) // for FreeMarker support
provided "javax.servlet:javax.servlet-api:${servletVersion}"
optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
optional("org.freemarker:freemarker:${freemarkerVersion}")
optional "org.apache.httpcomponents:httpclient:${httpclientVersion}"
optional("org.apache.httpcomponents:httpclient:${httpclientVersion}") {
exclude group: "commons-logging", module: "commons-logging"
}
optional('org.webjars:webjars-locator:0.32-1')
optional("io.projectreactor.ipc:reactor-netty")
optional("io.reactivex:rxnetty-http:${rxnettyVersion}") {
@@ -928,7 +935,9 @@ project("spring-webmvc") {
}
testCompile("javax.validation:validation-api:${beanvalVersion}")
testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}") {
exclude group: "commons-logging", module: "commons-logging"
}
testCompile("commons-fileupload:commons-fileupload:${fileuploadVersion}")
testCompile("commons-io:commons-io:2.5")
testCompile("joda-time:joda-time:${jodaVersion}")
@@ -1034,9 +1043,11 @@ project("spring-test") {
optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
optional("org.hamcrest:hamcrest-core:${hamcrestVersion}")
optional("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
optional("net.sourceforge.htmlunit:htmlunit:2.25")
optional("org.seleniumhq.selenium:htmlunit-driver:2.25")
optional("org.seleniumhq.selenium:selenium-java:3.2.0") {
optional("net.sourceforge.htmlunit:htmlunit:2.26") {
exclude group: "commons-logging", module: "commons-logging"
}
optional("org.seleniumhq.selenium:htmlunit-driver:2.26")
optional("org.seleniumhq.selenium:selenium-java:3.3.1") {
exclude group: "io.netty", module: "netty"
}
optional("org.skyscreamer:jsonassert:1.4.0")
@@ -1064,7 +1075,9 @@ project("spring-test") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}
testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}") {
exclude group: "commons-logging", module: "commons-logging"
}
testCompile("javax.cache:cache-api:${cacheApiVersion}")
testCompile('de.bechte.junit:junit-hierarchicalcontextrunner:4.12.1')
testCompile('io.projectreactor.ipc:reactor-netty')

View File

@@ -16,6 +16,8 @@
package org.springframework.test.web.servlet.htmlunit.webdriver;
import java.io.IOException;
import com.gargoylesoftware.htmlunit.WebConnection;
import com.gargoylesoftware.htmlunit.WebRequest;
import org.junit.Before;
@@ -25,6 +27,7 @@ import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.openqa.selenium.WebDriverException;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.*;
@@ -52,9 +55,10 @@ public class WebConnectionHtmlUnitDriverTests {
@Before
public void setup() throws Exception {
when(this.connection.getResponse(any(WebRequest.class))).thenThrow(new InternalError(""));
when(this.connection.getResponse(any(WebRequest.class))).thenThrow(new IOException(""));
}
@Test
public void getWebConnectionDefaultNotNull() {
assertThat(this.driver.getWebConnection(), notNullValue());
@@ -71,8 +75,8 @@ public class WebConnectionHtmlUnitDriverTests {
this.driver.setWebConnection(this.connection);
assertThat(this.driver.getWebConnection(), equalTo(this.connection));
this.exception.expect(InternalError.class);
this.exception.expect(WebDriverException.class);
this.driver.get("https://example.com");
}
}
}