当前位置: 首页>>代码示例>>Java>>正文


Java VertxAssert.testComplete方法代码示例

本文整理汇总了Java中org.vertx.testtools.VertxAssert.testComplete方法的典型用法代码示例。如果您正苦于以下问题:Java VertxAssert.testComplete方法的具体用法?Java VertxAssert.testComplete怎么用?Java VertxAssert.testComplete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.vertx.testtools.VertxAssert的用法示例。


在下文中一共展示了VertxAssert.testComplete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handle

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
@Override
public void handle(final Long timerId) {
    if (m_latch.getCount() == 0) {
        if (m_counter++ > 80) {
            // Stop test
            VertxAssert.testComplete();
        } else {
            //
            // Generate test events
            //
            for (JsonObject json : m_metrics) {
                JsonObject event = EventCreator.createBatch("metrics", json.toMap(), 5);
                vertx.eventBus().publish(FILTER_SOURCE_ADDRESS, event);
            }
        }
    }
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:18,代码来源:InfluxDbTest.java

示例2: handle

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
@Override
public void handle(final Long timerId) {
    if (m_counter++ > 50) {
        // Stop test
        vertx.cancelTimer(m_timer);
        VertxAssert.testComplete();
        m_cmd.destroy(true);
    } else {
        //
        // Generate test events
        //                            
        Map<String, Object> nsqFields = new HashMap();
        nsqFields.put(TOPIC_KEY, FILTER_NSQ_TOPIC);
        JsonObject event = EventCreator.createBatch("NSQ", nsqFields);
        vertx.eventBus().publish(FILTER_SOURCE_ADDRESS, event);
    }
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:18,代码来源:NsqHttpOutTest.java

示例3: handle

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
@Override
public void handle(final Message<JsonObject> message) {
    m_logger.info("Received message {}: {}", m_counter, message.body().toString());

    if (++m_counter >= 100) {

        // Forcefully stop processes
        m_cmd1.destroy(true);
        m_cmd2.destroy(true);

        // Stop test
        VertxAssert.testComplete();
    }
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:15,代码来源:NsqInTest.java

示例4: handle

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
@Override
public void handle(final Long timerId) {
    if (m_counter++ > 10) {
        // Stop test
        VertxAssert.testComplete();
    } else {
        //
        // Generate test events
        //
        for (JsonObject json : m_metrics) {
            JsonObject event = EventCreator.createBatch("metrics", json.toMap(), 5);
            vertx.eventBus().publish(FILTER_SOURCE_ADDRESS, event);
        }
    }
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:16,代码来源:UbidotsTest.java

示例5: testHttpWriter

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
@Test
public void testHttpWriter() throws Exception {

    // We test collectd support on OS X and Linux
    if (HostOs.isMac() || HostOs.isLinux()) {

        // Start collectd
        new CollectdThread("collectd-thread", "collectd.conf").start();

        // Collectd listener configuration
        JsonObject config = createBaseConfig();
        config.mergeIn(loadCollectdConfig(config));

        vertx.eventBus().registerLocalHandler(FILTER_DEST_ADDRESS, this);

        // Start collectd listener
        container.deployWorkerVerticle(Collectd.class.getName(), config, 1, false,
                new AsyncResultHandler<String>() {
                    @Override
                    public void handle(final AsyncResult<String> ar) {
                        if (ar.failed()) {
                            m_logger.error("Failed to deploy verticle", ar.cause());
                            Assert.fail();
                        }
                    }
                });
    } else {
        // Stop test
        VertxAssert.testComplete();
    }
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:32,代码来源:CollectdTest.java

示例6: handle

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
@Override
public void handle(final Message<JsonObject> message) {
    m_logger.info("Received event: {}", message.body().toString());

    if (++m_counter > 10) {
        
        // Stop collectd
        m_cmd.destroy(true);

        // Stop test
        VertxAssert.testComplete();
    }
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:14,代码来源:CollectdTest.java

示例7: handle

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
@Override
public void handle(final Message<JsonObject> message) {
    m_logger.info("Received event: {}", message.body().encodePrettily());
    m_logger.info("======================================== {} =========================================", m_counter);

    if (++m_counter > 26) {

        // Stop test
        VertxAssert.testComplete();
    }
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:12,代码来源:NagiosNrdpTest.java

示例8: testGenerateMessages

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
@Test
public void testGenerateMessages() throws Exception {

    // This test requires on OS X: brew install openssl
    // NSQ supports OS X and Linux
    if (HostOs.isMac() || HostOs.isLinux()) {
        ClassLoader cl = ClassLoader.getSystemClassLoader();
        URL[] urls = ((URLClassLoader) cl).getURLs();
        m_logger.debug("CLASSPATH:");
        for (URL url : urls) {
            m_logger.debug(url.getFile());
        }

        JsonObject config = createBaseConfig();
        config.mergeIn(loadNsqConfig(config));

        new NsqThread().start();

        container.deployWorkerVerticle(Nsq.class.getName(), config, 1, false,
                new AsyncResultHandler<String>() {
                    @Override
                    public void handle(final AsyncResult<String> ar) {
                        if (ar.failed()) {
                            m_logger.error("Failed to deploy verticle", ar.cause());
                            Assert.fail();
                        }
                    }
                });

        m_timer = vertx.setPeriodic(150L, this); // Generate events once every 150 ms
    } else {
        // Stop test immediately
        VertxAssert.testComplete();
    }
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:36,代码来源:NsqOutTest.java

示例9: testSharedSensorData

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
@Test
public void testSharedSensorData() {

    ConcurrentSharedMap<String, Object> sensorData
            = vertx.sharedData().getMap(SHARED_SENSORS_KEY);
    JsonObject config = container.config();
    Variables vars = new Variables(config, vertx);
    sensorData.put("test.id", 10L);
    Assert.assertEquals(Long.valueOf(10L), vars.translate("%{#sensor.test.id}"));
    // Stop test
    VertxAssert.testComplete();
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:13,代码来源:VariablesTest.java

示例10: handle

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
@Override
public void handle(final Message<JsonObject> message) {
    
    m_logger.info("Received message: {}", message.body().toString());

    // Stop test
    VertxAssert.testComplete();
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:9,代码来源:JolokiaTest.java

示例11: testGenerateMessages

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
@Test
public void testGenerateMessages() throws Exception {

    // NSQ supports OS X and Linux
    if (HostOs.isMac() || HostOs.isLinux()) {
        ClassLoader cl = ClassLoader.getSystemClassLoader();
        URL[] urls = ((URLClassLoader) cl).getURLs();
        m_logger.debug("CLASSPATH:");
        for (URL url : urls) {
            m_logger.debug(url.getFile());
        }

        JsonObject config = createBaseConfig();
        config.mergeIn(loadNsqConfig(config));

        new NsqThread().start();

        container.deployWorkerVerticle(NsqHttp.class.getName(), config, 1, false,
                new AsyncResultHandler<String>() {
                    @Override
                    public void handle(final AsyncResult<String> ar) {
                        if (ar.failed()) {
                            m_logger.error("Failed to deploy verticle", ar.cause());
                            Assert.fail();
                        }
                    }
                });

        m_timer = vertx.setPeriodic(150L, this); // Generate events once every 150 ms
    } else {
        // Stop test immediately
        VertxAssert.testComplete();
    }
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:35,代码来源:NsqHttpOutTest.java

示例12: handle

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
@Override
public void handle(final Message<JsonObject> message) {
    m_logger.info("Received message: {}", message.body().toString());

    // Stop test
    VertxAssert.testComplete();
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:8,代码来源:SqlInTest.java

示例13: testHttpWriter

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
@Test
public void testHttpWriter() throws Exception {

    // We test collectd support on OS X and Linux
    if (HostOs.isMac() || HostOs.isLinux()) {

        // Start collectd
        new CollectdThread("collectd-thread", "collectd-http.conf").start();

        // Http server configuration
        JsonObject config = createBaseConfig();
        config.putArray("add-tags", new JsonArray(new String[]{"collectd"}));
        config.putString("input-format", "collectd-json");

        vertx.eventBus().registerLocalHandler(FILTER_DEST_ADDRESS, this);

        // Start http server
        container.deployWorkerVerticle(HttpServer.class.getName(), config, 1, false,
                new AsyncResultHandler<String>() {
                    @Override
                    public void handle(final AsyncResult<String> ar) {
                        if (ar.failed()) {
                            m_logger.error("Failed to deploy verticle", ar.cause());
                            Assert.fail();
                        }
                    }
                });
    } else {
        // Stop test
        VertxAssert.testComplete();
    }
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:33,代码来源:CollectdHttpTest.java

示例14: handle

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
@Override
public void handle(final Message<JsonObject> message) {
    m_logger.info("Received event: {}", message.body().toString());

    if (++m_counter > 10) {

        // Stop collectd
        m_cmd.destroy(true);

        // Stop test
        VertxAssert.testComplete();
    }
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:14,代码来源:CollectdHttpTest.java

示例15: start

import org.vertx.testtools.VertxAssert; //导入方法依赖的package包/类
public void start() {
  VertxAssert.initialize(vertx);

  // You can also assert from other verticles!!
  VertxAssert.assertEquals("foo", "foo");

  // And complete tests from other verticles
  VertxAssert.testComplete();
}
 
开发者ID:jlarriba,项目名称:jdashboard,代码行数:10,代码来源:SomeVerticle.java


注:本文中的org.vertx.testtools.VertxAssert.testComplete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。