Refine search
/** * Integration tests that verify support for custom SQL script syntax * configured via {@link SqlConfig @SqlConfig}. * * @author Sam Brannen * @since 4.1 */ @ContextConfiguration(classes = EmptyDatabaseConfig.class) @DirtiesContext public class CustomScriptSyntaxSqlScriptsTests extends AbstractTransactionalJUnit4SpringContextTests { @Test @Sql("schema.sql") @Sql(scripts = "data-add-users-with-custom-script-syntax.sql",// config = @SqlConfig(commentPrefix = "`", blockCommentStartDelimiter = "#$", blockCommentEndDelimiter = "$#", separator = "@@")) public void methodLevelScripts() { assertNumUsers(3); } protected void assertNumUsers(int expected) { assertEquals("Number of rows in the 'user' table.", expected, countRowsInTable("user")); } }
/** * Transactional integration tests that verify rollback semantics for * {@link Sql @Sql} support. * * @author Sam Brannen * @since 4.1 */ @ContextConfiguration(classes = PopulatedSchemaDatabaseConfig.class) @DirtiesContext public class PopulatedSchemaTransactionalSqlScriptsTests extends AbstractTransactionalJUnit4SpringContextTests { @BeforeTransaction @AfterTransaction public void verifyPreAndPostTransactionDatabaseState() { assertNumUsers(0); } @Test @SqlGroup(@Sql("data-add-dogbert.sql")) public void methodLevelScripts() { assertNumUsers(1); } protected void assertNumUsers(int expected) { assertEquals("Number of rows in the 'user' table.", expected, countRowsInTable("user")); } }
@ContextConfiguration(classes = PopulatedSchemaDatabaseConfig.class) @DirtiesContext public class IsolatedTransactionModeSqlScriptsTests extends AbstractTransactionalJUnit4SpringContextTests {
/** * @author Sam Brannen * @since 4.3 */ @ContextConfiguration(classes = EmptyDatabaseConfig.class) @DirtiesContext @SqlConfig(commentPrefix = "`", blockCommentStartDelimiter = "#$", blockCommentEndDelimiter = "$#", separator = "@@") interface SqlConfigTestInterface { }
/** * Modified copy of {@link CustomScriptSyntaxSqlScriptsTests} with * {@link SqlConfig @SqlConfig} defined at the class level. * * @author Sam Brannen * @since 4.1 */ @ContextConfiguration(classes = EmptyDatabaseConfig.class) @DirtiesContext @SqlConfig(commentPrefix = "`", blockCommentStartDelimiter = "#$", blockCommentEndDelimiter = "$#", separator = "@@") public class GlobalCustomScriptSyntaxSqlScriptsTests extends AbstractTransactionalJUnit4SpringContextTests { @Test @Sql(scripts = "schema.sql", config = @SqlConfig(separator = ";")) @Sql("data-add-users-with-custom-script-syntax.sql") public void methodLevelScripts() { assertNumUsers(3); } protected void assertNumUsers(int expected) { assertEquals("Number of rows in the 'user' table.", expected, countRowsInTable("user")); } }
/** * Integration tests that verify support for default SQL script detection. * * @author Sam Brannen * @since 4.1 */ @ContextConfiguration(classes = EmptyDatabaseConfig.class) @Sql @DirtiesContext public class DefaultScriptDetectionSqlScriptsTests extends AbstractTransactionalJUnit4SpringContextTests { @Test public void classLevel() { assertNumUsers(2); } @Test @Sql public void methodLevel() { assertNumUsers(3); } protected void assertNumUsers(int expected) { assertEquals("Number of rows in the 'user' table.", expected, countRowsInTable("user")); } }
@ContextConfiguration(classes = EmptyDatabaseConfig.class) @Sql("schema.sql") @Sql("data.sql") @DirtiesContext public class RepeatableSqlAnnotationSqlScriptsTests extends AbstractTransactionalJUnit4SpringContextTests {
@ContextConfiguration @DirtiesContext public class PrimaryDataSourceTests {
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/cassandra-dao-test-context.xml") @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public class CassandraUserServiceImplTest extends UserServiceImplTest { }
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/cassandra-dao-test-context.xml") @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public class CassandraHistoryServiceImplTest extends HistoryServiceImplTest { }
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/cassandra-dao-test-context.xml") @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public class CassandraServerProfileServiceImplTest extends ServerProfileServiceImplTest { }
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/cassandra-dao-test-context.xml") @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public class CassandraCtlSchemaServiceImplTest extends CtlServiceImplTest { }
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/cassandra-dao-test-context.xml") @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public class CassandraApplicationServiceImplTest extends ApplicationServiceImplTest { }
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/cassandra-dao-test-context.xml") @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public class CassandraEndpointServiceImplTest extends EndpointServiceImplTest { }
@ContextConfiguration @DirtiesContext public class InferredDataSourceSqlScriptsTests {
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/cassandra-dao-test-context.xml") @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public class CassandraTopicServiceImplTest extends TopicServiceImplTest { }
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/cassandra-dao-test-context.xml") @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public class CassandraProfileServiceImplTest extends ProfileServiceImplTest { }
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/cassandra-dao-test-context.xml") @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public class CassandraConfigurationServiceImplTest extends ConfigurationServiceImplTest { }
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/cassandra-dao-test-context.xml") @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public class CassandraLogSchemaServiceImplTest extends LogSchemaServiceImplTest { }
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/cassandra-dao-test-context.xml") @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public class CassandraLogAppenderServiceImplTest extends LogAppenderServiceImplTest { }