Skip to content

Commit 4098bdf

Browse files
committed
fix #11 fixed the encoding IntelliJ has destroyed
1 parent 10285bc commit 4098bdf

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

src/test/java/de/andrena/tools/nopackagecycles/NoPackageCyclesRuleIntegrationTest.java

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
package de.andrena.tools.nopackagecycles;
22

3-
import de.andrena.tools.nopackagecycles.mock.EnforcerRuleHelperMock;
4-
import org.apache.commons.io.IOUtils;
5-
import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
6-
import org.junit.Before;
7-
import org.junit.Test;
3+
import static org.junit.Assert.assertEquals;
4+
import static org.junit.Assert.fail;
85

96
import java.io.File;
107
import java.io.IOException;
118
import java.net.URISyntaxException;
129
import java.net.URL;
1310

14-
import static org.junit.Assert.*;
11+
import org.apache.commons.io.IOUtils;
12+
import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
13+
import org.junit.Before;
14+
import org.junit.Test;
1515

16+
import de.andrena.tools.nopackagecycles.mock.EnforcerRuleHelperMock;
1617

1718
public class NoPackageCyclesRuleIntegrationTest {
18-
1919
private static final URL FITNESSE_TARGET_FOLDER = getResource("fitnesse-target");
2020
private static final URL FITNESSE_EXPECTED_OUTPUT = getResource("fitnesse-expected-output.txt");
2121
private static final URL JUNIT_TARGET_FOLDER = getResource("junit-target");
@@ -24,45 +24,38 @@ public class NoPackageCyclesRuleIntegrationTest {
2424
private NoPackageCyclesRule rule;
2525
private EnforcerRuleHelperMock helper;
2626

27-
2827
@Before
2928
public void setUp() throws Exception {
3029
rule = new NoPackageCyclesRule();
3130
helper = new EnforcerRuleHelperMock();
3231
}
3332

34-
3533
@Test
3634
public void fitnesseIntegrationTest() throws Exception {
3735
assertPackageCycles(FITNESSE_TARGET_FOLDER, FITNESSE_EXPECTED_OUTPUT);
3836
}
3937

40-
4138
@Test
4239
public void junitIntegrationTest() throws Exception {
4340
assertPackageCycles(JUNIT_TARGET_FOLDER, JUNIT_EXPECTED_OUTPUT);
4441
}
4542

46-
4743
private void assertPackageCycles(URL targetFolder, URL expectedOutput) throws URISyntaxException, IOException {
4844
helper.setTestClassesDir(new File("non-existent"));
4945
helper.setClassesDir(new File(targetFolder.toURI()));
5046
try {
5147
rule.execute(helper);
5248
fail("expected EnforcerRuleException");
53-
}
54-
catch (EnforcerRuleException e) {
49+
} catch (EnforcerRuleException e) {
5550
// using assertEquals to get a nice comparison editor in eclipse
56-
assertEquals(getExpectedOutput(expectedOutput), e.getMessage() + "\n");
51+
assertEquals(getExpectedOutput(expectedOutput), e.getMessage());
5752
}
5853
}
5954

60-
6155
private String getExpectedOutput(URL expectedOutput) throws IOException {
6256
return IOUtils.toString(expectedOutput.openStream()).replaceAll("\r", "");
6357
}
6458

65-
6659
private static URL getResource(String path) {
6760
return Thread.currentThread().getContextClassLoader().getResource(path);
6861
}

src/test/resources/fitnesse-expected-output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,4 +295,4 @@ Package-cycle found involving fit, fit.decorator.util, fit.testFxtr, fitnesse, f
295295
fitnesse.http (TemplateUtilTest)
296296
fitnesse.responders.editing (TemplateUtilTest)
297297
fitnesse.testutil (TemplateUtilTest)
298-
fitnesse.wiki (TemplateUtil, TemplateUtilTest)
298+
fitnesse.wiki (TemplateUtil, TemplateUtilTest)

src/test/resources/junit-expected-output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,4 @@ Package-cycle found involving junit.extensions, junit.framework, junit.runner, o
109109
org.junit.internal (TestClass)
110110
org.junit.internal.runners (RunnerBuilder)
111111
org.junit.internal.runners.model (FrameworkMethod$1, MultipleFailureException)
112-
org.junit.runner (RunnerBuilder)
112+
org.junit.runner (RunnerBuilder)

0 commit comments

Comments
 (0)