• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Create/Delete  RSS feed

 
Ranch Hand
Posts: 68
  • 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!
 
Greenhorn
Posts: 1
  • 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.
 
Ranch Hand
Posts: 69
  • 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.
 
Ranch Hand
Posts: 531
1
  • 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
  • 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
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!