TextTelephony implements Telephony { @Override public void record(final SpokenInput input, final CallControlProperties props) throws NoresourceError, IOException { if (sentHungup) { throw new NoresourceError("connection disconnected"); } if (!(input instanceof TextSpokenInput)) { throw new IOException("input does not support texts!"); } fireRecordStarted(); final TextSpokenInput textInput = (TextSpokenInput) input; receiver.setSpokenInput(textInput); sender.sendExpectingInput(); } TextTelephony(); @Override void play(final SynthesizedOutput output,
            final CallControlProperties props); @Override void stopPlay(); @Override void record(final SpokenInput input,
            final CallControlProperties props); @Override AudioFormat getRecordingAudioFormat(); @Override void startRecording(final SpokenInput input,
            final OutputStream stream, final CallControlProperties props); @Override void stopRecording(); @Override void transfer(final String dest); @Override void hangup(); @Override void activate(); @Override void close(); @Override String getType(); @Override boolean isBusy(); @Override boolean isActive(); @Override void open(); @Override void passivate(); @Override void connect(final ConnectionInformation info); @Override void disconnect(final ConnectionInformation client); @Override void addListener(final TelephonyListener callListener); @Override void removeListener(final TelephonyListener callListener);  }
@Test(timeout = 5000) public void testRecord() throws Exception, JVoiceXMLEvent { final TextSpokenInput textInput = new TextSpokenInput(); textInput.startRecognition(null, null, null); textInput.addListener(this); final String utterance = "testRecord"; mockGrammarChecker(textInput, utterance); telephony.record(textInput, null); Assert.assertTrue(telephony.isBusy()); server.sendInput(utterance); synchronized (lock) { lock.wait(MAX_WAIT); } Assert.assertNotNull(receivedResult); }