From e998c450e679fb2fb0ccd8c6cbe76b738e0ec196 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Mon, 27 Jul 2015 10:18:31 -0500 Subject: [PATCH] Add Assume PERFORMANCE to needed HtmlUnit Tests Some of the HtmlUnit Tests required an internet connection. This caused failures when running offline. This commit adds Assume PERFORMANCE to those tests so they are only ran when the PERFORMANCE group is selected. Issue: SPR-13158 --- .../web/servlet/htmlunit/DelegatingWebConnectionTests.java | 4 ++++ .../web/servlet/htmlunit/MockMvcWebClientBuilderTests.java | 6 ++++++ .../webdriver/MockMvcHtmlUnitDriverBuilderTests.java | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnectionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnectionTests.java index 3c045e14b5..1bd94d5c45 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnectionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnectionTests.java @@ -30,6 +30,8 @@ import org.springframework.stereotype.Controller; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.htmlunit.DelegatingWebConnection.DelegateWebConnection; import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import com.gargoylesoftware.htmlunit.HttpWebConnection; import com.gargoylesoftware.htmlunit.Page; @@ -122,6 +124,8 @@ public class DelegatingWebConnectionTests { @Test public void verifyExampleInClassLevelJavadoc() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + WebClient webClient = new WebClient(); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(TestController.class).build(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebClientBuilderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebClientBuilderTests.java index 27db6941b5..5cf16c6759 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebClientBuilderTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebClientBuilderTests.java @@ -31,6 +31,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.context.WebApplicationContext; @@ -80,6 +82,8 @@ public class MockMvcWebClientBuilderTests { @Test public void mockMvcSetupAndConfigureWebClient() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + this.webClient = MockMvcWebClientBuilder .mockMvcSetup(this.mockMvc) .configureWebClient(this.webClient); @@ -90,6 +94,8 @@ public class MockMvcWebClientBuilderTests { @Test public void mockMvcSetupAndCreateWebClient() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + this.webClient = MockMvcWebClientBuilder .mockMvcSetup(this.mockMvc) .createWebClient(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/MockMvcHtmlUnitDriverBuilderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/MockMvcHtmlUnitDriverBuilderTests.java index a64fc67708..f1ad918744 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/MockMvcHtmlUnitDriverBuilderTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/webdriver/MockMvcHtmlUnitDriverBuilderTests.java @@ -33,6 +33,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.context.WebApplicationContext; @@ -79,6 +81,8 @@ public class MockMvcHtmlUnitDriverBuilderTests { @Test public void mockMvcSetupAndConfigureDriver() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + this.driver = MockMvcHtmlUnitDriverBuilder .mockMvcSetup(this.mockMvc) .configureDriver(new WebConnectionHtmlUnitDriver()); @@ -89,6 +93,8 @@ public class MockMvcHtmlUnitDriverBuilderTests { @Test public void mockMvcSetupAndCreateDriver() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + this.driver = MockMvcHtmlUnitDriverBuilder .mockMvcSetup(this.mockMvc) .createDriver();