Replace the SSDG project build.GemFireServer Gradle Plugin with STDG means of launching and managing Apache Geode servers for client/server integration tests.

This commit is contained in:
John Blum
2022-09-16 13:29:24 -07:00
parent 07844d5576
commit a1ffa1c56a
15 changed files with 203 additions and 15 deletions

View File

@@ -17,8 +17,11 @@ package sample;
import static org.assertj.core.api.Assertions.assertThat;
import java.io.IOException;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -26,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder;
@@ -34,6 +38,7 @@ import org.openqa.selenium.WebDriver;
import sample.client.Application;
import sample.pages.HomePage;
import sample.server.GemFireServer;
/**
* @author Eddú Meléndez
@@ -41,13 +46,18 @@ import sample.pages.HomePage;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.MOCK)
@AutoConfigureMockMvc
public class AttributeTests {
public class AttributeTests extends ForkingClientServerIntegrationTestsSupport {
@Autowired
private MockMvc mockMvc;
private WebDriver driver;
@BeforeClass
public static void startGeodeServer() throws IOException {
startGeodeServer(GemFireServer.class);
}
@Before
public void setup() {
this.driver = MockMvcHtmlUnitDriverBuilder.mockMvcSetup(this.mockMvc).build();

View File

@@ -35,7 +35,7 @@ import org.springframework.session.data.gemfire.config.annotation.web.http.Enabl
*/
// tag::class[]
@SpringBootApplication // <1>
@CacheServerApplication(name = "SpringSessionDataGeodeBootSampleServer", logLevel = "error") // <2>
@CacheServerApplication(name = "SpringSessionDataGeodeBootSampleServer") // <2>
@EnableGemFireHttpSession(maxInactiveIntervalInSeconds = 20) // <3>
public class GemFireServer {