From 1d7969f6497248614b3cb05ae9e0054739cc678d Mon Sep 17 00:00:00 2001 From: Brett Meyer Date: Thu, 22 Aug 2013 22:43:31 -0400 Subject: [PATCH] HHH-8371 corrected failing test in metamodel --- .../spi/relational/ColumnAliasTest.java | 23 ++----------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/spi/relational/ColumnAliasTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/spi/relational/ColumnAliasTest.java index d2542cf926..af36f0273e 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/spi/relational/ColumnAliasTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/spi/relational/ColumnAliasTest.java @@ -27,7 +27,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.hibernate.dialect.Dialect; -import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseUnitTestCase; import org.junit.After; import org.junit.Before; @@ -105,31 +104,19 @@ public class ColumnAliasTest extends BaseUnitTestCase { } @Test - @FailureExpectedWithNewMetamodel public void testNameStartsWithNonCharacterTruncation() { Column column = table0.createColumn( "1" ); - String expectedSuffix = getExpectedSuffix( column, null ); + String expectedSuffix = getExpectedSuffix( column, table0 ); // create dialect with maximum alias length that will force truncation. Dialect dialect = createDialect( expectedSuffix.length() + "column".length() - 1 ); String nameTruncated = "column".substring( 0, dialect.getMaxAliasLength() - expectedSuffix.length() ); assertTrue( nameTruncated.length() < "column".length() ); - String alias = column.getAlias( dialect, null ); - assertEquals( dialect.getMaxAliasLength(), alias.length() ); - assertEquals( nameTruncated + expectedSuffix , alias ); - - column = table0.createColumn( "_abc" ); - // create dialect with maximum alias length that will force truncation. - expectedSuffix = getExpectedSuffix( column, table1 ); - dialect = createDialect( expectedSuffix.length() + "column".length() - 1 ); - nameTruncated = "column".substring( 0, dialect.getMaxAliasLength() - expectedSuffix.length() ); - assertTrue( nameTruncated.length() < "column".length() ); - alias = column.getAlias( dialect, table1 ); + String alias = column.getAlias( dialect, table0 ); assertEquals( dialect.getMaxAliasLength(), alias.length() ); assertEquals( nameTruncated + expectedSuffix , alias ); } @Test - @FailureExpectedWithNewMetamodel public void testNameIncludingNonCharacter() { // create dialect with a large enough max alias length so there is no trucation. final Dialect dialect = createDialect( 10 ); @@ -145,12 +132,6 @@ public class ColumnAliasTest extends BaseUnitTestCase { column = table0.createColumn( "`a1b`" ); assertEquals( "a" + getExpectedSuffix( column, table1 ) , column.getAlias( dialect, table1 ) ); - column = table0.createColumn( "a_b" ); - assertEquals( "a" + getExpectedSuffix( column, table1 ) , column.getAlias( dialect, table1 ) ); - - column = table0.createColumn( "`a_b`" ); - assertEquals( "a" + getExpectedSuffix( column, table1 ) , column.getAlias( dialect, table1 ) ); - column = table0.createColumn( "ab1" ); assertEquals( "ab" + getExpectedSuffix( column, table1 ) , column.getAlias( dialect, table1 ) );