-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into feature/internal-w…
…eb-viewer # Conflicts: # cli/src/main/java/de/jplag/cli/CLI.java
- Loading branch information
Showing
105 changed files
with
1,295 additions
and
666 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
cli/src/main/java/de/jplag/cli/logger/TongfeiProgressBar.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package de.jplag.cli.logger; | ||
|
||
import de.jplag.logging.ProgressBar; | ||
|
||
/** | ||
* A ProgressBar, that used the tongfei progress bar library underneath, to show progress bars on the cli. | ||
*/ | ||
public class TongfeiProgressBar implements ProgressBar { | ||
private final me.tongfei.progressbar.ProgressBar progressBar; | ||
|
||
public TongfeiProgressBar(me.tongfei.progressbar.ProgressBar progressBar) { | ||
this.progressBar = progressBar; | ||
} | ||
|
||
@Override | ||
public void step(int number) { | ||
this.progressBar.stepBy(number); | ||
} | ||
|
||
@Override | ||
public void dispose() { | ||
this.progressBar.close(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
cli/src/main/java/de/jplag/cli/logger/TongfeiProgressBarProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package de.jplag.cli.logger; | ||
|
||
import de.jplag.logging.ProgressBar; | ||
import de.jplag.logging.ProgressBarProvider; | ||
import de.jplag.logging.ProgressBarType; | ||
|
||
import me.tongfei.progressbar.ProgressBarBuilder; | ||
import me.tongfei.progressbar.ProgressBarStyle; | ||
|
||
/** | ||
* A ProgressBar provider, that used the tongfei progress bar library underneath, to show progress bars on the cli. | ||
*/ | ||
public class TongfeiProgressBarProvider implements ProgressBarProvider { | ||
@Override | ||
public ProgressBar initProgressBar(ProgressBarType type, int totalSteps) { | ||
me.tongfei.progressbar.ProgressBar progressBar = new ProgressBarBuilder().setTaskName(type.getDefaultText()).setInitialMax(totalSteps) | ||
.setStyle(ProgressBarStyle.UNICODE_BLOCK).build(); | ||
return new TongfeiProgressBar(progressBar); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package de.jplag.cli; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import de.jplag.merging.MergingOptions; | ||
|
||
/** | ||
* Test cases for the options of the match merging mechanism. | ||
*/ | ||
class MergingOptionsTest extends CommandLineInterfaceTest { | ||
|
||
@Test | ||
@DisplayName("Test if default values are used when creating merging options from CLI") | ||
void testMergingDefault() throws CliException { | ||
buildOptionsFromCLI(defaultArguments()); | ||
assertNotNull(options.mergingOptions()); | ||
assertEquals(MergingOptions.DEFAULT_ENABLED, options.mergingOptions().enabled()); | ||
assertEquals(MergingOptions.DEFAULT_NEIGHBOR_LENGTH, options.mergingOptions().minimumNeighborLength()); | ||
assertEquals(MergingOptions.DEFAULT_GAP_SIZE, options.mergingOptions().maximumGapSize()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.