@Before public void setUp() throws ResourceUnavailableException, TooManyConnectionsException, IOException { super.setup(); resourcesPool = new ResourcesPool(mediaScheduler, channelsManager, dspFactory); // assign scheduler to the endpoint endpoint1 = new MyTestEndpoint("test-1"); endpoint1.setScheduler(mediaScheduler); endpoint1.setResourcesPool(resourcesPool); endpoint1.setFreq(400); endpoint1.start(); endpoint2 = new MyTestEndpoint("test-2"); endpoint2.setScheduler(mediaScheduler); endpoint2.setResourcesPool(resourcesPool); endpoint2.setFreq(200); endpoint2.start(); endpoint3 = new MyTestEndpoint("test-3"); endpoint3.setScheduler(mediaScheduler); endpoint3.setResourcesPool(resourcesPool); endpoint3.setFreq(600); endpoint3.start(); endpoint4 = new MyTestEndpoint("test-4"); endpoint4.setScheduler(mediaScheduler); endpoint4.setResourcesPool(resourcesPool); endpoint4.setFreq(800); endpoint4.start(); sine1 = endpoint1.getResource(MediaType.AUDIO, ComponentType.SINE); sine2 = endpoint2.getResource(MediaType.AUDIO, ComponentType.SINE); sine3 = endpoint3.getResource(MediaType.AUDIO, ComponentType.SINE); sine4 = endpoint4.getResource(MediaType.AUDIO, ComponentType.SINE); analyzer1 = endpoint1.getResource(MediaType.AUDIO, ComponentType.SPECTRA_ANALYZER); analyzer2 = endpoint2.getResource(MediaType.AUDIO, ComponentType.SPECTRA_ANALYZER); analyzer3 = endpoint3.getResource(MediaType.AUDIO, ComponentType.SPECTRA_ANALYZER); analyzer4 = endpoint4.getResource(MediaType.AUDIO, ComponentType.SPECTRA_ANALYZER); }
@After @Override public void tearDown() { if (endpoint1 != null) { endpoint1.stop(); } if (endpoint2 != null) { endpoint2.stop(); } if (endpoint3 != null) { endpoint3.stop(); } if (endpoint4 != null) { endpoint4.stop(); } super.tearDown(); }