Revert "Update tests to shut down in-memory databases proactively"

For reasons I don't (yet?) understand, shutting down the databases
proactively triggers a StackOverflowError in Jersey. Reverting the
change while I try to figure out what's going in.
pull/4095/head
Andy Wilkinson 9 years ago
parent 72122ec965
commit 5c35d89fd1

@ -56,8 +56,7 @@ public class DataSourceInitializerTests {
EmbeddedDatabaseConnection.override = null;
EnvironmentTestUtils.addEnvironment(this.context,
"spring.datasource.initialize:false",
"spring.datasource.url:jdbc:hsqldb:mem:testdb-" + new Random().nextInt()
+ ";shutdown=true");
"spring.datasource.url:jdbc:hsqldb:mem:testdb-" + new Random().nextInt());
}
@After

@ -19,14 +19,12 @@ package org.springframework.boot.autoconfigure.orm.jpa;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@ -73,13 +71,6 @@ public abstract class AbstractJpaAutoConfigurationTests {
protected AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
@Before
public void setup() {
EnvironmentTestUtils.addEnvironment(this.context,
"spring.datasource.url:jdbc:hsqldb:mem:testdb-" + new Random().nextInt()
+ ";shutdown=true");
}
@After
public void close() {
this.context.close();

@ -297,7 +297,7 @@ public class SecurityAutoConfigurationTests {
this.context = new AnnotationConfigWebApplicationContext();
this.context.setServletContext(new MockServletContext());
EnvironmentTestUtils.addEnvironment(this.context,
"spring.datasource.url:jdbc:hsqldb:mem:testsecdb;shutdown=true");
"spring.datasource.url:jdbc:hsqldb:mem:testsecdb");
this.context.register(EntityConfiguration.class,
PropertyPlaceholderAutoConfiguration.class,
DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class,

@ -29,7 +29,6 @@ import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
@ -43,7 +42,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(JpaUserDetailsTests.Main.class)
@DirtiesContext
@TestPropertySource(properties = "spring.datasource.url:jdbc:hsqldb:mem:testdb;shutdown=true")
public class JpaUserDetailsTests {
@Test

Loading…
Cancel
Save