|
19 | 19 |
|
20 | 20 | /*
|
21 | 21 | * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
|
22 |
| - * Portions Copyright (c) 2019, Chris Fraire <cfraire@me.com>. |
| 22 | + * Portions Copyright (c) 2019-2020, Chris Fraire <cfraire@me.com>. |
23 | 23 | */
|
24 | 24 | package org.opengrok.indexer.history;
|
25 | 25 |
|
|
35 | 35 | import org.opengrok.indexer.condition.ConditionalRunRule;
|
36 | 36 | import org.opengrok.indexer.condition.RepositoryInstalled;
|
37 | 37 | import org.opengrok.indexer.util.TestRepository;
|
| 38 | +import org.opengrok.indexer.web.Util; |
38 | 39 |
|
39 | 40 | import java.io.File;
|
40 | 41 | import java.util.List;
|
41 | 42 | import java.util.SortedSet;
|
42 | 43 | import java.util.TreeSet;
|
| 44 | +import java.util.stream.Collectors; |
43 | 45 |
|
44 | 46 | /**
|
45 | 47 | * @author austvik
|
@@ -178,20 +180,21 @@ public void testOctopusHistory() throws Exception {
|
178 | 180 |
|
179 | 181 | SortedSet<String> allFiles = new TreeSet<>();
|
180 | 182 | for (HistoryEntry entry : entries) {
|
181 |
| - allFiles.addAll(entry.getFiles()); |
| 183 | + allFiles.addAll(entry.getFiles().stream().map(Util::fixPathIfWindows). |
| 184 | + collect(Collectors.toList())); |
182 | 185 | }
|
183 | 186 |
|
184 |
| - assertTrue("contains /git-octopus/d", allFiles.contains("/git-octopus/d")); |
185 |
| - assertTrue("contains /git-octopus/c", allFiles.contains("/git-octopus/c")); |
186 |
| - assertTrue("contains /git-octopus/b", allFiles.contains("/git-octopus/b")); |
187 |
| - assertTrue("contains /git-octopus/a", allFiles.contains("/git-octopus/a")); |
188 |
| - assertEquals("git-octopus four files from log", 4, allFiles.size()); |
| 187 | + assertTrue("should contain /git-octopus/d", allFiles.contains("/git-octopus/d")); |
| 188 | + assertTrue("should contain /git-octopus/c", allFiles.contains("/git-octopus/c")); |
| 189 | + assertTrue("should contain /git-octopus/b", allFiles.contains("/git-octopus/b")); |
| 190 | + assertTrue("should contain /git-octopus/a", allFiles.contains("/git-octopus/a")); |
| 191 | + assertEquals("git-octopus files from log", 4, allFiles.size()); |
189 | 192 |
|
190 | 193 | HistoryEntry first = entries.get(0);
|
191 | 194 | assertEquals("should be merge commit hash", "206f862b", first.getRevision());
|
192 | 195 | assertEquals("should be merge commit message",
|
193 | 196 | "Merge branches 'file_a', 'file_b' and 'file_c' into master, and add d",
|
194 | 197 | first.getMessage());
|
195 |
| - assertEquals("git-octopus four files for merge", 4, first.getFiles().size()); |
| 198 | + assertEquals("git-octopus files for merge", 4, first.getFiles().size()); |
196 | 199 | }
|
197 | 200 | }
|
0 commit comments