net.sourceforge.sqlunit.test
Class IncludeFileParserTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by net.sourceforge.sqlunit.test.IncludeFileParserTest
All Implemented Interfaces:
junit.framework.Test

public class IncludeFileParserTest
extends junit.framework.TestCase

Runs some tests of the Include File Parser.

Version:
$Revision: 1.10 $
Author:
Sujit Pal (spal@users.sourceforge.net)

Constructor Summary
IncludeFileParserTest(java.lang.String name)
          Boilerplate constructor.
 
Method Summary
static void main(java.lang.String[] argv)
          Boilerplate main method.
static junit.framework.Test suite()
          Boilerplate suite() method.
 void testEmptyIncludeFile()
          Testing the parser against an empty file.
 void testExecuteProcConversion()
          Test the EXEC PROCEDURE conversion to JDBC CALL.
 void testMultilineComment()
          Runs a test case from Satish Chitnis about multi-line comments on top of a stored procedure call.
 void testParseAsaFiles()
          Parses the SQL files in the test/asa directory to ensure that they all parse correctly.
 void testSingleLineInIncludedFile()
          Test with single SQL string with trailing semicolon delimiter.
 void testWithEmbeddedBlankLines()
          Test with embedded blanks between each command.
 void testWithGoDelimiter()
          Testing the parser against all statements, with "go" delimiter.
 void testWithLeadingSemicolonDelimiter()
          Testing the parser against all statements, with leading ; delimiter.
 void testWithOracleFile()
          Test with an externally supplied file containing Oracle PL/SQL.
 void testWithSlashDelimiter()
          Testing the parser against all statements, with / delimiter.
 void testWithSybaseFile()
          Test with an externally supplied file containing Sybase T-SQL.
 void testWithTrailingSemicolonDelimiter()
          Testing the parser against all statements, with trailing ; delimiter.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IncludeFileParserTest

public IncludeFileParserTest(java.lang.String name)
Boilerplate constructor.

Parameters:
name - the name of this test class.
Method Detail

main

public static void main(java.lang.String[] argv)
Boilerplate main method.

Parameters:
argv - the arguments (none).

suite

public static junit.framework.Test suite()
Boilerplate suite() method.

Returns:
a Test object.

testEmptyIncludeFile

public final void testEmptyIncludeFile()
                                throws java.lang.Exception
Testing the parser against an empty file.

Throws:
java.lang.Exception - if there was a problem with the test.

testWithSlashDelimiter

public final void testWithSlashDelimiter()
                                  throws java.lang.Exception
Testing the parser against all statements, with / delimiter.

Throws:
java.lang.Exception - if there was a problem with the test.

testWithLeadingSemicolonDelimiter

public final void testWithLeadingSemicolonDelimiter()
                                             throws java.lang.Exception
Testing the parser against all statements, with leading ; delimiter.

Throws:
java.lang.Exception - if there was a problem with the test.

testWithGoDelimiter

public final void testWithGoDelimiter()
                               throws java.lang.Exception
Testing the parser against all statements, with "go" delimiter.

Throws:
java.lang.Exception - if there was a problem with the test.

testWithTrailingSemicolonDelimiter

public final void testWithTrailingSemicolonDelimiter()
                                              throws java.lang.Exception
Testing the parser against all statements, with trailing ; delimiter. Note that multi-line statements cannot be delimited with the trailing semicolon delimiter as they have embedded traling semi-colons which cannot be easily distinguished from the trailing semi-colon.

Throws:
java.lang.Exception - if there was a problem with the test.

testMultilineComment

public final void testMultilineComment()
                                throws java.lang.Exception
Runs a test case from Satish Chitnis about multi-line comments on top of a stored procedure call.

Throws:
java.lang.Exception - if there was a problem with the test.

testWithEmbeddedBlankLines

public final void testWithEmbeddedBlankLines()
                                      throws java.lang.Exception
Test with embedded blanks between each command.

Throws:
java.lang.Exception - if there was a problem with the test.

testExecuteProcConversion

public final void testExecuteProcConversion()
                                     throws java.lang.Exception
Test the EXEC PROCEDURE conversion to JDBC CALL.

Throws:
java.lang.Exception - if there was a problem with the test.

testParseAsaFiles

public final void testParseAsaFiles()
                             throws java.lang.Exception
Parses the SQL files in the test/asa directory to ensure that they all parse correctly.

Throws:
java.lang.Exception - if there was a problem with the test.

testWithOracleFile

public final void testWithOracleFile()
                              throws java.lang.Exception
Test with an externally supplied file containing Oracle PL/SQL.

Throws:
java.lang.Exception - if there was a problem with the test.

testWithSybaseFile

public final void testWithSybaseFile()
                              throws java.lang.Exception
Test with an externally supplied file containing Sybase T-SQL.

Throws:
java.lang.Exception - if there was a problem with the test.

testSingleLineInIncludedFile

public final void testSingleLineInIncludedFile()
                                        throws java.lang.Exception
Test with single SQL string with trailing semicolon delimiter.

Throws:
java.lang.Exception - if there is a problem with the test.