Search in sources :

Example 1 with UnexpectedCommand

use of com.willwinder.universalgcodesender.AbstractController.UnexpectedCommand in project Universal-G-Code-Sender by winder.

the class GrblControllerTest method testCommandComplete.

/**
 * Test of commandComplete method, of class GrblController.
 */
@Test
public void testCommandComplete() {
    System.out.println("commandComplete");
    GcodeCommand command = null;
    GrblController instance = new GrblController(mgc);
    // Test 1. Complete a command that was marked as sent but never declared
    // within commandSent(command).
    command = new GcodeCommand("blah");
    command.setSent(true);
    boolean hitException = false;
    try {
        instance.commandComplete(command.getCommandString());
    } catch (UnexpectedCommand ex) {
        hitException = true;
    }
    assertEquals(true, hitException);
// TODO: Test that command complete triggers a listener event.
// TODO: Test that command complete triggers fileStreamComplete.
}
Also used : GcodeCommand(com.willwinder.universalgcodesender.types.GcodeCommand) UnexpectedCommand(com.willwinder.universalgcodesender.AbstractController.UnexpectedCommand) Test(org.junit.Test) GcodeStreamTest(com.willwinder.universalgcodesender.utils.GcodeStreamTest)

Aggregations

UnexpectedCommand (com.willwinder.universalgcodesender.AbstractController.UnexpectedCommand)1 GcodeCommand (com.willwinder.universalgcodesender.types.GcodeCommand)1 GcodeStreamTest (com.willwinder.universalgcodesender.utils.GcodeStreamTest)1 Test (org.junit.Test)1