Skip to content

Commit

Permalink
Made tests verify that the same string is returned from both SQL synt…
Browse files Browse the repository at this point in the history
…ax element's toString() and SQLVendor.toString(...) methods.
  • Loading branch information
Stanislav Muhametsin committed Sep 23, 2011
1 parent 45d701b commit b15f34f
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -14,6 +14,7 @@

package org.sql.generation.implementation;

import org.junit.Assert;
import org.slf4j.LoggerFactory;
import org.sql.generation.api.grammar.common.SQLStatement;
import org.sql.generation.api.vendor.SQLVendor;
Expand All @@ -27,8 +28,12 @@ public abstract class AbstractSQLSyntaxTest

protected void logStatement( String statementType, SQLVendor vendor, SQLStatement statement )
{
LoggerFactory.getLogger( this.getClass().getName() ).info(
statementType + ":" + "\n" + vendor.toString( statement ) + "\n" );
String stringStmt = vendor.toString( statement );
LoggerFactory.getLogger( this.getClass().getName() ).info( statementType + ":" + "\n" + stringStmt + "\n" );

Assert.assertEquals(
"Strings must be same from both SQLVendor.toString(...) and statement.toString() methods.", stringStmt,
statement.toString() );
}

protected abstract SQLVendor getVendor()
Expand Down

0 comments on commit b15f34f

Please sign in to comment.