Search in sources :

Example 1 with NonWorkingServerProvider

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

the class ActiveContainerTestCase method requireThatServerAccessorWorks.

@Test
public void requireThatServerAccessorWorks() {
    TestDriver driver = TestDriver.newSimpleApplicationInstanceWithoutOsgi();
    ContainerBuilder builder = driver.newContainerBuilder();
    ServerProvider foo = new NonWorkingServerProvider();
    builder.serverProviders().install(foo);
    ServerProvider bar = new NonWorkingServerProvider();
    builder.serverProviders().install(bar);
    ActiveContainer container = new ActiveContainer(builder);
    Iterator<ServerProvider> it = container.serverProviders().iterator();
    assertTrue(it.hasNext());
    assertSame(foo, it.next());
    assertTrue(it.hasNext());
    assertSame(bar, it.next());
    assertFalse(it.hasNext());
    driver.close();
}
Also used : ContainerBuilder(com.yahoo.jdisc.application.ContainerBuilder) NonWorkingServerProvider(com.yahoo.jdisc.test.NonWorkingServerProvider) ServerProvider(com.yahoo.jdisc.service.ServerProvider) NonWorkingServerProvider(com.yahoo.jdisc.test.NonWorkingServerProvider) TestDriver(com.yahoo.jdisc.test.TestDriver) Test(org.junit.Test)

Aggregations

ContainerBuilder (com.yahoo.jdisc.application.ContainerBuilder)1 ServerProvider (com.yahoo.jdisc.service.ServerProvider)1 NonWorkingServerProvider (com.yahoo.jdisc.test.NonWorkingServerProvider)1 TestDriver (com.yahoo.jdisc.test.TestDriver)1 Test (org.junit.Test)1