Skip to content

Commit dd5db26

Browse files
committed
included longrunning tests into separate profile
1 parent 8c575b6 commit dd5db26

File tree

3 files changed

+101
-15
lines changed

3 files changed

+101
-15
lines changed

pom.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,16 @@
156156
</execution>
157157
</executions>
158158
</plugin>
159+
<plugin>
160+
<groupId>org.apache.maven.plugins</groupId>
161+
<artifactId>maven-surefire-plugin</artifactId>
162+
<version>2.15</version>
163+
<configuration>
164+
<excludes>
165+
<exclude>**/LR*.java</exclude>
166+
</excludes>
167+
</configuration>
168+
</plugin>
159169
<!--
160170
<plugin>
161171
<groupId>org.codehaus.mojo</groupId>
@@ -195,6 +205,23 @@
195205
<javadoc.opts>-Xdoclint:none</javadoc.opts>
196206
</properties>
197207
</profile>
208+
<profile>
209+
<id>long-running-tests</id>
210+
<build>
211+
<plugins>
212+
<plugin>
213+
<groupId>org.apache.maven.plugins</groupId>
214+
<artifactId>maven-surefire-plugin</artifactId>
215+
<version>2.15</version>
216+
<configuration>
217+
<excludes>
218+
<exclude>xxx</exclude>
219+
</excludes>
220+
</configuration>
221+
</plugin>
222+
</plugins>
223+
</build>
224+
</profile>
198225
</profiles>
199226
</project>
200227

src/test/java/difflib/algorithm/jgit/JGitDiffTest.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,4 @@ public void testDiff() throws DiffException, PatchFailedException {
7272
List<String> patched = patch.applyTo(orgList);
7373
assertEquals(revList, patched);
7474
}
75-
76-
@Test
77-
public void testPossibleDiffHangOnLargeDatasetDnaumenkoIssue26() throws IOException, DiffException, PatchFailedException {
78-
ZipFile zip = new ZipFile(TestConstants.MOCK_FOLDER + "/large_dataset1.zip");
79-
List<String> original = readStringListFromInputStream(zip.getInputStream(zip.getEntry("ta")));
80-
List<String> revised = readStringListFromInputStream(zip.getInputStream(zip.getEntry("tb")));
81-
82-
Patch<String> patch = new JGitDiff().diff(original, revised);
83-
84-
assertEquals(34, patch.getDeltas().size());
85-
86-
List<String> created = patch.applyTo(original);
87-
assertArrayEquals(revised.toArray(), created.toArray());
88-
}
89-
9075
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* Copyright 2017 java-diff-utils.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package difflib.algorithm.jgit;
17+
18+
import static difflib.DiffUtilsTest.readStringListFromInputStream;
19+
import difflib.TestConstants;
20+
import difflib.algorithm.DiffException;
21+
import difflib.patch.Patch;
22+
import difflib.patch.PatchFailedException;
23+
import java.io.IOException;
24+
import java.util.Arrays;
25+
import java.util.List;
26+
import java.util.zip.ZipFile;
27+
import org.junit.After;
28+
import org.junit.AfterClass;
29+
import org.junit.Before;
30+
import org.junit.BeforeClass;
31+
import org.junit.Test;
32+
import static org.junit.Assert.*;
33+
34+
/**
35+
*
36+
* @author toben
37+
*/
38+
public class LRJGitDiffTest {
39+
40+
public LRJGitDiffTest() {
41+
}
42+
43+
@BeforeClass
44+
public static void setUpClass() {
45+
}
46+
47+
@AfterClass
48+
public static void tearDownClass() {
49+
}
50+
51+
@Before
52+
public void setUp() {
53+
}
54+
55+
@After
56+
public void tearDown() {
57+
}
58+
59+
60+
@Test
61+
public void testPossibleDiffHangOnLargeDatasetDnaumenkoIssue26() throws IOException, DiffException, PatchFailedException {
62+
ZipFile zip = new ZipFile(TestConstants.MOCK_FOLDER + "/large_dataset1.zip");
63+
List<String> original = readStringListFromInputStream(zip.getInputStream(zip.getEntry("ta")));
64+
List<String> revised = readStringListFromInputStream(zip.getInputStream(zip.getEntry("tb")));
65+
66+
Patch<String> patch = new JGitDiff().diff(original, revised);
67+
68+
assertEquals(34, patch.getDeltas().size());
69+
70+
List<String> created = patch.applyTo(original);
71+
assertArrayEquals(revised.toArray(), created.toArray());
72+
}
73+
74+
}

0 commit comments

Comments
 (0)