Examples of MockBundle


Examples of org.apache.felix.cm.MockBundle


    Bundle createBundle( final String symbolicName, final Version version, final String location )
    {
        BundleContext ctx = new MockBundleContext();
        return new MockBundle( ctx, location )
        {
            public String getSymbolicName()
            {
                return symbolicName;
            }
View Full Code Here

Examples of org.apache.felix.cm.MockBundle

    private static class DMTestMockBundleContext extends MockBundleContext
    {
        public Bundle[] getBundles()
        {
            return new Bundle[]
                { new MockBundle( this, LOCATION1 ) };
        }
View Full Code Here

Examples of org.apache.felix.ipojo.test.MockBundle

    /**
     * Check that we don't create smart proxies for concrete and abstract classes.
     */
    public void testCannotProxyAbstractAndContreteClasses() {
        Bundle bundle = new MockBundle(Dependency.class.getClassLoader());

        BundleContext context = (BundleContext) Mockito.mock(BundleContext.class);
        Mockito.when(context.getProperty(DependencyHandler.PROXY_TYPE_PROPERTY)).thenReturn(null);
        Mockito.when(context.getProperty(Logger.IPOJO_LOG_LEVEL_PROP)).thenReturn(null);
        Mockito.when(context.getBundle()).thenReturn(bundle);
View Full Code Here

Examples of org.apache.felix.ipojo.test.MockBundle

     * [ERROR] test : Cannot create the proxy object
     * java.lang.SecurityException: Prohibited package name: java.awt
     * </code>
     */
    public void testProxiesOfJavaClasses() {
        Bundle bundle = new MockBundle(Dependency.class.getClassLoader());

        BundleContext context = (BundleContext) Mockito.mock(BundleContext.class);
        Mockito.when(context.getProperty(DependencyHandler.PROXY_TYPE_PROPERTY)).thenReturn(null);
        Mockito.when(context.getProperty(Logger.IPOJO_LOG_LEVEL_PROP)).thenReturn(null);
        Mockito.when(context.getBundle()).thenReturn(bundle);
View Full Code Here

Examples of org.apache.felix.ipojo.test.MockBundle

    public void setUp() {
        context = (BundleContext) Mockito.mock(BundleContext.class);
        Mockito.when(context.getProperty(DependencyHandler.PROXY_TYPE_PROPERTY)).thenReturn(null);
        Mockito.when(context.getProperty(Logger.IPOJO_LOG_LEVEL_PROP)).thenReturn(null);
        Mockito.when(context.getBundle()).thenReturn(new MockBundle(this.getClass().getClassLoader()));

        factory = (ComponentFactory) Mockito.mock(ComponentFactory.class);
        Mockito.when(factory.getBundleClassLoader()).thenReturn(ProvidedServiceHandler.class.getClassLoader());
        Mockito.when(factory.getLogger()).thenReturn(new Logger(context, "TEST", Logger.INFO));
View Full Code Here

Examples of org.apache.felix.ipojo.test.MockBundle

    public void setUp() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        context = (BundleContext) Mockito.mock(BundleContext.class);
        Mockito.when(context.getProperty(DependencyHandler.PROXY_TYPE_PROPERTY)).thenReturn(null);
        Mockito.when(context.getProperty(Logger.IPOJO_LOG_LEVEL_PROP)).thenReturn(null);
        Mockito.when(context.getBundle()).thenReturn(new MockBundle(this.getClass().getClassLoader()));

        factory = (ComponentFactory) Mockito.mock(ComponentFactory.class);
        Mockito.when(factory.getBundleClassLoader()).thenReturn(ProvidedServiceHandler.class.getClassLoader());
        logger = Mockito.spy(new Logger(context, "TEST", Logger.INFO));
        Mockito.when(factory.getLogger()).thenReturn(logger);
View Full Code Here

Examples of org.apache.felix.ipojo.test.MockBundle

    /**
     * Check that we don't create smart proxies for concrete and abstract classes.
     */
    public void testCannotProxyAbstractAndConcreteClasses() {
        Bundle bundle = new MockBundle(Dependency.class.getClassLoader());

        BundleContext context = (BundleContext) Mockito.mock(BundleContext.class);
        Mockito.when(context.getProperty(DependencyHandler.PROXY_TYPE_PROPERTY)).thenReturn(null);
        Mockito.when(context.getProperty(Logger.IPOJO_LOG_LEVEL_PROP)).thenReturn(null);
        Mockito.when(context.getBundle()).thenReturn(bundle);
View Full Code Here

Examples of org.apache.felix.ipojo.test.MockBundle

     * [ERROR] test : Cannot create the proxy object
     * java.lang.SecurityException: Prohibited package name: java.awt
     * </code>
     */
    public void testProxiesOfJavaClasses() {
        Bundle bundle = new MockBundle(Dependency.class.getClassLoader());

        BundleContext context = (BundleContext) Mockito.mock(BundleContext.class);
        Mockito.when(context.getProperty(DependencyHandler.PROXY_TYPE_PROPERTY)).thenReturn(null);
        Mockito.when(context.getProperty(Logger.IPOJO_LOG_LEVEL_PROP)).thenReturn(null);
        Mockito.when(context.getBundle()).thenReturn(bundle);
View Full Code Here

Examples of org.apache.felix.scr.impl.MockBundle

        try
        {
            final KXml2SAXParser parser = new KXml2SAXParser( reader );

            XmlHandler handler = new XmlHandler( new MockBundle(), logger, false, false );
            parser.parseXML( handler );

            return handler.getComponentMetadataList();
        }
        finally
View Full Code Here

Examples of org.apache.felix.scr.impl.MockBundle

        try
        {
            final KXml2SAXParser parser = new KXml2SAXParser( reader );

            XmlHandler handler = new XmlHandler( new MockBundle(), logger );
            parser.parseXML( handler );

            return handler.getComponentMetadataList();
        }
        finally
View Full Code Here
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.