From b15f34f55aaf5b2a2f09e3aa40640b684f9ebf39 Mon Sep 17 00:00:00 2001 From: Stanislav Muhametsin Date: Fri, 23 Sep 2011 03:29:44 +0300 Subject: [PATCH] Made tests verify that the same string is returned from both SQL syntax element's toString() and SQLVendor.toString(...) methods. --- .../generation/implementation/AbstractSQLSyntaxTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/implementation/src/test/java/org/sql/generation/implementation/AbstractSQLSyntaxTest.java b/implementation/src/test/java/org/sql/generation/implementation/AbstractSQLSyntaxTest.java index 1c262b1..4c0e072 100644 --- a/implementation/src/test/java/org/sql/generation/implementation/AbstractSQLSyntaxTest.java +++ b/implementation/src/test/java/org/sql/generation/implementation/AbstractSQLSyntaxTest.java @@ -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; @@ -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()