Search in sources :

Example 1 with MockComponentLogger

use of org.apache.felix.scr.impl.logger.MockComponentLogger in project felix by apache.

the class ActivateMethodTest method newContainer.

private ComponentContainer newContainer() {
    final ComponentMetadata metadata = newMetadata();
    ComponentContainer container = new ComponentContainer() {

        @Override
        public ComponentActivator getActivator() {
            final ComponentActivator ca = Mockito.mock(ComponentActivator.class);
            Mockito.when(ca.getBundleContext()).thenReturn(Mockito.mock(BundleContext.class));
            return ca;
        }

        @Override
        public ComponentMetadata getComponentMetadata() {
            return metadata;
        }

        @Override
        public void disposed(SingleComponentManager component) {
        }

        public boolean isEnabled() {
            return false;
        }

        @Override
        public ComponentLogger getLogger() {
            return new MockComponentLogger();
        }
    };
    return container;
}
Also used : SingleComponentManager(org.apache.felix.scr.impl.manager.SingleComponentManager) ComponentActivator(org.apache.felix.scr.impl.manager.ComponentActivator) ComponentContainer(org.apache.felix.scr.impl.manager.ComponentContainer) MockComponentLogger(org.apache.felix.scr.impl.logger.MockComponentLogger) ComponentMetadata(org.apache.felix.scr.impl.metadata.ComponentMetadata) BundleContext(org.osgi.framework.BundleContext)

Aggregations

MockComponentLogger (org.apache.felix.scr.impl.logger.MockComponentLogger)1 ComponentActivator (org.apache.felix.scr.impl.manager.ComponentActivator)1 ComponentContainer (org.apache.felix.scr.impl.manager.ComponentContainer)1 SingleComponentManager (org.apache.felix.scr.impl.manager.SingleComponentManager)1 ComponentMetadata (org.apache.felix.scr.impl.metadata.ComponentMetadata)1 BundleContext (org.osgi.framework.BundleContext)1