Skip to content

Commit 6990648

Browse files
committed
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
1 parent 45e7b35 commit 6990648

File tree

2 files changed

+34
-17
lines changed

2 files changed

+34
-17
lines changed

build.gradle

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,9 @@ project("spring-core") {
371371
optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
372372
optional("org.reactivestreams:reactive-streams")
373373
optional("io.projectreactor:reactor-core")
374-
optional "io.reactivex:rxjava:${rxjavaVersion}"
375-
optional "io.reactivex:rxjava-reactive-streams:${rxjavaAdapterVersion}"
376-
optional "io.reactivex.rxjava2:rxjava:${rxjava2Version}"
374+
optional("io.reactivex:rxjava:${rxjavaVersion}")
375+
optional("io.reactivex:rxjava-reactive-streams:${rxjavaAdapterVersion}")
376+
optional("io.reactivex.rxjava2:rxjava:${rxjava2Version}")
377377
optional("io.netty:netty-buffer:${nettyVersion}")
378378
testCompile("io.projectreactor.addons:reactor-test")
379379
testCompile("javax.xml.bind:jaxb-api:${jaxbVersion}")
@@ -524,6 +524,7 @@ project("spring-oxm") {
524524
optional("org.codehaus.castor:castor-xml:1.4.1") {
525525
exclude group: 'stax', module: 'stax-api'
526526
exclude group: "org.springframework", module: "spring-context"
527+
exclude group: "commons-logging", module: "commons-logging"
527528
}
528529
optional("com.thoughtworks.xstream:xstream:${xstreamVersion}") {
529530
exclude group: 'xpp3', module: 'xpp3_min'
@@ -712,7 +713,7 @@ project("spring-web") {
712713
}
713714
optional("io.reactivex:rxjava:${rxjavaVersion}")
714715
optional("io.reactivex:rxjava-reactive-streams:${rxjavaAdapterVersion}")
715-
optional "io.reactivex.rxjava2:rxjava:${rxjava2Version}"
716+
optional("io.reactivex.rxjava2:rxjava:${rxjava2Version}")
716717
optional("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
717718
optional("io.undertow:undertow-core:${undertowVersion}")
718719
optional("org.jboss.xnio:xnio-api:${xnioVersion}")
@@ -721,8 +722,12 @@ project("spring-web") {
721722
exclude group: "stax", module: "stax-api"
722723
}
723724
optional("com.fasterxml:aalto-xml:1.0.0")
724-
optional("org.apache.httpcomponents:httpclient:${httpclientVersion}")
725-
optional("org.apache.httpcomponents:httpasyncclient:${httpasyncVersion}")
725+
optional("org.apache.httpcomponents:httpclient:${httpclientVersion}") {
726+
exclude group: "commons-logging", module: "commons-logging"
727+
}
728+
optional("org.apache.httpcomponents:httpasyncclient:${httpasyncVersion}") {
729+
exclude group: "commons-logging", module: "commons-logging"
730+
}
726731
optional("io.netty:netty-all:${nettyVersion}")
727732
optional("com.squareup.okhttp3:okhttp:${okhttp3Version}")
728733
optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
@@ -778,14 +783,16 @@ project("spring-webflux") {
778783
dependencies {
779784
compile(project(":spring-core"))
780785
compile(project(":spring-web"))
781-
compile "org.reactivestreams:reactive-streams"
782-
compile "io.projectreactor:reactor-core"
786+
compile("org.reactivestreams:reactive-streams")
787+
compile("io.projectreactor:reactor-core")
783788
optional(project(":spring-context-support")) // for FreeMarker support
784789
provided "javax.servlet:javax.servlet-api:${servletVersion}"
785790
optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
786791
optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
787792
optional("org.freemarker:freemarker:${freemarkerVersion}")
788-
optional "org.apache.httpcomponents:httpclient:${httpclientVersion}"
793+
optional("org.apache.httpcomponents:httpclient:${httpclientVersion}") {
794+
exclude group: "commons-logging", module: "commons-logging"
795+
}
789796
optional('org.webjars:webjars-locator:0.32-1')
790797
optional("io.projectreactor.ipc:reactor-netty")
791798
optional("io.reactivex:rxnetty-http:${rxnettyVersion}") {
@@ -928,7 +935,9 @@ project("spring-webmvc") {
928935
}
929936
testCompile("javax.validation:validation-api:${beanvalVersion}")
930937
testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
931-
testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
938+
testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}") {
939+
exclude group: "commons-logging", module: "commons-logging"
940+
}
932941
testCompile("commons-fileupload:commons-fileupload:${fileuploadVersion}")
933942
testCompile("commons-io:commons-io:2.5")
934943
testCompile("joda-time:joda-time:${jodaVersion}")
@@ -1034,9 +1043,11 @@ project("spring-test") {
10341043
optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
10351044
optional("org.hamcrest:hamcrest-core:${hamcrestVersion}")
10361045
optional("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
1037-
optional("net.sourceforge.htmlunit:htmlunit:2.25")
1038-
optional("org.seleniumhq.selenium:htmlunit-driver:2.25")
1039-
optional("org.seleniumhq.selenium:selenium-java:3.2.0") {
1046+
optional("net.sourceforge.htmlunit:htmlunit:2.26") {
1047+
exclude group: "commons-logging", module: "commons-logging"
1048+
}
1049+
optional("org.seleniumhq.selenium:htmlunit-driver:2.26")
1050+
optional("org.seleniumhq.selenium:selenium-java:3.3.1") {
10401051
exclude group: "io.netty", module: "netty"
10411052
}
10421053
optional("org.skyscreamer:jsonassert:1.4.0")
@@ -1064,7 +1075,9 @@ project("spring-test") {
10641075
exclude group: "org.slf4j", module: "jcl-over-slf4j"
10651076
}
10661077
testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1067-
testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
1078+
testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}") {
1079+
exclude group: "commons-logging", module: "commons-logging"
1080+
}
10681081
testCompile("javax.cache:cache-api:${cacheApiVersion}")
10691082
testCompile('de.bechte.junit:junit-hierarchicalcontextrunner:4.12.1')
10701083
testCompile('io.projectreactor.ipc:reactor-netty')

spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriverTests.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.test.web.servlet.htmlunit.webdriver;
1818

19+
import java.io.IOException;
20+
1921
import com.gargoylesoftware.htmlunit.WebConnection;
2022
import com.gargoylesoftware.htmlunit.WebRequest;
2123
import org.junit.Before;
@@ -25,6 +27,7 @@
2527
import org.junit.runner.RunWith;
2628
import org.mockito.Mock;
2729
import org.mockito.junit.MockitoJUnitRunner;
30+
import org.openqa.selenium.WebDriverException;
2831

2932
import static org.hamcrest.CoreMatchers.equalTo;
3033
import static org.hamcrest.MatcherAssert.*;
@@ -52,9 +55,10 @@ public class WebConnectionHtmlUnitDriverTests {
5255

5356
@Before
5457
public void setup() throws Exception {
55-
when(this.connection.getResponse(any(WebRequest.class))).thenThrow(new InternalError(""));
58+
when(this.connection.getResponse(any(WebRequest.class))).thenThrow(new IOException(""));
5659
}
5760

61+
5862
@Test
5963
public void getWebConnectionDefaultNotNull() {
6064
assertThat(this.driver.getWebConnection(), notNullValue());
@@ -71,8 +75,8 @@ public void setWebConnection() {
7175
this.driver.setWebConnection(this.connection);
7276
assertThat(this.driver.getWebConnection(), equalTo(this.connection));
7377

74-
this.exception.expect(InternalError.class);
78+
this.exception.expect(WebDriverException.class);
7579
this.driver.get("https://example.com");
7680
}
7781

78-
}
82+
}

0 commit comments

Comments
 (0)