19
19
import edu .hm .hafner .coverage .Node ;
20
20
import edu .hm .hafner .coverage .Percentage ;
21
21
import edu .hm .hafner .coverage .Value ;
22
+ import edu .hm .hafner .coverage .assertions .Assertions ;
22
23
23
24
import static edu .hm .hafner .coverage .Metric .CLASS ;
24
25
import static edu .hm .hafner .coverage .Metric .FILE ;
@@ -40,6 +41,30 @@ protected String getFolder() {
40
41
return "cobertura" ;
41
42
}
42
43
44
+ @ Test
45
+ @ Issue ("JENKINS-73325" )
46
+ void shouldUseFullPathWhenParsingFileNodes () {
47
+ Node root = readReport ("cobertura-same-filename.xml" );
48
+
49
+ assertThat (root .getAllFileNodes ()).hasSize (2 )
50
+ .satisfiesExactlyInAnyOrder (
51
+ file -> assertThat (file ).hasName ("MyClass.cs" ).hasRelativePath ("/src/NamespaceA/MyClass.cs" ),
52
+ file -> assertThat (file ).hasName ("MyClass.cs" ).hasRelativePath ("/src/NamespaceB/MyClass.cs" ));
53
+ }
54
+
55
+ @ Test
56
+ @ Issue ("JENKINS-73325" )
57
+ void shouldMergeFilesThatUseSameFileNameInDifferentFolder () {
58
+ Node left = readReport ("merge-duplicate-a.xml" );
59
+ Node right = readReport ("merge-duplicate-b.xml" );
60
+
61
+ var aggregation = left .merge (right );
62
+ assertThat (aggregation .getAllFileNodes ()).hasSize (2 )
63
+ .satisfiesExactlyInAnyOrder (
64
+ file -> Assertions .assertThat (file ).hasName ("MyClass.cs" ).hasRelativePath ("/src/Domain/NamespaceA/MyClass.cs" ),
65
+ file -> Assertions .assertThat (file ).hasName ("MyClass.cs" ).hasRelativePath ("/src/Domain/NamespaceB/MyClass.cs" ));
66
+ }
67
+
43
68
@ Test
44
69
@ Issue ("JENKINS-73175" )
45
70
void shouldAutoGenerateNamesForRuby () {
0 commit comments