spring-projects / spring-framework

Spring Framework
https://spring.io/projects/spring-framework
Apache License 2.0
56.59k stars 38.13k forks source link

Add possibility to select another charset for SQL scripts in AbstractTransactionalDataSourceSpringContextTests [SPR-4513] #9190

Closed spring-projects-issues closed 12 years ago

spring-projects-issues commented 16 years ago

Thierry Monney opened SPR-4513 and commented

The method AbstractTransactionalDataSourceSpringContextTests.executeSqlScript uses the platform's default encoding/charset when loading the SQL script. This makes our unit tests fail because they use i18n'ed values that are incorrectly interpreted by the InputStreamReader specified at line 148 (in version 2.0.8, I do not have access to a more recent version at the moment):

LineNumberReader lnr = new LineNumberReader(new InputStreamReader(res.getInputStream()));

should be

LineNumberReader lnr = new LineNumberReader(new InputStreamReader(res.getInputStream(), encoding));

with the encoding variable maybe set by dependency injection :-)


No further details from SPR-4513

spring-projects-issues commented 16 years ago

Juergen Hoeller commented

Thanks for the suggestion! I've added a configurable "sqlScriptEncoding" property to all our AbstractTransactionalXxxSpringContextTests variants (also the one from Spring 2.5's test context framework for JUnit4 and TestNG).

Juergen