< prev index next >

test/javax/xml/jaxp/unittest/transform/CR6941869Test.java

Print this page




  59             StringWriter xmlResultString = new StringWriter();
  60             StreamResult xmlResultStream = new StreamResult(xmlResultString);
  61 
  62             transformer.transform(new StreamSource(xml), xmlResultStream);
  63             System.out.println(xmlResultString.toString());
  64             String temp = xmlResultString.toString();
  65             int pos = temp.lastIndexOf("count");
  66             if (temp.substring(pos + 8, pos + 9).equals("1")) {
  67                 Assert.fail("count=1");
  68             } else if (temp.substring(pos + 8, pos + 9).equals("2")) {
  69                 // expected success
  70                 System.out.println("count=2");
  71             }
  72         } catch (Exception e) {
  73             // unexpected failure
  74             e.printStackTrace();
  75             Assert.fail(e.toString());
  76         }
  77     }
  78 }
  79 


  59             StringWriter xmlResultString = new StringWriter();
  60             StreamResult xmlResultStream = new StreamResult(xmlResultString);
  61 
  62             transformer.transform(new StreamSource(xml), xmlResultStream);
  63             System.out.println(xmlResultString.toString());
  64             String temp = xmlResultString.toString();
  65             int pos = temp.lastIndexOf("count");
  66             if (temp.substring(pos + 8, pos + 9).equals("1")) {
  67                 Assert.fail("count=1");
  68             } else if (temp.substring(pos + 8, pos + 9).equals("2")) {
  69                 // expected success
  70                 System.out.println("count=2");
  71             }
  72         } catch (Exception e) {
  73             // unexpected failure
  74             e.printStackTrace();
  75             Assert.fail(e.toString());
  76         }
  77     }
  78 }

< prev index next >