/** * Tests a workflow built on top of a composition. * * @throws Exception if test fails */ @Test public void compositionByWorkflowTest() throws Exception { final ContextBuilder builder = new ContextBuilder(); EngineBuilderFactory.getInstance().newContextBuilderConfigurator().configure(builder); new FileXmlContextBuilderConfigurator(getClass().getResource("/wuic-deep.xml")) .configure(builder); final Context ctx = builder.build(); ctx.process("", "composite"); }
/** * Tests engine when aggregation is disabled. * * @throws Exception if test fails */ @Test public void withAggregation() throws Exception { final List<ConvertibleNut> nuts = ctx.process("", "cssSpriteAggregate", UrlUtils.urlProviderFactory()); Assert.assertEquals(1, nuts.size()); assertOneReference(nuts); }
/** * Test when file is referenced with '../'. * * @throws Exception if test fails */ @Test public void parentRefTest() throws Exception { final ContextBuilder builder = new ContextBuilder(); EngineBuilderFactory.getInstance().newContextBuilderConfigurator().configure(builder); new FileXmlContextBuilderConfigurator(getClass().getResource("/wuic-deep.xml")) .configure(builder); final Context ctx = builder.build(); // ../ refers a file inside base directory hierarchy List<Nut> group = ctx.process("", "css-inner"); Assert.assertEquals(1, group.size()); Assert.assertEquals(3, group.get(0).getReferencedNuts().size()); // ../ refers a file outside base directory hierarchy group = ctx.process("", "css-outer"); Assert.assertEquals(1, group.size()); Assert.assertEquals(2, group.get(0).getReferencedNuts().size()); }