@Test
    public void testPolicyLoad() {
        policyFactory.loadPolicy(PassthroughPolicy.QUALIFIED_NAME, new IAsyncResultHandler<IPolicy>() {
            @Override
            public void handle(IAsyncResult<IPolicy> result) {
                Assert.assertEquals("Should classload one Policy via class:CanonicalName", getNumPolicies(), 1);
            }
        });
        
        policyFactory.loadPolicy(PassthroughPolicy.QUALIFIED_NAME, new IAsyncResultHandler<IPolicy>() {
            @Override
            public void handle(IAsyncResult<IPolicy> result) {
                Assert.assertNotNull("Should return a valid async result", result);
                Assert.assertTrue(result.isSuccess());
                Assert.assertNotNull("Should return a new IPolicy instance", result.getResult());
            }
        });
        
        policyFactory.loadPolicy("class:org.example.NotFound", new IAsyncResultHandler<IPolicy>() {
            @Override
            public void handle(IAsyncResult<IPolicy> result) {
                Assert.assertNotNull("Should return a valid async result", result);
                Assert.assertTrue(result.isError());
                Assert.assertNotNull("Should return an exception", result.getError());
                Assert.assertEquals(PolicyNotFoundException.class.getName(), result.getError().getClass().getName());
            }
        });
    }
Test {@link IPolicyFactory} functionality, in particular ensuring classes are
discovered, loaded, instantiated and configured as expected.

@author Marc Savy <msavy@redhat.com>
gateway/engine/core/src/test/java/io/apiman/gateway/engine/impl/PolicyLoadTest.java