VelocityPipeline implements Pipeline { public Writer pipeline(String pipeTemplates[],Map model,Writer writer) throws PipeException { VelocityContext context = new VelocityContext(model); return _pipeline(pipeTemplates,context,writer); } VelocityPipeline();  VelocityPipeline(VelocityEngine engine); VelocityEngine getVelocityEngine(); void setVelocityEngine(VelocityEngine engine); int getBufferSize(); void setBufferSize(int bufferSize); Writer pipeline(String pipeTemplates[],Map model,Writer writer); void handleException(Exception e, String templateName,boolean isLastTemplate); Writer pipeline(String[] pipeTemplates, Object model, Writer writer); Writer pipeline(String pipeTemplates,Map model,Writer writer); Writer pipeline(String pipeTemplates, Object model, Writer writer);  }
@Test public void testVelocity() throws Exception { StringWriter sw = new StringWriter(); pipeline.pipeline("first.vm|second.vm | three.vm", new HashMap(), sw); System.out.println(sw.toString()); String expected = "<html><head>second_override_content</head><body>first_override_content<three><second>first</second></three></body></html>"; Assert.assertEquals(expected,sw.toString().replaceAll("\\s+", "")); }
@Test(expected=UnsupportedOperationException.class) public void testException1() { pipeline.pipeline("first.vm|second.vm | three.vm", new Object(), new StringWriter()); }
@Test(expected=UnsupportedOperationException.class) public void testException2() { pipeline.pipeline(new String[]{}, new Object(), new StringWriter()); }