Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfb7fca6

Browse files
committed
fixes#69
1 parent94ffdab commitfb7fca6

File tree

15 files changed

+92
-114
lines changed

15 files changed

+92
-114
lines changed

‎java-diff-utils-jgit/pom.xml‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@
1010
<name>java-diff-utils-jgit</name>
1111
<packaging>jar</packaging>
1212
<description>This is an extension of java-diff-utils using jgit to use its implementation of
13-
some difference algorithms.</description>
13+
some difference algorithms.</description>
1414
<dependencies>
1515
<dependency>
16-
<groupId>junit</groupId>
17-
<artifactId>junit</artifactId>
18-
<version>4.12</version>
19-
<type>jar</type>
16+
<groupId>org.junit.jupiter</groupId>
17+
<artifactId>junit-jupiter</artifactId>
2018
<scope>test</scope>
2119
</dependency>
2220
<dependency>

‎java-diff-utils-jgit/src/test/java/com/github/difflib/algorithm/jgit/HistogramDiffTest.java‎

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@
2121
importjava.util.ArrayList;
2222
importjava.util.Arrays;
2323
importjava.util.List;
24-
importorg.junit.After;
25-
importorg.junit.AfterClass;
26-
importstaticorg.junit.Assert.*;
27-
importorg.junit.Before;
28-
importorg.junit.BeforeClass;
29-
importorg.junit.Test;
24+
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
25+
importstaticorg.junit.jupiter.api.Assertions.assertNotNull;
26+
importorg.junit.jupiter.api.Test;
3027

3128
/**
3229
*
@@ -37,22 +34,6 @@ public class HistogramDiffTest {
3734
publicHistogramDiffTest() {
3835
}
3936

40-
@BeforeClass
41-
publicstaticvoidsetUpClass() {
42-
}
43-
44-
@AfterClass
45-
publicstaticvoidtearDownClass() {
46-
}
47-
48-
@Before
49-
publicvoidsetUp() {
50-
}
51-
52-
@After
53-
publicvoidtearDown() {
54-
}
55-
5637
/**
5738
* Test of diff method, of class HistogramDiff.
5839
*/

‎java-diff-utils-jgit/src/test/java/com/github/difflib/algorithm/jgit/LRHistogramDiffTest.java‎

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,16 @@
2828
importjava.util.List;
2929
importstaticjava.util.stream.Collectors.toList;
3030
importjava.util.zip.ZipFile;
31-
importorg.junit.After;
32-
importorg.junit.AfterClass;
33-
importstaticorg.junit.Assert.*;
34-
importorg.junit.Before;
35-
importorg.junit.BeforeClass;
36-
importorg.junit.Test;
31+
importstaticorg.junit.jupiter.api.Assertions.assertArrayEquals;
32+
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
33+
importorg.junit.jupiter.api.Test;
3734

