/** * Chaining engines with a replacement test for {@link * NodeEngine#chain(com.github.wuic.engine.NodeEngine...)}. */ @Test public void chainReplaceWithLast() { final NodeEngine engine1 = new SpriteInspectorEngine(false, new SpriteProvider[] {}); final NodeEngine engine2 = new ImageAggregatorEngine(false, new BinPacker<ConvertibleNut>()); final NodeEngine engine3 = new ImageCompressorEngine(false); final NodeEngine engine4 = new ImageAggregatorEngine(false, new BinPacker<ConvertibleNut>()); final NodeEngine chain = NodeEngine.chain(engine1, engine2, engine3); assertChainTest(NodeEngine.chain(chain, engine4), engine1, engine4, engine3); }
/** Union test for {@link NodeEngine#chain(com.github.wuic.engine.NodeEngine...)}. */ @Test public void chainUnionTest() { final NodeEngine engine1 = new SpriteInspectorEngine(false, new SpriteProvider[] {}); final NodeEngine engine2 = new ImageAggregatorEngine(false, new BinPacker<ConvertibleNut>()); final NodeEngine engine3 = new ImageCompressorEngine(false); assertChainTest( NodeEngine.chain(NodeEngine.chain(engine1, engine2), NodeEngine.chain(engine2, engine3)), engine1, engine2, engine3); }