Search in sources :

Example 1 with AsyncInterfaceImpl

use of io.vertx.ext.sync.testmodel.AsyncInterfaceImpl in project vertx-sync by vert-x3.

the class TestVerticle method start.

@Override
@Suspendable
public void start() throws Exception {
    ai = new AsyncInterfaceImpl(vertx);
    completeChannel = Channels.newChannel(1, Channels.OverflowPolicy.THROW);
    try {
        String testName = config().getString("testName");
        Method meth = this.getClass().getDeclaredMethod(testName);
        meth.setAccessible(true);
        meth.invoke(this);
    } catch (AssertionError e) {
        e.printStackTrace();
        throw new IllegalStateException("Tests failed", e);
    } catch (Exception e) {
        e.printStackTrace();
        throw new IllegalStateException("Failed to invoke test", e);
    }
    completeChannel.receive(10, TimeUnit.SECONDS);
}
Also used : Method(java.lang.reflect.Method) AsyncInterfaceImpl(io.vertx.ext.sync.testmodel.AsyncInterfaceImpl) VertxException(io.vertx.core.VertxException) Suspendable(co.paralleluniverse.fibers.Suspendable)

Aggregations

Suspendable (co.paralleluniverse.fibers.Suspendable)1 VertxException (io.vertx.core.VertxException)1 AsyncInterfaceImpl (io.vertx.ext.sync.testmodel.AsyncInterfaceImpl)1 Method (java.lang.reflect.Method)1