Avoid test dependency on windows environment.
As EntityGen outputs entity source using system line.separator property, expect of assertion must be prepared to use system line separator.
@@ -8,6 +8,12 @@ | ||
8 | 8 | |
9 | 9 | public class EntityGenTest extends AbstractDatabaseTest { |
10 | 10 | |
11 | + /** EntityGenTest_testGetEntitySource.txt の改行文字(列) */ | |
12 | + private static final String STANDARD_LINE_SEPARATOR = "\r\n"; | |
13 | + | |
14 | + /** {@link EntityGen}の出力する改行文字(列) */ | |
15 | + private static final String ENVIRONMENT_LINE_SEPARATOR = System.getProperty("line.separator"); | |
16 | + | |
11 | 17 | public void testGetEntitySource() throws Exception { |
12 | 18 | EntityGen gen = new EntityGen(); |
13 | 19 | gen.setPackageName("jp.sf.amateras.mirage.entity"); |
@@ -19,7 +25,7 @@ | ||
19 | 25 | |
20 | 26 | String expect = new String(IOUtil.readStream( |
21 | 27 | EntityGenTest.class.getResourceAsStream("EntityGenTest_testGetEntitySource.txt")), |
22 | - "UTF-8"); | |
28 | + "UTF-8").replace(STANDARD_LINE_SEPARATOR, ENVIRONMENT_LINE_SEPARATOR); | |
23 | 29 | |
24 | 30 | assertEquals(expect, result); |
25 | 31 | } |