XPathParser { protected NameTest parseNameTest( TokenStream tokens ) { NameTest wildcard = parseWildcard(tokens); if (wildcard != null) return wildcard; return parseQName(tokens); } XPathParser( TypeSystem context ); Component parseXPath( String xpath );  }
@Test public void shouldParseName() { assertThat(parser.parseNameTest(tokenize("*")), is(wildcard())); assertThat(parser.parseNameTest(tokenize("*:*")), is(wildcard())); assertThat(parser.parseNameTest(tokenize("*:name")), is(nameTest(null, "name"))); assertThat(parser.parseNameTest(tokenize("name:*")), is(nameTest("name", null))); assertThat(parser.parseNameTest(tokenize("abc")), is(nameTest("abc"))); assertThat(parser.parseNameTest(tokenize("abc:def")), is(nameTest("abc", "def"))); }
@Test( expected = ParsingException.class ) public void shouldFailToParseNameIfNotValidWildcardOrQName() { parser.parseNameTest(tokenize("3ABC:def")); }