mvolkmann / waxy

WAX - a new approach to writing XML
http://java.ociweb.com/mark/programming/wax.html
2 stars 0 forks source link

Improved JUnit test: Patch for 'WAXTest.testNoArgCtor' test method. #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I believe that 'System.setOut' is the method you wanted to call, to write 
this test.  Like this:

    @Test
    public void testNoArgCtor() {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        PrintStream originalSystemOut = System.out;
        System.setOut(new PrintStream(baos));
        try {
            WAX wax = new WAX();
            wax.start("root").close();
            assertEquals("<root/>", baos.toString());
        } finally {
            System.setOut(originalSystemOut);
        }
    }

Original issue reported on code.google.com by jeffgr...@charter.net on 14 Sep 2008 at 10:03

GoogleCodeExporter commented 9 years ago
Thanks Jeff! I put your change in and it worked great!
I'm glad you saw that I was having trouble figuring out how to do that.

Original comment by r.mark.v...@gmail.com on 14 Sep 2008 at 10:36