• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Testing problem

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic