forked from mozilla/smarthome
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue eclipse-archived#1021: Implementation of STT Interfaces
Signed-off-by: Kelly Davis <kdavis@mozilla.com>
- Loading branch information
1 parent
74f6c12
commit 84bf4da
Showing
3 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
...pse.smarthome.io.voice/src/test/java/org/eclipse/smarthome/io/voice/STTExceptionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* Copyright (c) 2014-2016 openHAB UG (haftungsbeschraenkt) and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package org.eclipse.smarthome.io.voice; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Test general purpose STT exception | ||
* | ||
* @author Kelly Davis - Initial contribution and API | ||
*/ | ||
public class STTExceptionTest { | ||
/** | ||
* Test STTException() constructor | ||
*/ | ||
@Test | ||
public void testConstructor0() { | ||
STTException ttsException = new STTException(); | ||
Assert.assertNotNull("STTException() constructor failed", ttsException); | ||
} | ||
|
||
/** | ||
* Test STTException(String message, Throwable cause) constructor | ||
*/ | ||
@Test | ||
public void testConstructor1() { | ||
STTException ttsException = new STTException("Message", new Throwable()); | ||
Assert.assertNotNull("STTException(String, Throwable) constructor failed", ttsException); | ||
} | ||
|
||
/** | ||
* Test STTException(String message) constructor | ||
*/ | ||
@Test | ||
public void testConstructor2() { | ||
STTException ttsException = new STTException("Message"); | ||
Assert.assertNotNull("STTException(String) constructor failed", ttsException); | ||
} | ||
|
||
/** | ||
* Test STTException(Throwable cause) constructor | ||
*/ | ||
@Test | ||
public void testConstructor3() { | ||
STTException ttsException = new STTException(new Throwable()); | ||
Assert.assertNotNull("STTException(Throwable) constructor failed", ttsException); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...o.voice/src/test/java/org/eclipse/smarthome/io/voice/SpeechRecognitionErrorEventTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright (c) 2014-2016 openHAB UG (haftungsbeschraenkt) and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package org.eclipse.smarthome.io.voice; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Test SpeechRecognitionErrorEvent event | ||
* | ||
* @author Kelly Davis - Initial contribution and API | ||
*/ | ||
public class SpeechRecognitionErrorEventTest { | ||
/** | ||
* Test SpeechRecognitionErrorEvent(String) constructor | ||
*/ | ||
@Test | ||
public void testConstructor() { | ||
SpeechRecognitionErrorEvent sRE = new SpeechRecognitionErrorEvent("Message"); | ||
Assert.assertNotNull("SpeechRecognitionErrorEvent(String) constructor failed", sRE); | ||
} | ||
|
||
/** | ||
* Test SpeechRecognitionErrorEvent.getMessage() method | ||
*/ | ||
@Test | ||
public void getMessageTest() { | ||
SpeechRecognitionErrorEvent sRE = new SpeechRecognitionErrorEvent("Message"); | ||
Assert.assertEquals("SpeechRecognitionErrorEvent.getMessage() method failed", "Message", sRE.getMessage()); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...ome.io.voice/src/test/java/org/eclipse/smarthome/io/voice/SpeechRecognitionEventTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* Copyright (c) 2014-2016 openHAB UG (haftungsbeschraenkt) and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package org.eclipse.smarthome.io.voice; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Test SpeechRecognitionEvent event | ||
* | ||
* @author Kelly Davis - Initial contribution and API | ||
*/ | ||
public class SpeechRecognitionEventTest { | ||
/** | ||
* Test SpeechRecognitionEvent(String, float) constructor | ||
*/ | ||
@Test | ||
public void testConstructor() { | ||
SpeechRecognitionEvent sRE = new SpeechRecognitionEvent("Message", 0.5); | ||
Assert.assertNotNull("SpeechRecognitionEvent(String, float) constructor failed", sRE); | ||
} | ||
|
||
/** | ||
* Test SpeechRecognitionEvent.getTranscript() method | ||
*/ | ||
@Test | ||
public void getTranscriptTest() { | ||
SpeechRecognitionEvent sRE = new SpeechRecognitionEvent("Message", 0.5); | ||
Assert.assertEquals("SpeechRecognitionEvent.getTranscript() method failed", "Message", sRE.getTranscript()); | ||
} | ||
|
||
/** | ||
* Test SpeechRecognitionEvent.getConfidence() method | ||
*/ | ||
@Test | ||
public void getConfidenceTest() { | ||
SpeechRecognitionEvent sRE = new SpeechRecognitionEvent("Message", 0.5); | ||
Assert.assertEquals("SpeechRecognitionEvent.getConfidence() method failed", 0.5, sRE.getConfidence()); | ||
} | ||
} |