• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create/Delete

 
Wickes Potgieter
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I have completed my assignment (thanks to JavaRanch) and will be submitting next week Tuesday and write on Wednesday...

But, I have implemented both create/delete functionality in the data class and am wondering if I should take it out. It does work, but I have not tested it fully. I know people has passed without implementing it. Should I take it out or leave it? Obviously providing an explanation on why I have not implemented it.

Thanks in advance!
 
Quinn Briggs
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think it hurts to leave it in as long as you are sure that it works correctly. I implemented create/delete in my version and received full marks for data store. Others may feel differently...

Good luck.
 
Robert Chisholm
Ranch Hand
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Makes me curious as to how many people use unit testing tools like JUnit.

If you did, you could spend a few hours writing those test cases and just be done with it.

I ran into a surprising snag the other day in my create() method which my JUnit test picked up. I'd highly recommend testing that method, since it can re-use an existing record, or write past the EOF. And I don't know about anyone else but I used a deleted record collection, so that complicated it further.
 
Anton Golovin
Ranch Hand
Posts: 476
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Robert Chisholm:
Makes me curious as to how many people use unit testing tools like JUnit.

If you did, you could spend a few hours writing those test cases and just be done with it.

I ran into a surprising snag the other day in my create() method which my JUnit test picked up. I'd highly recommend testing that method, since it can re-use an existing record, or write past the EOF. And I don't know about anyone else but I used a deleted record collection, so that complicated it further.


Was the snag a peculiar situation when the create method overwrote a seeming valid record after it determined it to be deleted ? I had to write a do-while loop to solve that issue.
[ September 21, 2004: Message edited by: Anton Golovin ]
 
Wickes Potgieter
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks...I will test it again just to make sure...
 
Robert Chisholm
Ranch Hand
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The snag was that I cut and pasted some of my update() code into the create() method, assuming it would work the same. I didn't realize skipByte() wouldn't go past the EOF, so it produced some weird results that I definitely would not have noticed without my test case (ie: writing a record past EOF).

The funny thing is that my current client has tons of flatfiles around that I need to read. But I've never actually had to write to them! Guess you learn something new every day.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic