测试代码

Posted 唐僧吃肉

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了测试代码相关的知识,希望对你有一定的参考价值。

private List<Integer> boltEmit(String out_stream_id,
            Collection<Tuple> anchors, List<Object> values, Integer out_task_id) {
        timer.start();
        List<Integer> out_tasks = null;
        try {
            if (out_task_id != null) {
                out_tasks = sendTargets.get(out_task_id, out_stream_id, values);
            } else {
                out_tasks = sendTargets.get(out_stream_id, values);
            }

            for (Integer t : out_tasks) {
                Map<Long, Long> anchors_to_ids = new HashMap<Long, Long>();
                if (anchors != null) {
                    for (Tuple a : anchors) {
                        //Long edge_id = MessageId.generateId();
                        Long edge_id = MessageId.generateId(random);
                        long now = System.currentTimeMillis();
                        if (now - lastRotate > rotateTime) {
                            pending_acks.rotate();
                            lastRotate = now;
                        }
                        put_xor(pending_acks, a, edge_id);
                        for (Long root_id : a.getMessageId().getAnchorsToIds()
                                .keySet()) {
                            put_xor(anchors_to_ids, root_id, edge_id);
                        }
                    }
                }


            }
            return out_tasks;
        } catch (Exception e) {
            LOG.error("bolt emit", e);
        }finally {
            timer.stop();
        }
        return new ArrayList<Integer>();
    }

以上是关于测试代码的主要内容,如果未能解决你的问题,请参考以下文章

typescript Angular 2测试片段。代码库https://developers.livechatinc.com/blog/category/programming/angular-2/

typescript Angular最终版本的Angular 2测试片段。代码库https://developers.livechatinc.com/blog/category/programming

typescript Angular最终版本的Angular 2测试片段。代码库https://developers.livechatinc.com/blog/category/programming

typescript Angular最终版本的Angular 2测试片段。代码库https://developers.livechatinc.com/blog/category/programming

Jacoco和Tycho surefire的Eclipse RCP插件代码介绍

argparse 代码片段只打印部分日志