@Test public void say_パラメータに未定義の値を指定した場合はエラー() { VoiceParameter param = new VoiceParameter(); param.setText("こんにちは"); param.setSpeechSpeedRate(-1.0f); try { _s.say(param); fail(); } catch (OpenJTalkRuntimeException e) { e.printStackTrace(); } }
public byte[] say(VoiceParameter param) { L.debug("#say: param=" + param); if (param == null) { throw new IllegalArgumentException("param is null."); } if (StringUtils.isBlank(param.getText())) { throw new IllegalArgumentException("param.text is blank."); } param.setText(param.getText().trim()); byte[] voiceData = _openJTalkRepo.createVoice(param); L.debug("voiceData.length=" + voiceData.length); return voiceData; }
VoiceService { public byte[] say(VoiceParameter param) { L.debug("#say: param=" + param); if (param == null) { throw new IllegalArgumentException("param is null."); } if (StringUtils.isBlank(param.getText())) { throw new IllegalArgumentException("param.text is blank."); } param.setText(param.getText().trim()); byte[] voiceData = _openJTalkRepo.createVoice(param); L.debug("voiceData.length=" + voiceData.length); return voiceData; } }
VoiceService { public byte[] say(VoiceParameter param) { L.debug("#say: param=" + param); if (param == null) { throw new IllegalArgumentException("param is null."); } if (StringUtils.isBlank(param.getText())) { throw new IllegalArgumentException("param.text is blank."); } param.setText(param.getText().trim()); byte[] voiceData = _openJTalkRepo.createVoice(param); L.debug("voiceData.length=" + voiceData.length); return voiceData; }  }
VoiceService { public byte[] say(VoiceParameter param) { L.debug("#say: param=" + param); if (param == null) { throw new IllegalArgumentException("param is null."); } if (StringUtils.isBlank(param.getText())) { throw new IllegalArgumentException("param.text is blank."); } param.setText(param.getText().trim()); byte[] voiceData = _openJTalkRepo.createVoice(param); L.debug("voiceData.length=" + voiceData.length); return voiceData; }  byte[] say(VoiceParameter param); }
VoiceService { public byte[] say(VoiceParameter param) { L.debug("#say: param=" + param); if (param == null) { throw new IllegalArgumentException("param is null."); } if (StringUtils.isBlank(param.getText())) { throw new IllegalArgumentException("param.text is blank."); } param.setText(param.getText().trim()); byte[] voiceData = _openJTalkRepo.createVoice(param); L.debug("voiceData.length=" + voiceData.length); return voiceData; }  byte[] say(VoiceParameter param);  }