Before I forget to mention it, I did get FrontBase (FB) and DBUnit working. 

The problem seems to be that FB versions after 5.2 seem to behave differently. 
DBUnit checks tables in the FB schema, but only with the newer versions it gets 
an error:

 org.dbunit.dataset.NoSuchTableException: Did not find table 
'INFORMATION_SCHEMA_CATALOG_NAME' in schema 'null'

when writing out the metadata via FlatDtdDataSet.write(…). Now the 
'INFORMATION_SCHEMA_CATALOG_NAME' is in the INFORMATION_SCHEMA, along with:

    INFORMATION_SCHEMA_CATALOG_NAME*,
    EOMODELER_RELATIONS*,
    BLACK_AND_WHITE_LIST*,
    TABLE_STATISTICS_HISTORY*,

So don't use that schema, and you will have one less problem.

DBUnit has a new method JdbcDatabaseTester which takes the schema name to use, 
so by using only the _SYSTEM schema, it does not reference all the junk in the 
INFORMATION_SCHEMA, and consequently does not get the above error, and is able 
to write out the dtd as well as the actual xml data set (which always did work).

Also, with mixed case table names, I must now set a "Feature" like:

dtdConnection.getConfig().setFeature("http://www.dbunit.org/features/caseSensitiveTableNames";,
 true) ;



On Feb 8, 2013, at 6:50 PM, Chuck Hill wrote:

> 
> On 2013-02-08, at 3:34 AM, Greg Brown wrote:
> 
>> Hello,
>> 
>> Does anybody use Frontbase with DBUnit? I have recently upgraded a project 
>> and the newer versions of Frontbase are causing some problems with dbunit.
> 
> Yes, but not with FB 5 yet.
> 
> 
>> I have changed some testing code and everything works (ah…so far..) except 
>> writing out the database schema with dbunit, something like:
>> 
>> FlatDtdDataSet.write(dout, new FileOutputStream(dtdname));
>> 
>> which causes an exception because it can't find or validate the metadata:
>> 
>> org.dbunit.dataset.NoSuchTableException: Did not find table 
>> 'INFORMATION_SCHEMA_CATALOG_NAME' in schema 'null'
>>      at 
>> org.dbunit.database.DatabaseTableMetaData.<init>(DatabaseTableMetaData.java:146)
>>      at 
>> org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:293)
>>      at org.dbunit.dataset.xml.FlatDtdWriter.write(FlatDtdWriter.java:94)
>>      at org.dbunit.dataset.xml.FlatDtdDataSet.write(FlatDtdDataSet.java:111)
>>      at org.dbunit.dataset.xml.FlatDtdDataSet.write(FlatDtdDataSet.java:99)
>> 
>> I had similar problems with table names, it seems a case issue with metadata 
>> and setting a dbunit property:
>> 
>>      
>> connection.getConfig().setFeature("http://www.dbunit.org/features/caseSensitiveTableNames";,
>>  true) ;
> 
> Do you set useQualifiedTableNames to false?  I needed to do that, but don't 
> recall why at the moment.
> 
> 
>> fixed that. It seems that the case-insensitive default just up-cases all 
>> names, then it looks for the up-cased table name. It does not seem case 
>> insensitive to me, as the  case-insensitive default can not find tables with 
>> mixed case, like "WoodenTable"
> 
> I recall hitting that bug in dbUnit.
> 
> 
>> Frontbase seems to change a little with each version; I noted awhile back 
>> that WOlips could not reverse engineer the latest version of a Frontbase db, 
>> previous versions could be reverse engineered. Again, probably a metadata 
>> issue. 
> 
> Perhaps a missed update to the FBPlugin?
> 
> 
> Chuck
> 
> 
> -- 
> Chuck Hill             Senior Consultant / VP Development
> 
> Practical WebObjects - for developers who want to increase their overall 
> knowledge of WebObjects or who are trying to solve specific problems.    
> http://www.global-village.net/gvc/practical_webobjects
> 
> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing 
> Companies in B.C! 
> Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of 
> Canada’s Fastest-Growing Companies by PROFIT Magazine!
> 
> 
> 
> 
> 
> 
> 
> 


Greg Brown
[email protected]




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to