Search in sources :

Example 1 with VoiceStub

use of org.eclipse.smarthome.core.voice.internal.VoiceStub 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 VoiceStub

use of org.eclipse.smarthome.core.voice.internal.VoiceStub in project smarthome by eclipse.

the class InterpretCommandTest method setUp.

@Before
public void setUp() throws IOException, InterruptedException {
    ttsService = new TTSServiceStub();
    hliStub = new HumanLanguageInterpreterStub();
    voice = new VoiceStub();
    registerService(voice);
    registerService(hliStub);
    registerService(ttsService);
    Dictionary<String, Object> config = new Hashtable<String, Object>();
    config.put(CONFIG_DEFAULT_TTS, ttsService.getId());
    config.put(CONFIG_DEFAULT_HLI, hliStub.getId());
    config.put(CONFIG_DEFAULT_VOICE, voice.getUID());
    ConfigurationAdmin configAdmin = super.getService(ConfigurationAdmin.class);
    String pid = "org.eclipse.smarthome.voice";
    Configuration configuration = configAdmin.getConfiguration(pid);
    configuration.update(config);
}
Also used : VoiceStub(org.eclipse.smarthome.core.voice.internal.VoiceStub) Configuration(org.osgi.service.cm.Configuration) TTSServiceStub(org.eclipse.smarthome.core.voice.internal.TTSServiceStub) Hashtable(java.util.Hashtable) HumanLanguageInterpreterStub(org.eclipse.smarthome.core.voice.internal.HumanLanguageInterpreterStub) ConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin) Before(org.junit.Before)

Example 3 with VoiceStub

use of org.eclipse.smarthome.core.voice.internal.VoiceStub in project smarthome by eclipse.

the class SayCommandTest method setUp.

@Before
public void setUp() {
    sink = new SinkStub();
    voice = new VoiceStub();
    BundleContext context = bundleContext;
    ttsService = new TTSServiceStub(context);
    registerService(sink);
    registerService(voice);
}
Also used : SinkStub(org.eclipse.smarthome.core.voice.internal.SinkStub) VoiceStub(org.eclipse.smarthome.core.voice.internal.VoiceStub) TTSServiceStub(org.eclipse.smarthome.core.voice.internal.TTSServiceStub) BundleContext(org.osgi.framework.BundleContext) Before(org.junit.Before)

Example 4 with VoiceStub

use of org.eclipse.smarthome.core.voice.internal.VoiceStub in project smarthome by eclipse.

the class VoicesCommandTest method setUp.

@Before
public void setUp() {
    BundleContext context = bundleContext;
    ttsService = new TTSServiceStub(context);
    sink = new SinkStub();
    voice = new VoiceStub();
    registerService(ttsService);
    registerService(sink);
    registerService(voice);
}
Also used : SinkStub(org.eclipse.smarthome.core.voice.internal.SinkStub) VoiceStub(org.eclipse.smarthome.core.voice.internal.VoiceStub) TTSServiceStub(org.eclipse.smarthome.core.voice.internal.TTSServiceStub) BundleContext(org.osgi.framework.BundleContext) Before(org.junit.Before)

Aggregations

TTSServiceStub (org.eclipse.smarthome.core.voice.internal.TTSServiceStub)4 VoiceStub (org.eclipse.smarthome.core.voice.internal.VoiceStub)4 Before (org.junit.Before)4 SinkStub (org.eclipse.smarthome.core.voice.internal.SinkStub)3 BundleContext (org.osgi.framework.BundleContext)3 Hashtable (java.util.Hashtable)2 Configuration (org.osgi.service.cm.Configuration)2 ConfigurationAdmin (org.osgi.service.cm.ConfigurationAdmin)2 VoiceManager (org.eclipse.smarthome.core.voice.VoiceManager)1 AudioManagerStub (org.eclipse.smarthome.core.voice.internal.AudioManagerStub)1 AudioSourceStub (org.eclipse.smarthome.core.voice.internal.AudioSourceStub)1 HumanLanguageInterpreterStub (org.eclipse.smarthome.core.voice.internal.HumanLanguageInterpreterStub)1 VoiceManagerImpl (org.eclipse.smarthome.core.voice.internal.VoiceManagerImpl)1