use of org.osgi.service.event.EventAdmin in project sling by apache.
the class ResourceProviderTrackerTest method prepare.
@Before
public void prepare() throws Exception {
BundleContext bundleContext = MockOsgi.newBundleContext();
fixture = new Fixture(bundleContext);
EventAdmin eventAdmin = mock(EventAdmin.class);
@SuppressWarnings("unchecked") ResourceProvider<Object> rp = mock(ResourceProvider.class);
@SuppressWarnings("unchecked") ResourceProvider<Object> rp2 = mock(ResourceProvider.class);
@SuppressWarnings("unchecked") ResourceProvider<Object> rp3 = mock(ResourceProvider.class);
fixture.registerResourceProvider(rp, "/", AuthType.no);
rp2Info = fixture.registerResourceProvider(rp2, "/path", AuthType.lazy);
fixture.registerResourceProvider(rp3, "invalid", AuthType.no);
tracker = new ResourceProviderTracker();
tracker.setObservationReporterGenerator(new SimpleObservationReporterGenerator(new NoDothingObservationReporter()));
tracker.activate(bundleContext, eventAdmin, new DoNothingChangeListener());
}
Aggregations