コード例 #1
0
 public void testInputStream() throws Exception {
   ByteArrayDataSource bads = new ByteArrayDataSource(EXAMPLE_XML.getBytes(), "text/xml", "name");
   ByteArrayOutputStream out = new ByteArrayOutputStream();
   out.write(bads.getBytes());
   out.flush();
   assertEquals("XML", out.toString(), EXAMPLE_XML);
 }
コード例 #2
0
 public void testOutputStream() throws Exception {
   ByteArrayDataSource bads = new ByteArrayDataSource(EXAMPLE_XML.getBytes(), "text/xml", "name");
   try {
     bads.getOutputStream();
     fail("getOutputStream should not be supported");
   } catch (Exception e) {;
   }
 }
コード例 #3
0
 public void testName() throws Exception {
   ByteArrayDataSource bads = new ByteArrayDataSource(EXAMPLE_XML.getBytes(), "text/xml", "name");
   assertEquals("name", "name", bads.getName());
 }