Problem building/testing 1.9.x branch: failing tests


I have been using Liquibase for about a year now, but this is the first time I’ve tried to build it.  I am also new to svn, so that doesn’t help.  I am a fairly old hand at ant and java.

I’m building and running tests, and I’m encountering some failures and errors.

I grabbed what I think is the 1.9.x branch using this command:
    svn co liquibase_BR_1_9

Then I navigated into the liquibase_BR_1_9/core/src  directory and built using this command:

Then I built and ran the tests using this command:
    ant test

With the results that I got 1 failure and 7 errors.

liquibase.LiquibaseTest failed with

    junit.framework.AssertionFailedError: expected:<14> but was:<15>
    at liquibase.LiquibaseTest.getImplementedDatabases(
.  I looked at the code, and DatabaseFactory is creating 15 Databases, but the LiquibaseTest is asserting against 14.

liquibase.change.AddColumnChangeTest is erroring out in the sybaseNull, sybaseNotNull, and sybaseConstraintsNull tests.

        [junit] Testcase: sybaseNull(liquibase.change.AddColumnChangeTest): Caused an ERROR     [junit] null expected:<...TER TABLE [TAB] ADD [NEWCOL] TYP NULL> but was:<...TER TABLE [TAB] ADD [[NEWCOL]] TYP NULL>     [junit]    at liquibase.change.AddColumnChangeTest.sybaseNull(     [junit]     [junit]     [junit] Testcase: sybaseNotNull(liquibase.change.AddColumnChangeTest):      Caused an ERROR     [junit] null expected:<...TER TABLE [TAB] ADD [NEWCOL] TYP NOT NULL> but was:<...TER TABLE [TAB] ADD [[NEWCOL]] TYP NOT NULL>     [junit]    at liquibase.change.AddColumnChangeTest.sybaseNotNull(     [junit]     [junit]     [junit] Testcase: sybaseConstraintsNull(liquibase.change.AddColumnChangeTest):      Caused an ERROR     [junit] null expected:<...TER TABLE [TAB] ADD [NEWCOL] TYP NULL> but was:<...TER TABLE [TAB] ADD [[NEWCOL]] TYP NULL>     [junit]    at liquibase.change.AddColumnChangeTest.sybaseConstraintsNull(

liquibase.change.ModifyColumnChangeTest is erroring out in the generateStatement and generateFullStatementForMysql tests.

        [junit] Testcase: generateStatement(liquibase.change.ModifyColumnChangeTest):      Caused an ERROR     [junit] null expected:<..._NAME MODIFY ( NAME [integer](3) )> but was:<..._NAME MODIFY ( NAME [INT](3) )>     [junit]    at liquibase.change.ModifyColumnChangeTest.generateStatement(     [junit]     [junit]     [junit] Testcase: generateFullStatementForMysql(liquibase.change.ModifyColumnChangeTest):  Caused an ERROR     [junit] null expected:<...NAME` MODIFY `NAME` [integer](3) NOT NULL DEFAULT...> but was:<...NAME` MODIFY `NAME` [INT](3) NOT NULL DEFAULT...>     [junit]    at liquibase.change.ModifyColumnChangeTest.generateFullStatementForMysql(

liquibase.database.H2DatabaseTest errors out in the escapeTableName_noSchema and escapeTableName_withSchema tests.

        [junit] Testcase: escapeTableName_noSchema(liquibase.database.H2DatabaseTest):      Caused an ERROR     [junit] null expected:<[`tableName`]> but was:<Name]>     [junit]    at liquibase.database.H2DatabaseTest.escapeTableName_noSchema(     [junit]     [junit]     [junit] Testcase: escapeTableName_withSchema(liquibase.database.H2DatabaseTest):    Caused an ERROR     [junit] null expected:<[`schemaName`.`tableName`]> but was:<[schemaName.tableName]>     [junit]    at liquibase.database.H2DatabaseTest.escapeTableName_withSchema(

    JAVA_HOME points to JDK 1.5 (I usually build with JDK 6 but Liquibase seems to want 1.5.)

    Ant is 1.7.0.

    I’m building on cygwin under Windows XP.

    Do these test cases currently pass for other people?  If so, then it’s something in my environment that I need to fix, or maybe I’m grabbing the code wrong or building it wrong.  But looking at the first one, I’m not so sure it’s me.  I thought it might be leftovers from a previous version of Liquibase, but I’ve cleared out my CLASSPATH.

    Is the official daily build junit results posted online somewhere?

    thanks for any help,

It isn’t a problem with your setup, it is a problem with the tests and ant test command.  We don’t have a build server (which is part of the problem:) ).

Improving the tests so they don’t fail and they have more test coverage is going on in trunk, we haven’t looked at the 1.9 tests lately, and they will probably not be addressed as a whole.  I’ve generally just ran the tests I am interested in through my IDE’s test runner.

The ant build script is checking for java 1.5 because we need to make sure we support 1.5 and don’t compile to an only-1.6 version or use 1.6 APIs.  It will compile and execute fine under 1.6. You can create a “” file in core/src/ and set which will remove the test for you.  Otherwise if you are using Eclipse or Intellij there are project files checked in that allow you to use the standard IDE compiler and not need to worry about ant at all.

Does that help?


Thanks, that helps.  We are currently on 1.9.3 and wanted to evaluate (against our own code) a performance improvement for checkDatabaseChangeLogTable() on OracleDatabase before submitting it for consideration into the official codebase.  2.x seems to be too different for us to work with at the moment.

There is a test that does a fairly extensive integration test that should pass before your changes.  You may need to tweak the URL in the constructor for your database if it is not a localhost XE database.  It assumes there is a “liquibase” user with password “liquibase”.

The 2.x code base is quite a bit different at this point.  If you send or commit a patch to 1.9 I can give you some pointers on how it would apply to the 2.0 codebase.