svnno****@sourc*****
svnno****@sourc*****
2009年 2月 8日 (日) 21:10:29 JST
Revision: 2630 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2630 Author: daisuke_m Date: 2009-02-08 21:10:29 +0900 (Sun, 08 Feb 2009) Log Message: ----------- プラットホームに依存する改行コードの違いを吸収。 Modified Paths: -------------- artemis/trunk/jiemamy-artemis-test/src/test/java/org/jiemamy/serializer/SerializationTest.java -------------- next part -------------- Modified: artemis/trunk/jiemamy-artemis-test/src/test/java/org/jiemamy/serializer/SerializationTest.java =================================================================== --- artemis/trunk/jiemamy-artemis-test/src/test/java/org/jiemamy/serializer/SerializationTest.java 2009-02-07 14:19:02 UTC (rev 2629) +++ artemis/trunk/jiemamy-artemis-test/src/test/java/org/jiemamy/serializer/SerializationTest.java 2009-02-08 12:10:29 UTC (rev 2630) @@ -38,6 +38,7 @@ import org.apache.commons.jxpath.JXPathContext; import org.apache.commons.lang.CharEncoding; import org.apache.commons.lang.ClassUtils; +import org.apache.commons.lang.SystemUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -223,6 +224,7 @@ // rootModel1 -> xml1 String xml1 = convertRootModelToXml(serializer1, rootModel1); + xml1 = xml1.replaceAll(SystemUtils.LINE_SEPARATOR, "\n"); // xml1 -> rootModel2 RootModel rootModel2 = convertXmlToRootModel(xml1, serializer2); @@ -234,6 +236,7 @@ // rootModel2 -> xml2 String xml2 = convertRootModelToXml(serializer2, rootModel2); + xml2 = xml2.replaceAll(SystemUtils.LINE_SEPARATOR, "\n"); // 参考のため、targetディレクトリに出力XMLを記録 FileUtils.writeStringToFile(new File("./target/" + ClassUtils.getShortClassName(this.getClass()) @@ -268,6 +271,7 @@ Validator validator = new AllValidator(); String xml1 = IOUtils.toString(SerializationTest.class.getResourceAsStream("/sample.xml"), CharEncoding.UTF_8); + xml1 = xml1.replaceAll(SystemUtils.LINE_SEPARATOR, "\n"); // xml1 -> rootModel1 RootModel rootModel1 = convertXmlToRootModel(xml1, serializer1); @@ -275,6 +279,7 @@ // rootModel1 -> xml2 String xml2 = convertRootModelToXml(serializer2, rootModel1); + xml2 = xml2.replaceAll(SystemUtils.LINE_SEPARATOR, "\n"); // xml1 -> rootModel2 RootModel rootModel2 = convertXmlToRootModel(xml2, serializer2);