public void testNameRelation()
        {
            // Set up the validators.
            CertificateFetcher fetcher         = new CertificateFetcherOffline();
            ValidatorConfig    validatorPrefix = new ValidatorConfig(fetcher);
            ValidatorConfig    validatorEqual  = new ValidatorConfig(fetcher);
            ValidatorConfig    validatorStrict = new ValidatorConfig(fetcher);

            validatorPrefix.load(new FileInfo(System.IO.Path.Combine(policyConfigDirectory_.FullName, "relation_ruleset_prefix.conf")).FullName);
            validatorEqual.load(new FileInfo(System.IO.Path.Combine(policyConfigDirectory_.FullName, "relation_ruleset_equal.conf")).FullName);
            validatorStrict.load(new FileInfo(System.IO.Path.Combine(policyConfigDirectory_.FullName, "relation_ruleset_strict.conf")).FullName);

            // Set up a Data packet and result object.
            Data data = new Data();

            net.named_data.jndn.KeyLocator.getFromSignature(data.getSignature()).setType(
                net.named_data.jndn.KeyLocatorType.KEYNAME);
            net.named_data.jndn.KeyLocator.getFromSignature(data.getSignature()).setKeyName(
                new Name("/SecurityTestSecRule/KEY/123"));
            TestValidationPolicyConfig.TestValidationResult result = new TestValidationPolicyConfig.TestValidationResult(data);

            data.setName(new Name("/TestRule1"));
            result.checkPolicy(validatorPrefix);
            Assert.AssertTrue("Prefix relation should match prefix name",
                              result.calledContinue_ && !result.calledFailure_);
            result.checkPolicy(validatorEqual);
            Assert.AssertTrue("Equal relation should match prefix name",
                              result.calledContinue_ && !result.calledFailure_);
            result.checkPolicy(validatorStrict);
            Assert.AssertTrue("Strict-prefix relation should not match prefix name",
                              result.calledFailure_ && !result.calledContinue_);

            data.setName(new Name("/TestRule1/hi"));
            result.checkPolicy(validatorPrefix);
            Assert.AssertTrue("Prefix relation should match longer name",
                              result.calledContinue_ && !result.calledFailure_);
            result.checkPolicy(validatorEqual);
            Assert.AssertTrue("Equal relation should not match longer name",
                              result.calledFailure_ && !result.calledContinue_);
            result.checkPolicy(validatorStrict);
            Assert.AssertTrue("Strict-prefix relation should match longer name",
                              result.calledContinue_ && !result.calledFailure_);

            data.setName(new Name("/Bad/TestRule1/"));
            result.checkPolicy(validatorPrefix);
            Assert.AssertTrue("Prefix relation should not match inner components",
                              result.calledFailure_ && !result.calledContinue_);
            result.checkPolicy(validatorEqual);
            Assert.AssertTrue("Equal relation should not match inner components",
                              result.calledFailure_ && !result.calledContinue_);
            result.checkPolicy(validatorStrict);
            Assert.AssertTrue("Strict-prefix relation should  not match inner components",
                              result.calledFailure_ && !result.calledContinue_);
        }
        public void testHyperRelation()
        {
            // Set up the validator.
            CertificateFetcher fetcher   = new CertificateFetcherOffline();
            ValidatorConfig    validator = new ValidatorConfig(fetcher);

            validator.load(new FileInfo(System.IO.Path.Combine(policyConfigDirectory_.FullName, "hyperrelation_ruleset.conf")).FullName);

            // Set up a Data packet and result object.
            Data data = new Data();

            net.named_data.jndn.KeyLocator.getFromSignature(data.getSignature()).setType(
                net.named_data.jndn.KeyLocatorType.KEYNAME);
            TestValidationPolicyConfig.TestValidationResult result = new TestValidationPolicyConfig.TestValidationResult(data);

            data.setName(new Name("/SecurityTestSecRule/Basic/Longer/Data2"));

            net.named_data.jndn.KeyLocator.getFromSignature(data.getSignature()).setKeyName(
                new Name("/SecurityTestSecRule/Basic/Longer/KEY/123"));
            result.checkPolicy(validator);
            Assert.AssertTrue(result.calledFailure_ && !result.calledContinue_);
            net.named_data.jndn.KeyLocator.getFromSignature(data.getSignature()).setKeyName(
                new Name("/SecurityTestSecRule/Basic/KEY/123"));
            result.checkPolicy(validator);
            Assert.AssertTrue(result.calledFailure_ && !result.calledContinue_);

            data.setName(new Name("/SecurityTestSecRule/Basic/Other/Data1"));

            net.named_data.jndn.KeyLocator.getFromSignature(data.getSignature()).setKeyName(
                new Name("/SecurityTestSecRule/Basic/Longer/KEY/123"));
            result.checkPolicy(validator);
            Assert.AssertTrue(result.calledFailure_ && !result.calledContinue_);
            net.named_data.jndn.KeyLocator.getFromSignature(data.getSignature()).setKeyName(
                new Name("/SecurityTestSecRule/Basic/KEY/123"));
            result.checkPolicy(validator);
            Assert.AssertTrue(result.calledFailure_ && !result.calledContinue_);
        }