CompositeOperatorEstimatorTest.java 文件源码

java
阅读 33 收藏 0 点赞 0 评论 0

项目:asakusafw-compiler 作者:
/**
 * user operators.
 */
@Test
public void user() {
    OperatorEstimator estimator = CompositeOperatorEstimator.builder()
            .withUser(Deprecated.class, engine("a"))
            .withUser(Documented.class, engine("b"))
            .build();

    Operator o0 = user(classOf(Deprecated.class));
    Operator o1 = user(classOf(Documented.class));
    Operator o2 = user(clazz("Unknown"));

    OperatorEstimate e0 = perform(context(), estimator, o0);
    OperatorEstimate e1 = perform(context(), estimator, o1);
    OperatorEstimate e2 = perform(context(), estimator, o2);

    assertThat(e0, hasMark("a"));
    assertThat(e1, hasMark("b"));
    assertThat(e2, hasMark(null));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号