-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
14 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,29 +1,43 @@ | ||
package org.myrobotlab.service; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
import org.junit.Test; | ||
import org.myrobotlab.framework.StaticType; | ||
import org.myrobotlab.service.config.OpenCVConfig; | ||
import org.myrobotlab.test.AbstractTest; | ||
|
||
public class InMoov2Test { | ||
public class InMoov2Test extends AbstractTest { | ||
|
||
@Test | ||
public void testCvFilters() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { | ||
|
||
InMoov2 i01 = (InMoov2)Runtime.start("i01", "InMoov2"); | ||
|
||
// flip | ||
i01.setPeerConfigValue("opencv", "flip", true); | ||
OpenCVConfig cvconfig = i01.getPeerConfig("opencv", new StaticType<>() {}); | ||
assertTrue(cvconfig.flip); | ||
|
||
i01.setPeerConfigValue("opencv", "flip", false); | ||
cvconfig = i01.getPeerConfig("opencv", new StaticType<>() {}); | ||
assertFalse(cvconfig.flip); | ||
|
||
Runtime.setConfig("InMoov2Test"); | ||
|
||
InMoov2 i01 = (InMoov2) Runtime.start("i01", "InMoov2"); | ||
|
||
|
||
// flip | ||
i01.setPeerConfigValue("opencv", "flip", true); | ||
OpenCVConfig cvconfig = i01.getPeerConfig("opencv", new StaticType<>() { | ||
}); | ||
assertTrue(cvconfig.flip); | ||
|
||
i01.setPeerConfigValue("opencv", "flip", false); | ||
cvconfig = i01.getPeerConfig("opencv", new StaticType<>() { | ||
}); | ||
assertFalse(cvconfig.flip); | ||
|
||
i01.startPeer("mouth"); | ||
|
||
long start = System.currentTimeMillis(); | ||
// i01.setSpeechType("LocalSpeech"); | ||
i01.speakBlocking( | ||
"Hello this is a way to test if speech is actually blocking, if it blocks it should take a little time to say this, if it doesn't work it will execute the next line immediately."); | ||
System.out.println(String.format("speech blocking time taken %d", System.currentTimeMillis() - start)); | ||
assertTrue(start > 2000); | ||
|
||
} | ||
|
||
|
||
} | ||
|