File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
main/java/org/metafacture/metafix
test/java/org/metafacture/metafix Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ private TripleCount tripleCount() {
76
76
private TripleSort tripleSort () {
77
77
final TripleSort tripleSort = new TripleSort ();
78
78
tripleSort .setNumeric (count );
79
- tripleSort .setBy (Compare .OBJECT );
79
+ tripleSort .setBy (count ? Compare .OBJECT : Compare . SUBJECT );
80
80
tripleSort .setOrder (count ? Order .DECREASING : Order .INCREASING );
81
81
return tripleSort ;
82
82
}
Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ public MetafixListPathsTest() {
46
46
@ Test
47
47
public void testShouldListPaths () {
48
48
verify (
49
- "3\t |\t c .*" ,
50
- "2\t |\t b .*" ,
49
+ "3\t |\t b .*" ,
50
+ "2\t |\t c .*" ,
51
51
"1\t |\t a" );
52
52
}
53
53
@@ -67,9 +67,9 @@ public void testShouldListPathsUseIndex() {
67
67
"1\t |\t a" ,
68
68
"1\t |\t b.1" ,
69
69
"1\t |\t b.2" ,
70
+ "1\t |\t b.3" ,
70
71
"1\t |\t c.1" ,
71
- "1\t |\t c.2" ,
72
- "1\t |\t c.3" );
72
+ "1\t |\t c.2" );
73
73
}
74
74
75
75
@ Test
@@ -80,16 +80,16 @@ public void testShouldListPathsNoCountUseIndex() {
80
80
"a" ,
81
81
"b.1" ,
82
82
"b.2" ,
83
+ "b.3" ,
83
84
"c.1" ,
84
- "c.2" ,
85
- "c.3" );
85
+ "c.2" );
86
86
}
87
87
88
88
@ Test
89
89
public void testShouldListPathsSortedByFrequency () {
90
90
verify (
91
- "3\t |\t c .*" ,
92
- "2\t |\t b .*" ,
91
+ "3\t |\t b .*" ,
92
+ "2\t |\t c .*" ,
93
93
"1\t |\t a" );
94
94
}
95
95
@@ -99,7 +99,7 @@ private void processRecord() {
99
99
lister .literal ("a" , "" );
100
100
lister .literal ("b" , "" );
101
101
lister .literal ("b" , "" );
102
- lister .literal ("c " , "" );
102
+ lister .literal ("b " , "" );
103
103
lister .literal ("c" , "" );
104
104
lister .literal ("c" , "" );
105
105
lister .endRecord ();
@@ -113,6 +113,9 @@ private void verify(final String... result) throws MockitoAssertionError {
113
113
for (final String r : result ) {
114
114
ordered .verify (receiver ).process (r );
115
115
}
116
+ ordered .verify (receiver , Mockito .times (2 )).closeStream ();
117
+ ordered .verifyNoMoreInteractions ();
118
+ Mockito .verifyNoMoreInteractions (receiver );
116
119
}
117
120
catch (final MockitoAssertionError e ) {
118
121
System .out .println (Mockito .mockingDetails (receiver ).printInvocations ());
You can’t perform that action at this time.
0 commit comments