Search in sources :

Example 1 with VoiceManager

use of org.eclipse.smarthome.core.voice.VoiceManager in project smarthome by eclipse.

the class VoiceManagerTest method setUp.

@Before
public void setUp() throws IOException {
    voiceManager = getService(VoiceManager.class, VoiceManagerImpl.class);
    assertNotNull(voiceManager);
    BundleContext context = bundleContext;
    ttsService = new TTSServiceStub(context);
    sink = new SinkStub();
    voice = new VoiceStub();
    source = new AudioSourceStub();
    registerService(sink);
    registerService(voice);
    Dictionary<String, Object> voiceConfig = new Hashtable<String, Object>();
    voiceConfig.put(CONFIG_DEFAULT_TTS, ttsService.getId());
    ConfigurationAdmin configAdmin = super.getService(ConfigurationAdmin.class);
    Configuration configuration = configAdmin.getConfiguration(PID);
    configuration.update(voiceConfig);
    audioManager = new AudioManagerStub();
    registerService(audioManager);
}
Also used : VoiceManagerImpl(org.eclipse.smarthome.core.voice.internal.VoiceManagerImpl) Configuration(org.osgi.service.cm.Configuration) TTSServiceStub(org.eclipse.smarthome.core.voice.internal.TTSServiceStub) AudioSourceStub(org.eclipse.smarthome.core.voice.internal.AudioSourceStub) Hashtable(java.util.Hashtable) SinkStub(org.eclipse.smarthome.core.voice.internal.SinkStub) VoiceStub(org.eclipse.smarthome.core.voice.internal.VoiceStub) ConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin) AudioManagerStub(org.eclipse.smarthome.core.voice.internal.AudioManagerStub) VoiceManager(org.eclipse.smarthome.core.voice.VoiceManager) BundleContext(org.osgi.framework.BundleContext) Before(org.junit.Before)

Example 2 with VoiceManager

use of org.eclipse.smarthome.core.voice.VoiceManager in project smarthome by eclipse.

the class VoiceConsoleCommandExtensionTest method setup.

@Before
public void setup() {
    voiceManager = getService(VoiceManager.class, VoiceManagerImpl.class);
    assertNotNull(voiceManager);
    extensionService = getService(ConsoleCommandExtension.class, VoiceConsoleCommandExtension.class);
    assertNotNull(extensionService);
    sink = new SinkStub();
    source = new AudioSourceStub();
    audioManager = new AudioManagerStub();
    console = new ConsoleStub();
    registerService(audioManager);
    registerService(voiceManager);
}
Also used : SinkStub(org.eclipse.smarthome.core.voice.internal.SinkStub) ConsoleStub(org.eclipse.smarthome.core.voice.internal.ConsoleStub) VoiceManagerImpl(org.eclipse.smarthome.core.voice.internal.VoiceManagerImpl) VoiceConsoleCommandExtension(org.eclipse.smarthome.core.voice.internal.VoiceConsoleCommandExtension) AudioSourceStub(org.eclipse.smarthome.core.voice.internal.AudioSourceStub) VoiceConsoleCommandExtension(org.eclipse.smarthome.core.voice.internal.VoiceConsoleCommandExtension) ConsoleCommandExtension(org.eclipse.smarthome.io.console.extensions.ConsoleCommandExtension) AudioManagerStub(org.eclipse.smarthome.core.voice.internal.AudioManagerStub) VoiceManager(org.eclipse.smarthome.core.voice.VoiceManager) Before(org.junit.Before)

Aggregations

VoiceManager (org.eclipse.smarthome.core.voice.VoiceManager)2 AudioManagerStub (org.eclipse.smarthome.core.voice.internal.AudioManagerStub)2 AudioSourceStub (org.eclipse.smarthome.core.voice.internal.AudioSourceStub)2 SinkStub (org.eclipse.smarthome.core.voice.internal.SinkStub)2 VoiceManagerImpl (org.eclipse.smarthome.core.voice.internal.VoiceManagerImpl)2 Before (org.junit.Before)2 Hashtable (java.util.Hashtable)1 ConsoleStub (org.eclipse.smarthome.core.voice.internal.ConsoleStub)1 TTSServiceStub (org.eclipse.smarthome.core.voice.internal.TTSServiceStub)1 VoiceConsoleCommandExtension (org.eclipse.smarthome.core.voice.internal.VoiceConsoleCommandExtension)1 VoiceStub (org.eclipse.smarthome.core.voice.internal.VoiceStub)1 ConsoleCommandExtension (org.eclipse.smarthome.io.console.extensions.ConsoleCommandExtension)1 BundleContext (org.osgi.framework.BundleContext)1 Configuration (org.osgi.service.cm.Configuration)1 ConfigurationAdmin (org.osgi.service.cm.ConfigurationAdmin)1