Skip to content

Commit

Permalink
Change default template for better alignment of output (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed May 12, 2023
1 parent 809bdfd commit a9d78e4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
@Description("Lists all paths found in the input records. These paths can be used in a Fix to address fields. Options: " +
"count (output occurence frequency of each path, sorted by highest frequency first; default: true), " +
"template (for formatting the internal triple structure; default: ${s}\t|\t${o} if count is true, else ${s})" +
"template (for formatting the internal triple structure; default: ${o}\t|\t${s} if count is true, else ${s})" +
"index (output individual repeated subfields and array elements with index numbers instead of '*'; default: false)")
@In(StreamReceiver.class)
@Out(String.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
@Description("Lists all values found for the given path. The paths can be found using fix-list-paths. Options: " +
"count (output occurence frequency of each value, sorted by highest frequency first; default: true)" +
"template (for formatting the internal triple structure; default: ${s}\t|\t${o} if count is true, else ${s})")
"template (for formatting the internal triple structure; default: ${o}\t|\t${s} if count is true, else ${s})")
@In(StreamReceiver.class)
@Out(String.class)
@FluxCommand("fix-list-values")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
/* package-private */ class MetafixStreamAnalyzer extends DefaultStreamPipe<ObjectReceiver<String>> {

private static final String DEFAULT_COUNTED_TEMPLATE = "${s}\t|\t${o}";
private static final String DEFAULT_COUNTED_TEMPLATE = "${o}\t|\t${s}";
private static final String DEFAULT_UNCOUNTED_TEMPLATE = "${s}";

private Metafix fix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public MetafixListPathsTest() {
@Test
public void testShouldListPaths() {
verify(
"c.*\t|\t3",
"b.*\t|\t2",
"a\t|\t1");
"3\t|\tc.*",
"2\t|\tb.*",
"1\t|\ta");
}

@Test
Expand All @@ -64,12 +64,12 @@ public void testShouldListPathsNoCount() {
public void testShouldListPathsUseIndex() {
lister.setIndex(true);
verify(
"a\t|\t1",
"b.1\t|\t1",
"b.2\t|\t1",
"c.1\t|\t1",
"c.2\t|\t1",
"c.3\t|\t1");
"1\t|\ta",
"1\t|\tb.1",
"1\t|\tb.2",
"1\t|\tc.1",
"1\t|\tc.2",
"1\t|\tc.3");
}

@Test
Expand All @@ -88,9 +88,9 @@ public void testShouldListPathsNoCountUseIndex() {
@Test
public void testShouldListPathsSortedByFrequency() {
verify(
"c.*\t|\t3",
"b.*\t|\t2",
"a\t|\t1");
"3\t|\tc.*",
"2\t|\tb.*",
"1\t|\ta");
}

private void processRecord() {
Expand Down

0 comments on commit a9d78e4

Please sign in to comment.