Java Code Examples for org.springframework.test.jdbc.JdbcTestUtils#countRowsInTable()

The following examples show how to use org.springframework.test.jdbc.JdbcTestUtils#countRowsInTable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractSavedQueryIT.java    From find with MIT License 6 votes vote down vote up
@Test
public void checkUserNotDuplicated() throws Exception {
    final SavedQuery savedQuery1 = new SavedQuery.Builder()
            .setTitle("title1")
            .setMinScore(0)
            .build();

    final SavedQuery savedQuery2 = new SavedQuery.Builder()
            .setTitle("title2")
            .setMinScore(0)
            .build();

    createSavedQuery(savedQuery1);
    createSavedQuery(savedQuery2);

    final int userRows = JdbcTestUtils.countRowsInTable(jdbcTemplate, "find." + UserEntity.Table.NAME);
    assertThat(userRows, is(1));
}
 
Example 2
Source File: NestedTestsWithSqlScriptsAndJUnitJupiterTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
private int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 3
Source File: EventRepositoryTests.java    From spring-events with Apache License 2.0 4 votes vote down vote up
private int countNumEvents() {
	return JdbcTestUtils.countRowsInTable(jdbcTemplate, "event");
}
 
Example 4
Source File: TransactionalSqlScriptsTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
protected int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 5
Source File: TransactionalInlinedStatementsSqlScriptsTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
protected int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 6
Source File: TransactionalSqlScriptsTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
protected int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 7
Source File: TransactionalInlinedStatementsSqlScriptsTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
protected int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 8
Source File: NestedTestsWithSqlScriptsAndJUnitJupiterTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
private int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 9
Source File: TransactionalSqlScriptsTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
protected int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 10
Source File: TransactionalInlinedStatementsSqlScriptsTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
protected int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 11
Source File: NestedTestsWithSqlScriptsAndJUnitJupiterTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
private int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 12
Source File: NestedTestsWithSqlScriptsAndJUnitJupiterTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
private int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 13
Source File: AbstractTransactionalJUnit4SpringContextTests.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Convenience method for counting the rows in the given table.
 * @param tableName table name to count rows in
 * @return the number of rows in the table
 * @see JdbcTestUtils#countRowsInTable
 */
protected int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 14
Source File: AbstractTransactionalTestNGSpringContextTests.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Convenience method for counting the rows in the given table.
 * @param tableName table name to count rows in
 * @return the number of rows in the table
 * @see JdbcTestUtils#countRowsInTable
 */
protected int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 15
Source File: AbstractTransactionalTestNGSpringContextTests.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Convenience method for counting the rows in the given table.
 * @param tableName table name to count rows in
 * @return the number of rows in the table
 * @see JdbcTestUtils#countRowsInTable
 */
protected int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 16
Source File: AbstractTransactionalTestNGSpringContextTests.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Convenience method for counting the rows in the given table.
 * @param tableName table name to count rows in
 * @return the number of rows in the table
 * @see JdbcTestUtils#countRowsInTable
 */
protected int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 17
Source File: AbstractTransactionalJUnit4SpringContextTests.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Convenience method for counting the rows in the given table.
 * @param tableName table name to count rows in
 * @return the number of rows in the table
 * @see JdbcTestUtils#countRowsInTable
 */
protected int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}
 
Example 18
Source File: AbstractTransactionalJUnit4SpringContextTests.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Convenience method for counting the rows in the given table.
 * @param tableName table name to count rows in
 * @return the number of rows in the table
 * @see JdbcTestUtils#countRowsInTable
 */
protected int countRowsInTable(String tableName) {
	return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);
}