WowzaStreamingDistributionService extends AbstractDistributionService implements StreamingDistributionService { public void activate(BundleContext bundleContext, Map<String, Object> properties) throws ComponentException, ConfigurationException { modified(bundleContext, properties); } WowzaStreamingDistributionService(); String getDistributionType(); void activate(BundleContext bundleContext, Map<String, Object> properties); void modified(BundleContext bundleContext, Map<String, Object> properties); boolean publishToStreaming(); @Override Job distribute(String channelId, MediaPackage mediapackage, Set<String> elementIds); @Override Job distribute(final String channelId, final MediaPackage mediapackage, final String elementId); @Override Job retract(String channelId, MediaPackage mediapackage, String elementId); @Override Job retract(String channelId, MediaPackage mediaPackage, Set<String> elementIds); @Override List<MediaPackageElement> distributeSync(String channelId, MediaPackage mediaPackage, Set<String> elementIds); @Override List<MediaPackageElement> retractSync(String channelId, MediaPackage mediaPackage, Set<String> elementIds); static final String JOB_TYPE; static final float DEFAULT_DISTRIBUTE_JOB_LOAD; static final float DEFAULT_RETRACT_JOB_LOAD; static final String DISTRIBUTE_JOB_LOAD_KEY; static final String RETRACT_JOB_LOAD_KEY; }
@Test public void testInitialization() throws Exception { setUpDefault(); map.put(defaultUrlProperty, streamingURL); map.put(defaultPortProperty, port); streamingService.activate(bundleContext, map); assertTrue(streamingService.streamingUrls.containsKey(defaultTenant)); assertEquals(1, streamingService.streamingUrls.size()); assertEquals(completeStreamingUrl, streamingService.streamingUrls.get(defaultTenant).toString()); }
@Test public void testNoPort() throws Exception { setUpDefault(); map.put(defaultUrlProperty, streamingURL); streamingService.activate(bundleContext, map); assertTrue(streamingService.streamingUrls.containsKey(defaultTenant)); assertEquals(1, streamingService.streamingUrls.size()); assertEquals(streamingURL, streamingService.streamingUrls.get(defaultTenant).toString()); }
@Test public void testNoStreamingURL() throws Exception { setUpDefault(); streamingService.activate(bundleContext, new HashMap()); assertFalse(streamingService.streamingUrls.containsKey(defaultTenant)); assertEquals(0, streamingService.streamingUrls.size()); }
@Test public void testMultipleTenants() throws Exception { setUpMultiTenant(); streamingService.activate(bundleContext, map); assertEquals(2, streamingService.streamingUrls.size()); assertTrue(streamingService.streamingUrls.containsKey(tenant1)); assertTrue(streamingService.streamingUrls.containsKey(tenant2)); assertFalse(streamingService.streamingUrls.containsKey(tenant3)); assertEquals(tenant1Url, streamingService.streamingUrls.get(tenant1).toString()); assertEquals(tenant2Url, streamingService.streamingUrls.get(tenant2).toString()); }