{
@Test
public void textSimpleProxyCreation() throws Exception
{
NormalScopeProxyFactory pf = new NormalScopeProxyFactory(new WebBeansContext());
// we take a fresh URLClassLoader to not blur the test classpath with synthetic classes.
ClassLoader classLoader = new URLClassLoader(new URL[0]);
Class<ClassInterceptedClass> proxyClass = pf.createProxyClass(classLoader, ClassInterceptedClass.class);
Assert.assertNotNull(proxyClass);
ClassInterceptedClass internalInstance = new ClassInterceptedClass();
internalInstance.init();
TestContextualInstanceProvider provider = new TestContextualInstanceProvider(internalInstance);
ClassInterceptedClass proxy = pf.createProxyInstance(proxyClass, provider);
Assert.assertEquals(42, proxy.getMeaningOfLife());
Assert.assertTrue(provider.gotInvoked());
Assert.assertEquals(internalInstance.getFloat(), proxy.getFloat(), 0f);