src/test/java/org/opensrp/repository/postgres/BaseRepositoryTest.java
/**
	 * Populates the configured {@link DataSource} with data from passed scripts
	 * 
	 * @param the scripts to load
	 * @throws SQLException
	 */
Populates the configured  DataSource with data from passed scripts

@param the scripts to load
@throws SQLException
Populates the configured DataSource with data from passed scripts @param the scripts to load @throws SQLException
@Before
	public void populateDatabase() throws SQLException {
		truncateTables();
		if (getDatabaseScripts() == null || getDatabaseScripts().isEmpty())
			return;
		ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
		for (String script : getDatabaseScripts()) {
			populator.addScript(new ClassPathResource(TEST_SCRIPTS_ROOT_DIRECTORY + script));
		}
		Connection connection = null;
		try {
			connection = DataSourceUtils.getConnection(openSRPDataSource);
			populator.populate(connection);
		}
		finally {
			if (connection != null) {
				DataSourceUtils.releaseConnection(connection, openSRPDataSource);
			}
		}
	}
@ Before public void populateDatabase ( ) throws SQLException { truncateTables ( ) ; if ( getDatabaseScripts ( ) == null || getDatabaseScripts ( ) . isEmpty ( ) ) return ; ResourceDatabasePopulator populator = new ResourceDatabasePopulator ( ) ; for ( String script : getDatabaseScripts ( ) ) { populator . addScript ( new ClassPathResource ( TEST_SCRIPTS_ROOT_DIRECTORY + script ) ) ; } Connection connection = null ; try { connection = DataSourceUtils . getConnection ( openSRPDataSource ) ; populator . populate ( connection ) ; } finally { if ( connection != null ) { DataSourceUtils . releaseConnection ( connection , openSRPDataSource ) ; } } }
Populates the configured {@link DataSource} with data from passed scripts
Populates the configured { @link DataSource } with data from passed scripts