Search in sources :

Example 11 with ServerTestDriver

use of com.yahoo.messagebus.jdisc.test.ServerTestDriver in project vespa by vespa-engine.

the class MbusServerTestCase method requireThatBindingSetNotFoundExceptionIsCaught.

@Test
public void requireThatBindingSetNotFoundExceptionIsCaught() {
    ServerTestDriver driver = ServerTestDriver.newUnboundInstance(new MySelector("foo"));
    assertTrue(driver.sendMessage(new SimpleMessage("bar")));
    assertNotNull(driver.awaitErrors(ErrorCode.APP_FATAL_ERROR));
    assertTrue(driver.close());
}
Also used : SimpleMessage(com.yahoo.messagebus.test.SimpleMessage) ServerTestDriver(com.yahoo.messagebus.jdisc.test.ServerTestDriver) Test(org.junit.Test)

Example 12 with ServerTestDriver

use of com.yahoo.messagebus.jdisc.test.ServerTestDriver in project vespa by vespa-engine.

the class MbusServerTestCase method requireThatContainerNotReadyExceptionIsCaught.

@Test
public void requireThatContainerNotReadyExceptionIsCaught() {
    ServerTestDriver driver = ServerTestDriver.newInactiveInstance();
    assertTrue(driver.sendMessage(new SimpleMessage("foo")));
    assertNotNull(driver.awaitErrors(ErrorCode.APP_FATAL_ERROR));
    assertTrue(driver.close());
}
Also used : SimpleMessage(com.yahoo.messagebus.test.SimpleMessage) ServerTestDriver(com.yahoo.messagebus.jdisc.test.ServerTestDriver) Test(org.junit.Test)

Aggregations

ServerTestDriver (com.yahoo.messagebus.jdisc.test.ServerTestDriver)12 SimpleMessage (com.yahoo.messagebus.test.SimpleMessage)12 Test (org.junit.Test)11 Response (com.yahoo.jdisc.Response)5 SimpleReply (com.yahoo.messagebus.test.SimpleReply)2 Request (com.yahoo.jdisc.Request)1 Error (com.yahoo.messagebus.Error)1 LinkedList (java.util.LinkedList)1