1 16 package scriptella.driver.velocity; 17 18 import scriptella.DBTestCase; 19 import scriptella.execution.EtlExecutor; 20 import scriptella.execution.EtlExecutorException; 21 22 import java.io.ByteArrayOutputStream ; 23 import java.io.InputStream ; 24 import java.io.OutputStream ; 25 import java.net.URL ; 26 27 33 public class VelocityScriptTest extends DBTestCase { 34 38 public void test() throws EtlExecutorException { 39 final ByteArrayOutputStream out = new ByteArrayOutputStream (); 40 testURLHandler = new TestURLHandler() { 41 public InputStream getInputStream(final URL u) { 42 throw new UnsupportedOperationException (); 43 } 44 45 public OutputStream getOutputStream(final URL u) { 46 return out; 47 } 48 49 public int getContentLength(final URL u) { 50 throw new UnsupportedOperationException (); 51 } 52 }; 53 getConnection("velocity"); final EtlExecutor se = newEtlExecutor(); 55 se.execute(); 56 final String s = out.toString(); 57 assertEquals("102030",s); 58 } 59 60 } 61 | Popular Tags |