• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Testing problem

 
Ray Cheeny
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am testing my program now.I make an empty db.db file and load it.But I found the Data would throw IOException when it operated on 'headerLen = db.readInt();' and the e.getMessenger() showed only 'null'.How to show this messenger in detail? When I wrote something in that empty db.db, it would throw java.lang.outOfMemery. How to handle it? When I changed something in db.db(provided by Sun), it threw java.lang.NegativeArraySizeException. Need I handle it ?
It's the constructor of my RemoteAccess.Should I add 'catch(Exception)' in it?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ray
I did all my testing with the database that Sun provided. My personal feeling is that Sun told us that the Data class was complete (with the specified missing bits) so they are implying that their method of creating a blank file will work correctly. If it doesnt, then it is their problem.
Regards, Andrew
 
Bob Reeves
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ray:
I think there's a difference between an "empty database" and an "empty file". I did the URLyBird assignment, and this database defines file header and file schema information. Without the header and schema information, you don't have a valid URLyBird database (i.e., the "empty file" case). However, it is valid to have an URLyBird database that contains zero records (i.e., "empty database").
My 2 cents is that if the database lacks the header and/or schema, then shutdown the application because the database is corrupt. These fields are required to actually use the database. (Now if you want your server to support a "create database" operation, that's different.)
Tx
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic