コード例 #1
0
        public virtual void TestGetProviderViaURI()
        {
            Configuration conf    = new Configuration(false);
            Path          jksPath = new Path(testRootDir.ToString(), "test.jks");
            URI           uri     = new URI(JavaKeyStoreProvider.SchemeName + "://file" + jksPath.ToUri());
            KeyProvider   kp      = KeyProviderFactory.Get(uri, conf);

            NUnit.Framework.Assert.IsNotNull(kp);
            Assert.Equal(typeof(JavaKeyStoreProvider), kp.GetType());
            uri = new URI("foo://bar");
            kp  = KeyProviderFactory.Get(uri, conf);
            NUnit.Framework.Assert.IsNull(kp);
        }