3835
/**
3936
*
4037
* @author toben
4138
*/
4239
publicclassLRHistogramDiffTest {
4340

44-
publicLRHistogramDiffTest() {
45-
}
46-
47-
@BeforeClass
48-
publicstaticvoidsetUpClass() {
49-
}
50-
51-
@AfterClass
52-
publicstaticvoidtearDownClass() {
53-
}
54-
55-
@Before
56-
publicvoidsetUp() {
57-
}
58-
59-
@After
60-
publicvoidtearDown() {
61-
}
62-
6341
@Test
6442
publicvoidtestPossibleDiffHangOnLargeDatasetDnaumenkoIssue26()throwsIOException,PatchFailedException {
6543
ZipFilezip =newZipFile("target/test-classes/mocks/large_dataset1.zip");

‎java-diff-utils/pom.xml‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@
1515

1616
<dependencies>
1717
<dependency>
18-
<groupId>junit</groupId>
19-
<artifactId>junit</artifactId>
20-
<version>4.12</version>
21-
<type>jar</type>
18+
<groupId>org.junit.jupiter</groupId>
19+
<artifactId>junit-jupiter</artifactId>
2220
<scope>test</scope>
2321
</dependency>
2422
<dependency>
2523
<groupId>org.assertj</groupId>
2624
<artifactId>assertj-core</artifactId>
27-
<version>3.11.1</version>
2825
<scope>test</scope>
2926
</dependency>
3027
</dependencies>

‎java-diff-utils/src/main/java/com/github/difflib/text/DiffRowGenerator.java‎

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@
3232
importstaticjava.util.stream.Collectors.toList;
3333

3434
/**
35-
* This class for generating DiffRows for side-by-sidy view. You can customize the way of generating. For example, show
36-
* inline diffs on not, ignoring white spaces or/and blank lines and so on. All parameters for generating are optional.
37-
* If you do not specify them, the class will use the default values.
35+
* This class for generating DiffRows for side-by-sidy view. You can customize the way of
36+
* generating. For example, show inline diffs on not, ignoring white spaces or/and blank lines and
37+
* so on. All parameters for generating are optional. If you do not specify them, the class will use
38+
* the default values.
3839
*
3940
* These values are: showInlineDiffs = false; ignoreWhiteSpaces = true; ignoreBlankLines = true; ...
4041
*
@@ -52,7 +53,6 @@ public final class DiffRowGenerator {
5253

5354
publicstaticfinalFunction<String,String>LINE_NORMALIZER_FOR_HTML =StringUtils::normalize;
5455

55-
5656
/**
5757
* Splitting lines by character to achieve char by char diff checking.
5858
*/
@@ -101,7 +101,8 @@ protected final static List<String> splitStringPreserveDelimiter(String str, Pat
101101
/**
102102
* Wrap the elements in the sequence with the given tag
103103
*
104-
* @param startPosition the position from which tag should start. The counting start from a zero.
104+
* @param startPosition the position from which tag should start. The counting start from a
105+
* zero.
105106
* @param endPosition the position before which tag should should be closed.
106107
* @param tagGenerator the tag generator
107108
*/
@@ -170,8 +171,8 @@ private DiffRowGenerator(Builder builder) {
170171
}
171172

172173
/**
173-
* Get the DiffRows describing the difference between original and revised texts using the given patch. Useful for
174-
* displaying side-by-side diff.
174+
* Get the DiffRows describing the difference between original and revised texts using the given
175+
*patch. Useful fordisplaying side-by-side diff.
175176
*
176177
* @param original the original text
177178
* @param revised the revised text
@@ -182,8 +183,8 @@ public List<DiffRow> generateDiffRows(List<String> original, List<String> revise
182183
}
183184

184185
/**
185-
* Generates the DiffRows describing the difference between original and revised texts using the given patch. Useful
186-
* for displaying side-by-side diff.
186+
* Generates the DiffRows describing the difference between original and revised texts using the
187+
*given patch. Usefulfor displaying side-by-side diff.
187188
*
188189
* @param original the original text
189190
* @param patch the given patch
@@ -402,8 +403,8 @@ public Builder ignoreWhiteSpaces(boolean val) {
402403
}
403404

404405
/**
405-
* Give the originial old and new text lines to Diffrow without any additional processing and without any tags to
406-
* highlight the change.
406+
* Give the originial old and new text lines to Diffrow without any additional processing
407+
*and without any tags tohighlight the change.
407408
*
408409
* @param val the value to set. Default: false.
409410
* @return builder with configured reportLinesUnWrapped parameter
@@ -438,8 +439,8 @@ public Builder newTag(Function<Boolean, String> generator) {
438439
/**
439440
* Set the column width of generated lines of original and revised texts.
440441
*
441-
* @param width the width to set. Making it < 0 doesn't have any sense. Default 80. @return builder with config
442-
* ured ignoreBlankLines parameter
442+
* @param width the width to set. Making it < 0 doesn't have any sense. Default 80. @return
443+
*builder with configured ignoreBlankLines parameter
443444
*/
444445
publicBuildercolumnWidth(intwidth) {
445446
if (width >=0) {
@@ -458,7 +459,8 @@ public DiffRowGenerator build() {
458459
}
459460

460461
/**
461-
* Merge the complete result within the original text. This makes sense for one line display.
462+
* Merge the complete result within the original text. This makes sense for one line
463+
* display.
462464
*
463465
* @param mergeOriginalRevised
464466
* @return
@@ -469,8 +471,9 @@ public Builder mergeOriginalRevised(boolean mergeOriginalRevised) {
469471
}
470472

471473
/**
472-
* Per default each character is separatly processed. This variant introduces processing by word, which does not
473-
* deliver in word changes. Therefore the whole word will be tagged as changed:
474+
* Per default each character is separatly processed. This variant introduces processing by
475+
* word, which does not deliver in word changes. Therefore the whole word will be tagged as
476+
* changed:
474477
*
475478
* <pre>
476479
* false: (aBa : aba) -- changed: a(B)a : a(b)a
@@ -483,8 +486,8 @@ public Builder inlineDiffByWord(boolean inlineDiffByWord) {
483486
}
484487

485488
/**
486-
* To provide some customized splitting a splitter can be provided. Here someone could think about sentence splitter,
487-
* comma splitter or stuff like that.
489+
* To provide some customized splitting a splitter can be provided. Here someone could think
490+
*about sentence splitter,comma splitter or stuff like that.
488491
*
489492
* @param inlineDiffSplitter
490493
* @return
@@ -495,8 +498,9 @@ public Builder inlineDiffBySplitter(Function<String, List<String>> inlineDiffSpl
495498
}
496499

497500
/**
498-
* By default DiffRowGenerator preprocesses lines for HTML output. Tabs and special HTML characters like "&lt;"
499-
* are replaced with its encoded value. To change this you can provide a customized line normalizer here.
501+
* By default DiffRowGenerator preprocesses lines for HTML output. Tabs and special HTML
502+
* characters like "&lt;" are replaced with its encoded value. To change this you can
503+
* provide a customized line normalizer here.
500504
*
501505
* @param lineNormalizer
502506
* @return

‎java-diff-utils/src/test/java/com/github/difflib/DiffUtilsTest.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
importjava.util.List;
2020
importstaticjava.util.stream.Collectors.toList;
2121
importjava.util.zip.ZipFile;
22-
importstaticorg.junit.Assert.assertEquals;
23-
importstaticorg.junit.Assert.assertNotNull;
24-
importstaticorg.junit.Assert.assertTrue;
25-
importorg.junit.Ignore;
26-
importorg.junit.Test;
22+
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
23+
importstaticorg.junit.jupiter.api.Assertions.assertNotNull;
24+
importstaticorg.junit.jupiter.api.Assertions.assertTrue;
25+
importorg.junit.jupiter.api.Disabled;
26+
importorg.junit.jupiter.api.Test;
2727

2828
publicclassDiffUtilsTest {
2929

@@ -134,7 +134,7 @@ public void testDiffMissesChangeForkDnaumenkoIssue31() throws DiffException {
134134
* To test this, the greedy meyer algorithm is not suitable.
135135
*/
136136
@Test
137-
@Ignore
137+
@Disabled
138138
publicvoidtestPossibleDiffHangOnLargeDatasetDnaumenkoIssue26()throwsIOException,DiffException {
139139
ZipFilezip =newZipFile(TestConstants.MOCK_FOLDER +"/large_dataset1.zip");
140140

‎java-diff-utils/src/test/java/com/github/difflib/GenerateUnifiedDiffTest.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
importjava.util.Arrays;
1212
importjava.util.List;
1313
importstaticjava.util.stream.Collectors.joining;
14-
importstaticorg.junit.Assert.assertEquals;
15-
importstaticorg.junit.Assert.fail;
16-
importorg.junit.Test;
14+
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
15+
importstaticorg.junit.jupiter.api.Assertions.fail;
16+
importorg.junit.jupiter.api.Test;
1717

1818
publicclassGenerateUnifiedDiffTest {
1919

‎java-diff-utils/src/test/java/com/github/difflib/algorithm/myers/MyersDiffTest.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
importjava.util.ArrayList;
2222
importjava.util.Arrays;
2323
importjava.util.List;
24-
importstaticorg.junit.Assert.*;
25-
importorg.junit.Test;
24+
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
25+
importstaticorg.junit.jupiter.api.Assertions.assertNotNull;
26+
importorg.junit.jupiter.api.Test;
2627

2728
/**
2829
*

‎java-diff-utils/src/test/java/com/github/difflib/patch/PatchTest.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
importcom.github.difflib.algorithm.DiffException;
55
importjava.util.Arrays;
66
importjava.util.List;
7-
importstaticorg.junit.Assert.assertEquals;
8-
importstaticorg.junit.Assert.fail;
9-
importorg.junit.Test;
7+
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
8+
importstaticorg.junit.jupiter.api.Assertions.fail;
9+
importorg.junit.jupiter.api.Test;
1010

1111
publicclassPatchTest {
1212

‎java-diff-utils/src/test/java/com/github/difflib/text/DiffRowGeneratorTest.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
importjava.util.List;
1010
importjava.util.regex.Pattern;
1111
importstaticjava.util.stream.Collectors.toList;
12-
importstaticorg.junit.Assert.assertEquals;
13-
importstaticorg.junit.Assert.assertTrue;
14-
importorg.junit.Test;
12+
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
13+
importstaticorg.junit.jupiter.api.Assertions.assertTrue;
14+
importorg.junit.jupiter.api.Test;
1515

1616
publicclassDiffRowGeneratorTest {
1717

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp