1 16 package scriptella.driver.xpath; 17 18 import scriptella.AbstractTestCase; 19 import scriptella.execution.EtlExecutor; 20 import scriptella.execution.EtlExecutorException; 21 22 import java.io.ByteArrayOutputStream ; 23 import java.io.IOException ; 24 import java.io.InputStream ; 25 import java.io.OutputStream ; 26 import java.io.UnsupportedEncodingException ; 27 import java.net.URL ; 28 29 32 public class XPathDriverITest extends AbstractTestCase { 33 private ByteArrayOutputStream o; 34 35 protected void setUp() throws Exception { 36 37 o = new ByteArrayOutputStream (); 38 testURLHandler = new TestURLHandler() { 39 40 public InputStream getInputStream(final URL u) throws IOException { 41 throw new UnsupportedOperationException (); 42 } 43 44 public OutputStream getOutputStream(final URL u) { 45 return o; 46 } 47 48 public int getContentLength(final URL u) { 49 return -1; 50 } 51 }; 52 } 53 54 55 public void test() throws EtlExecutorException, UnsupportedEncodingException { 56 EtlExecutor e = newEtlExecutor(); 57 e.execute(); 58 assertNotNull(o); 59 assertEquals("1;2\n3;4\n5;6\n", new String (o.toByteArray())); 60 } 61 62 } 63 | Popular Tags |