Reputation: 176
I'm trying to use OpenHFT/Chronicle-Map and MapDB as to persist a simple String -> Foo database.
Foo may evolve over time, I'm wondering what testing strategies people have adopted to ensure that any older version of Foo persisted will be loadable going forward.
I was thinking of starting serialVersionUID at 1 for each specific class, storing each particular serialized version in a file I check in and have a test, which ensures I can read all of those files back and the values are what I expected.
It seems a little manual though.
Thanks
Upvotes: 0
Views: 63
Reputation: 27976
You could automate the process of creating the serialized files
src/test/resources
.java
to a .class
at runtime using the JavaCompiler.class
versionOnce this is in place, the only maintenance wil be
Upvotes: 1