HHH-10507 - Hibernate core test removing usage of Java 8 methods
This commit is contained in:
parent
57b32543ed
commit
eea9a943b3
|
@ -10,6 +10,7 @@ import javax.persistence.Entity;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -57,7 +58,7 @@ public class SchemaUpdateDelimiterTest {
|
||||||
su.setFormat( false );
|
su.setFormat( false );
|
||||||
su.execute( Target.SCRIPT );
|
su.execute( Target.SCRIPT );
|
||||||
|
|
||||||
List<String> sqlLines = Files.readAllLines( output.toPath() );
|
List<String> sqlLines = Files.readAllLines( output.toPath(), Charset.defaultCharset() );
|
||||||
for ( String line : sqlLines ) {
|
for ( String line : sqlLines ) {
|
||||||
assertThat(
|
assertThat(
|
||||||
"The expected delimiter is not applied " + line,
|
"The expected delimiter is not applied " + line,
|
||||||
|
|
|
@ -8,6 +8,7 @@ package org.hibernate.test.schemaupdate.foreignkeys;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -155,7 +156,7 @@ public class ForeignKeyGenerationTest extends BaseUnitTestCase {
|
||||||
private void checkAlterTableStatement(AlterTableStatement alterTableStatement)
|
private void checkAlterTableStatement(AlterTableStatement alterTableStatement)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
final String expectedAlterTableStatement = alterTableStatement.toSQL();
|
final String expectedAlterTableStatement = alterTableStatement.toSQL();
|
||||||
final List<String> sqlLines = Files.readAllLines( output.toPath() );
|
final List<String> sqlLines = Files.readAllLines( output.toPath(), Charset.defaultCharset() );
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
for ( String line : sqlLines ) {
|
for ( String line : sqlLines ) {
|
||||||
if ( line.contains( expectedAlterTableStatement ) ) {
|
if ( line.contains( expectedAlterTableStatement ) ) {
|
||||||
|
|
|
@ -8,6 +8,7 @@ package org.hibernate.test.schemaupdate.foreignkeys.crossschema;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -71,7 +72,7 @@ public class CrossSchemaForeignKeyGenerationTest extends BaseUnitTestCase {
|
||||||
.setFormat( false );
|
.setFormat( false );
|
||||||
schemaExport.create( true, false );
|
schemaExport.create( true, false );
|
||||||
|
|
||||||
final List<String> sqlLines = Files.readAllLines( output.toPath() );
|
final List<String> sqlLines = Files.readAllLines( output.toPath(), Charset.defaultCharset() );
|
||||||
assertThat(
|
assertThat(
|
||||||
"Expected alter table SCHEMA1.Child add constraint but is : " + sqlLines.get( 4 ),
|
"Expected alter table SCHEMA1.Child add constraint but is : " + sqlLines.get( 4 ),
|
||||||
sqlLines.get( 4 ).startsWith( "alter table " ),
|
sqlLines.get( 4 ).startsWith( "alter table " ),
|
||||||
|
|
Loading…
Reference in New Issue