use of org.eclipse.smarthome.core.voice.internal.TTSServiceStub 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);
}
use of org.eclipse.smarthome.core.voice.internal.TTSServiceStub in project smarthome by eclipse.
the class VoiceManagerTest method getParameterOptionsForTheDefaultVoice.
@Test
public void getParameterOptionsForTheDefaultVoice() throws URISyntaxException {
BundleContext context = bundleContext;
ttsService = new TTSServiceStub(context);
registerService(ttsService);
boolean isVoiceStubInTheOptions = false;
Collection<ParameterOption> options = voiceManager.getParameterOptions(new URI("system:voice"), "defaultVoice", null);
assertNotNull(options);
for (ParameterOption option : options) {
String optionValue = option.getValue();
String optionLabel = option.getLabel();
String voiceStubId = voice.getUID();
String voiceLabel = voice.getLabel();
if (optionValue.equals(voiceStubId) && optionLabel.equals(voiceLabel + " - " + voice.getLocale().getDisplayName())) {
isVoiceStubInTheOptions = true;
}
}
assertTrue(isVoiceStubInTheOptions);
}
use of org.eclipse.smarthome.core.voice.internal.TTSServiceStub 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);
}
use of org.eclipse.smarthome.core.voice.internal.TTSServiceStub 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);
}
use of org.eclipse.smarthome.core.voice.internal.TTSServiceStub in project smarthome by eclipse.
the class VoiceManagerTest method getParameterOptionsForTheDefaultTts.
@Test
public void getParameterOptionsForTheDefaultTts() throws URISyntaxException {
ttsService = new TTSServiceStub();
registerService(ttsService);
boolean isTTSStubInTheOptions = false;
Collection<ParameterOption> options = voiceManager.getParameterOptions(new URI("system:voice"), "defaultTTS", null);
assertNotNull(options);
for (ParameterOption option : options) {
String optionValue = option.getValue();
String optionLabel = option.getLabel();
String ttsStubId = ttsService.getId();
String ttsLabel = ttsService.getLabel(null);
if (optionValue.equals(ttsStubId) && optionLabel.equals(ttsLabel)) {
isTTSStubInTheOptions = true;
}
}
assertTrue(isTTSStubInTheOptions);
}
Aggregations