Skip to content

Commit bd0c96f

Browse files
committed
Update XMLEncoder test.
1 parent 830b0ae commit bd0c96f

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

httprpc/src/main/java/org/httprpc/io/XMLDecoder.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ public class XMLDecoder {
5555
* If an exception occurs.
5656
*/
5757
public List<Map<String, ?>> read(Reader reader) throws IOException {
58-
reader = new BufferedReader(reader);
59-
6058
// TODO Parse input stream contents
6159

6260
return null;

httprpc/src/main/java/org/httprpc/io/XMLEncoder.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ public void write(Iterable<? extends Map<String, ?>> values, OutputStream output
7575
* If an exception occurs.
7676
*/
7777
public void write(Iterable<? extends Map<String, ?>> values, Writer writer) throws IOException {
78-
writer = new BufferedWriter(writer);
79-
8078
XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
8179

8280
try {

httprpc/src/test/java/org/httprpc/io/FlatFileEncoderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class FlatFileEncoderTest extends AbstractTest {
2929
@Test
3030
public void testWrite() throws IOException {
3131
String expected = " AB C 1 2.35 103\r\n" +
32-
" DEFGH IJ2 4.57 \r\n";
32+
" DÉFGH IJ2 4.57 \r\n";
3333

3434
List<Map<String, ?>> values = listOf(
3535
mapOf(
@@ -43,7 +43,7 @@ public void testWrite() throws IOException {
4343
entry("g", DayOfWeek.THURSDAY)
4444
),
4545
mapOf(
46-
entry("a", " DEFGH IJKL "),
46+
entry("a", " DÉFGH IJKL "),
4747
entry("b", 2),
4848
entry("c", 4.5678)
4949
)

httprpc/src/test/java/org/httprpc/io/XMLEncoderTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
public class XMLEncoderTest extends AbstractTest {
2929
@Test
3030
public void testWrite() throws IOException {
31-
String expected = ""; // TODO
31+
String expected = "<?xml version=\"1.0\" ?>"
32+
+ "<test>"
33+
+ "<item a=\"ABC\" b=\"1\" c=\"2.345\" d=\"{e=true}\" f=\"0\" g=\"3\"></item>"
34+
+ "<item a=\"DÉF\" b=\"2\" c=\"4.5678\"></item>"
35+
+ "</test>";
3236

3337
List<Map<String, ?>> values = listOf(
3438
mapOf(

0 commit comments

Comments
 (0)