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


Java ListIterable.detect方法代码示例

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


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

示例1: testBaselineException

import org.eclipse.collections.api.list.ListIterable; //导入方法依赖的package包/类
@Test
public void testBaselineException() {
    // In this use case, srcB is the baseline change w/ ch1 ch2 ch3 marked. However, we only see ch1 and ch2 deployed, so we throw an exception

    Change dep1 = new ChangeIncremental(tableChangeType(), "schema", "tabB", "ch1", 0, "chng1", CONTENT);
    Change dep2 = new ChangeIncremental(tableChangeType(), "schema", "tabB", "ch2", 0, "chng1", CONTENT);
    // hiding dep3 as to show the exception use case
    //Change dep3 = new ChangeIncremental(tableChangeType(), "schema", "tabB", "ch3", 0, "chng1", CONTENT);
    Change srcB = new ChangeIncremental(tableChangeType(), "schema", "tabB", "bas1", 0, "chng1", CONTENT)
            .withBaselines(Lists.mutable.with("ch1", "ch2", "ch3"));
    Change src4 = new ChangeIncremental(tableChangeType(), "schema", "tabB", "ch4", 1, "chng1", CONTENT);

    ListIterable<ChangeCommand> changeset = cmdCalc.calculateCommands(tableChangeType(), Lists.mutable.of(
            new ChangePair(srcB, null)
            , new ChangePair(src4, null)
            , new ChangePair(null, dep1)
            , new ChangePair(null, dep2)
    ), unusedChangesArg, false, false);

    assertEquals(2, changeset.size());
    Verify.assertAnySatisfy(changeset, assertValue(DeployChangeCommand.class, src4));
    Predicate<ChangeCommand> baselineWarningPredicate = assertValue(IncompleteBaselineWarning.class, srcB);
    Verify.assertAnySatisfy(changeset, baselineWarningPredicate);
    IncompleteBaselineWarning baselineWarning = (IncompleteBaselineWarning) changeset.detect(baselineWarningPredicate);
    assertEquals(Sets.mutable.with("ch3"), baselineWarning.getNonDeployedChanges());
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:27,代码来源:IncrementalChangeTypeCommandCalculatorTest.java

示例2: testBaseline

import org.eclipse.collections.api.list.ListIterable; //导入方法依赖的package包/类
@Test
public void testBaseline() {
    Change dep1 = new ChangeIncremental(tableChangeType(), "schema", "tabB", "ch1", 0, "chng1", CONTENT);
    Change dep2 = new ChangeIncremental(tableChangeType(), "schema", "tabB", "ch2", 0, "chng1", CONTENT);
    Change dep3 = new ChangeIncremental(tableChangeType(), "schema", "tabB", "ch3", 0, "chng1", CONTENT);
    Change srcB = new ChangeIncremental(tableChangeType(), "schema", "tabB", "bas1", 0, "chng1", CONTENT)
            .withBaselines(Lists.mutable.with("ch1", "ch2", "ch3"));
    Change src4 = new ChangeIncremental(tableChangeType(), "schema", "tabB", "ch4", 1, "chng1", CONTENT);

    ListIterable<ChangeCommand> changeset = cmdCalc.calculateCommands(tableChangeType(), Lists.mutable.of(
            new ChangePair(srcB, null)
            , new ChangePair(src4, null)
            , new ChangePair(null, dep1)
            , new ChangePair(null, dep2)
            , new ChangePair(null, dep3)
    ), unusedChangesArg, false, false);

    assertEquals(2, changeset.size());
    Verify.assertAnySatisfy(changeset, assertValue(DeployChangeCommand.class, src4));

    Predicate<ChangeCommand> baselineCommandPredicate = assertValue(BaselineChangeCommand.class, srcB);
    Verify.assertAnySatisfy(changeset, baselineCommandPredicate);

    BaselineChangeCommand baselineCommand = (BaselineChangeCommand) changeset.detect(baselineCommandPredicate);

    assertEquals(Sets.mutable.with(dep1, dep2, dep3), baselineCommand.getReplacedChanges().toSet());
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:28,代码来源:IncrementalChangeTypeCommandCalculatorTest.java


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