From eea9a943b374d5ff5986a18d29088906782a8a54 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Tue, 9 Feb 2016 17:00:27 +0000 Subject: [PATCH] HHH-10507 - Hibernate core test removing usage of Java 8 methods --- .../hibernate/test/schemaupdate/SchemaUpdateDelimiterTest.java | 3 ++- .../schemaupdate/foreignkeys/ForeignKeyGenerationTest.java | 3 ++- .../crossschema/CrossSchemaForeignKeyGenerationTest.java | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/SchemaUpdateDelimiterTest.java b/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/SchemaUpdateDelimiterTest.java index d784cf72c6..c1da1a5141 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/SchemaUpdateDelimiterTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/SchemaUpdateDelimiterTest.java @@ -10,6 +10,7 @@ import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import java.io.File; +import java.nio.charset.Charset; import java.nio.file.Files; import java.util.List; @@ -57,7 +58,7 @@ public class SchemaUpdateDelimiterTest { su.setFormat( false ); su.execute( Target.SCRIPT ); - List sqlLines = Files.readAllLines( output.toPath() ); + List sqlLines = Files.readAllLines( output.toPath(), Charset.defaultCharset() ); for ( String line : sqlLines ) { assertThat( "The expected delimiter is not applied " + line, diff --git a/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/foreignkeys/ForeignKeyGenerationTest.java b/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/foreignkeys/ForeignKeyGenerationTest.java index 6315828f60..ffac83dfbc 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/foreignkeys/ForeignKeyGenerationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/foreignkeys/ForeignKeyGenerationTest.java @@ -8,6 +8,7 @@ package org.hibernate.test.schemaupdate.foreignkeys; import java.io.File; import java.io.IOException; +import java.nio.charset.Charset; import java.nio.file.Files; import java.util.List; @@ -155,7 +156,7 @@ public class ForeignKeyGenerationTest extends BaseUnitTestCase { private void checkAlterTableStatement(AlterTableStatement alterTableStatement) throws Exception { final String expectedAlterTableStatement = alterTableStatement.toSQL(); - final List sqlLines = Files.readAllLines( output.toPath() ); + final List sqlLines = Files.readAllLines( output.toPath(), Charset.defaultCharset() ); boolean found = false; for ( String line : sqlLines ) { if ( line.contains( expectedAlterTableStatement ) ) { diff --git a/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/foreignkeys/crossschema/CrossSchemaForeignKeyGenerationTest.java b/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/foreignkeys/crossschema/CrossSchemaForeignKeyGenerationTest.java index 6e3a468476..623383e246 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/foreignkeys/crossschema/CrossSchemaForeignKeyGenerationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/foreignkeys/crossschema/CrossSchemaForeignKeyGenerationTest.java @@ -8,6 +8,7 @@ package org.hibernate.test.schemaupdate.foreignkeys.crossschema; import java.io.File; import java.io.IOException; +import java.nio.charset.Charset; import java.nio.file.Files; import java.util.Arrays; import java.util.Collections; @@ -71,7 +72,7 @@ public class CrossSchemaForeignKeyGenerationTest extends BaseUnitTestCase { .setFormat( false ); schemaExport.create( true, false ); - final List sqlLines = Files.readAllLines( output.toPath() ); + final List sqlLines = Files.readAllLines( output.toPath(), Charset.defaultCharset() ); assertThat( "Expected alter table SCHEMA1.Child add constraint but is : " + sqlLines.get( 4 ), sqlLines.get( 4 ).startsWith( "alter table " ),