java - How to organise the tests of an expensive object -


i have class want test junit. creating of object of type involves lot of io, takes 5 seconds.

a mutable , want test different methods change a. in kind of dilemma:

  1. if create virgin object every test method, takes long.
  2. creating 1 huge test method lot of asserts seems bad idea isolate causes of possible errors.
  3. "repairing" object of type after each test methods seems dangerous because if repairing not done correctly, other test methods might fail without proper reason.
  4. i create deep copy of instance of every test method, means have change class test it.

what suggest?


Comments

Popular posts from this blog

Lists in Python -

android - can not access to progress bar in an other activity -

html - Not able to access next element of an array javascript -