Package wstxtest.osgi

Source Code of wstxtest.osgi.TestBasic$ContextHandler

package wstxtest.osgi;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

import wstxtest.BaseWstxTest;

import org.osgi.framework.*;

import com.ctc.wstx.osgi.*;

public class TestBasic
    extends BaseWstxTest
{
    public void testBundleActivation()
    {
        // Hmmh. Context is a beastly class... let's just proxy it
        InvocationHandler h = new ContextHandler();
        BundleContext ctxt = (BundleContext) Proxy.newProxyInstance(BundleContext.class.getClassLoader(), new Class[] { BundleContext.class }, h);
        WstxBundleActivator act = new WstxBundleActivator();

        // won't prove much... but at least there's noo fundamental flaw:
        act.start(ctxt);
    }

    /*
    //////////////////////////////////////////
    // Helper classes
    //////////////////////////////////////////
     */

    final static class ContextHandler
        implements InvocationHandler
    {
        public Object invoke(Object proxy, Method method, Object[] args)
        {
            // !!! TODO: make do something...
            return null;
        }
    }
}
TOP

Related Classes of wstxtest.osgi.TestBasic$ContextHandler

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.