コード例 #1
0
        public void testExcludeMatches()
        {
            Exclude exclude = new Exclude();
            exclude.appendComponent(new Name("%00%02").get(0));
            exclude.appendAny();
            exclude.appendComponent(new Name("%00%20").get(0));

            Name.Component component;
            component = new Name("%00%01").get(0);
            Assert.AssertFalse(component.toEscapedString() + " should not match "
                    + exclude.toUri(), exclude.matches(component));
            component = new Name("%00%0F").get(0);
            Assert.AssertTrue(
                    component.toEscapedString() + " should match "
                            + exclude.toUri(), exclude.matches(component));
            component = new Name("%00%21").get(0);
            Assert.AssertFalse(component.toEscapedString() + " should not match "
                    + exclude.toUri(), exclude.matches(component));
        }