@@ -147,6 +147,37 @@ public void shouldReadCorruptFiles() throws IOException {
147
147
assertFalse (this .testee .getHistoricResults ().isEmpty ());
148
148
}
149
149
150
+ @ Test
151
+ public void doesNotErrorOnOldHistoryFile () throws IOException {
152
+ final HierarchicalClassId foo = new HierarchicalClassId (
153
+ new ClassIdentifier (0 , ClassName .fromString ("foo" )), "" );
154
+ recordClassPathWithTestee (foo );
155
+
156
+ final MutationResult mr = new MutationResult (
157
+ MutationTestResultMother .createDetails ("foo" ),
158
+ new MutationStatusTestPair (1 , DetectionStatus .KILLED , "testName" ));
159
+
160
+ this .testee .recordResult (mr );
161
+ this .output .append (pitest14HistoryFile ());
162
+
163
+ final Reader reader = new StringReader (this .output .toString ());
164
+ this .testee = new ObjectOutputStreamHistory (this .code , this .writerFactory ,
165
+ Optional .ofNullable (reader ));
166
+ this .testee .initialize ();
167
+
168
+ assertFalse (this .testee .getHistoricResults ().isEmpty ());
169
+ }
170
+
171
+ private String pitest14HistoryFile () {
172
+ return "rO0ABXNyACRvcmcucGl0ZXN0Lm11dGF0aW9udGVzdC5DbGFzc0hpc3RvcnkAAAAAAAAAAQIAAkwACmNvdmVyYWdlSWR0ABJMamF2YS9sYW5nL1N0cmluZztM" +
173
+ "AAJpZHQAKkxvcmcvcGl0ZXN0L2NsYXNzaW5mby9IaWVyYXJjaGljYWxDbGFzc0lkO3hwdAAIMTY1MmVhMDRzcgAob3JnLnBpdGVzdC5jbGFzc2luZm8uSGllc" +
174
+ "mFyY2hpY2FsQ2xhc3NJZAAAAAAAAAABAgACTAAHY2xhc3NJZHQAJkxvcmcvcGl0ZXN0L2NsYXNzaW5mby9DbGFz" +
175
+ "c0lkZW50aWZpZXI7TAAQaGllcmFyY2hpY2FsSGFzaHEAfgABeHBzcgAkb3JnLnBpdGVzdC5jbGFzc2luZm8uQ2xhc3NJZGVudGl" +
176
+ "maWVyAAAAAAAAAAECAAJKAARoYXNoTAAEbmFtZXQAIExvcmcvcGl0ZXN0L2NsYXNzaW5mby9DbGFzc05hbWU7eHAAAAAAFlLqBHNyAB5" +
177
+ "vcmcucGl0ZXN0LmNsYXNzaW5mby5DbGFzc05hbWUAAAAAAAAAAQIAAUwABG5hbWVxAH4AAXhwdAAkY29tL2V4YW1wbGUvbW9kdWxlYi9DYX" +
178
+ "RDb252ZXJ0ZXJUZXN0dAAIMTY1MmVhMDQ=" ;
179
+ }
180
+
150
181
private void recordClassPathWithTestee (
151
182
final HierarchicalClassId ... classIdentifiers ) {
152
183
this .testee = new ObjectOutputStreamHistory (this .code , this .writerFactory ,
0 commit comments