< prev index next >

test/javax/xml/jaxp/unittest/xpath/Bug4992793.java

Print this page




  66     // QName returnType)
  67     // source is null , should throw NPE
  68     @Test
  69     public void testXPath29() throws Exception {
  70         try {
  71             createXPath().evaluate(null, new InputSource(new StringReader("<root/>")), XPathConstants.STRING);
  72             Assert.fail();
  73         } catch (NullPointerException e) {
  74             ; // as expected
  75         }
  76     }
  77 
  78     private XPath createXPath() throws XPathFactoryConfigurationException {
  79         XPathFactory xpathFactory = XPathFactory.newInstance();
  80         Assert.assertNotNull(xpathFactory);
  81         XPath xpath = xpathFactory.newXPath();
  82         Assert.assertNotNull(xpath);
  83         return xpath;
  84     }
  85 }
  86 


  66     // QName returnType)
  67     // source is null , should throw NPE
  68     @Test
  69     public void testXPath29() throws Exception {
  70         try {
  71             createXPath().evaluate(null, new InputSource(new StringReader("<root/>")), XPathConstants.STRING);
  72             Assert.fail();
  73         } catch (NullPointerException e) {
  74             ; // as expected
  75         }
  76     }
  77 
  78     private XPath createXPath() throws XPathFactoryConfigurationException {
  79         XPathFactory xpathFactory = XPathFactory.newInstance();
  80         Assert.assertNotNull(xpathFactory);
  81         XPath xpath = xpathFactory.newXPath();
  82         Assert.assertNotNull(xpath);
  83         return xpath;
  84     }
  85 }

< prev index next >