59 }
60 }
61
62 @Test
63 public void testVersionNotSet() {
64 try {
65 String xmlText = "Version not declared";
66 XMLStreamReader r = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(xmlText.getBytes()));
67 String version = r.getVersion();
68 System.out.println("Version for text \"" + xmlText + "\": " + version);
69 if (version != null) {
70 Assert.fail("getVersion should return null");
71 }
72
73 } catch (Exception e) {
74 e.printStackTrace();
75 Assert.fail("Exception occured: " + e.getMessage());
76 }
77 }
78 }
79
|
59 }
60 }
61
62 @Test
63 public void testVersionNotSet() {
64 try {
65 String xmlText = "Version not declared";
66 XMLStreamReader r = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(xmlText.getBytes()));
67 String version = r.getVersion();
68 System.out.println("Version for text \"" + xmlText + "\": " + version);
69 if (version != null) {
70 Assert.fail("getVersion should return null");
71 }
72
73 } catch (Exception e) {
74 e.printStackTrace();
75 Assert.fail("Exception occured: " + e.getMessage());
76 }
77 }
78 }
|