@@ -0,0 +1,2004 @@
+/*%0A * Copyright 2002-2014 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.springframework.test.context.jdbc;%0A%0Aimport java.lang.annotation.Repeatable;%0A%0Aimport org.junit.FixMethodOrder;%0Aimport org.junit.Test;%0Aimport org.junit.runners.MethodSorters;%0Aimport org.springframework.test.annotation.DirtiesContext;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;%0A%0Aimport static org.junit.Assert.*;%0A%0A/**%0A * This is a copy of %7B@link TransactionalSqlScriptsTests%7D that verifies proper%0A * handling of %7B@link Sql @Sql%7D as a %7B@link Repeatable%7D annotation.%0A *%0A * @author Sam Brannen%0A * @since 4.1%0A */%0A@FixMethodOrder(MethodSorters.NAME_ASCENDING)%0A@ContextConfiguration(classes = EmptyDatabaseConfig.class)%0A@Sql(%22schema.sql%22)%0A@Sql(%22data.sql%22)%0A@DirtiesContext%0Apublic class RepeatableSqlAnnotationSqlScriptsTests extends AbstractTransactionalJUnit4SpringContextTests %7B%0A%0A%09@Test%0A%09// test##_ prefix is required for @FixMethodOrder.%0A%09public void test01_classLevelScripts() %7B%0A%09%09assertNumUsers(1);%0A%09%7D%0A%0A%09@Test%0A%09@Sql(%22drop-schema.sql%22)%0A%09@Sql(%22schema.sql%22)%0A%09@Sql(%22data.sql%22)%0A%09@Sql(%22data-add-dogbert.sql%22)%0A%09// test##_ prefix is required for @FixMethodOrder.%0A%09public void test02_methodLevelScripts() %7B%0A%09%09assertNumUsers(2);%0A%09%7D%0A%0A%09protected void assertNumUsers(int expected) %7B%0A%09%09assertEquals(%22Number of rows in the 'user' table.%22, expected, countRowsInTable(%22user%22));%0A%09%7D%0A%0A%7D%0A

Introduce repeatable @Sql tests