|
34 | 34 | import java.io.IOException;
|
35 | 35 | import java.io.InputStream;
|
36 | 36 | import java.net.URISyntaxException;
|
| 37 | +import java.util.Date; |
| 38 | +import java.util.List; |
37 | 39 | import java.util.Map;
|
38 | 40 |
|
39 | 41 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
@@ -171,11 +173,30 @@ void parseALaW3C() throws Exception {
|
171 | 173 | void testHistoryForDirectory() throws Exception {
|
172 | 174 | File repoRoot = setUpTestRepository();
|
173 | 175 | assertTrue(repoRoot.exists());
|
| 176 | + assertTrue(repoRoot.isDirectory()); |
174 | 177 | CVSRepository repository = (CVSRepository) RepositoryFactory.getRepository(repoRoot);
|
175 | 178 | assertNotNull(repository);
|
176 | 179 | History history = repository.getHistory(repoRoot);
|
177 | 180 | assertNotNull(history);
|
178 | 181 | assertNotNull(history.getHistoryEntries());
|
179 | 182 | assertEquals(3, history.getHistoryEntries().size());
|
| 183 | + |
| 184 | + List<HistoryEntry> entries = List.of( |
| 185 | + new HistoryEntry("1.1.1.1", new Date(1220544581000L), |
| 186 | + "austvik", |
| 187 | + "Add files\n", true), |
| 188 | + new HistoryEntry("1.2", new Date(1220544684000L), |
| 189 | + "austvik", |
| 190 | + "Added a comment\n", true), |
| 191 | + new HistoryEntry("1.1", new Date(1220544581000L), |
| 192 | + "austvik", |
| 193 | + "branches: 1.1.1;\n" + |
| 194 | + "Initial revision\n", true) |
| 195 | + ); |
| 196 | + |
| 197 | + assertEquals(entries.size(), history.getHistoryEntries().size()); |
| 198 | + History expectedHistory = new History(entries); |
| 199 | + expectedHistory.setTags(Map.of("1.1.1.1", "start")); |
| 200 | + assertEquals(expectedHistory, history); |
180 | 201 | }
|
181 | 202 | }
|
0 commit comments