|
| 1 | +/* |
| 2 | + * Copyright 2002-2012 the original author or authors. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +package org.springframework.test.context.junit4.spr8849; |
| 18 | + |
| 19 | +import org.junit.runner.RunWith; |
| 20 | +import org.junit.runners.Suite; |
| 21 | +import org.junit.runners.Suite.SuiteClasses; |
| 22 | + |
| 23 | +/** |
| 24 | + * Test suite to investigate claims raised in |
| 25 | + * <a href="https://jira.springsource.org/browse/SPR-8849">SPR-8849</a>. |
| 26 | + * |
| 27 | + * <p>By using a SpEL expression to generate a random {@code id} for the |
| 28 | + * embedded database (see {@code datasource-config.xml}), we ensure that each |
| 29 | + * {@code ApplicationContext} that imports the common configuration will create |
| 30 | + * an embedded database with a unique name (since the {@code id} is used as the |
| 31 | + * database name within |
| 32 | + * {@link org.springframework.jdbc.config.EmbeddedDatabaseBeanDefinitionParser#useIdAsDatabaseNameIfGiven()}). |
| 33 | + * |
| 34 | + * <p>To reproduce the problem mentioned in SPEX-8849, change the {@code id} of |
| 35 | + * the embedded database in {@code datasource-config.xml} to "dataSource" (or |
| 36 | + * anything else that is not random) and run this <em>suite</em>. |
| 37 | + * |
| 38 | + * @author Sam Brannen |
| 39 | + * @since 3.2 |
| 40 | + */ |
| 41 | +@RunWith(Suite.class) |
| 42 | +@SuiteClasses({ TestClass1.class, TestClass2.class }) |
| 43 | +public class Spr8849Tests { |
| 44 | + |
| 45 | +} |
0 commit comments