1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.xml.xpath;
18
19 import org.junit.Assert;
20 import org.junit.Test;
21
22 public class XPathExpressionFactoryTest {
23
24 @Test
25 public void testCreateXPathExpression() throws Exception {
26 XPathExpression expression = XPathExpressionFactory.createXPathExpression("/root");
27 Assert.assertNotNull("No expression returned", expression);
28 }
29
30 @Test
31 public void testCreateEmptyXPathExpression() throws Exception {
32 try {
33 XPathExpressionFactory.createXPathExpression("");
34 Assert.fail("Should have thrown an Exception");
35 }
36 catch (IllegalArgumentException ex) {
37
38 }
39 }
40 }