net.sf.pipet.test
Class PipelineSimulator

java.lang.Object
  extended by net.sf.pipet.test.PipelineSimulator

public class PipelineSimulator
extends Object

This class helps testing PipeT modules. To use this class, define a test case. A test case consists of the following:

The test case is successful if: A test case is declared in a file. An example test case is the following:
 [general]
 configuration = pipelines.cfg
 pipeline = xslt
 status = true
 
 [attributes]
 att1 = some value
 att2 = another value
 
 [input/xsl]
 file = xslt.xsl
 
 [input/input]
 string = <?xml version="1.0"?><xml><input/></xml>
 
 [output/output]
 string = <?xml version="1.0" encoding="UTF-8"?><document><element/></document>
 
Use the run() method to perform the test. If the test fails, it throws an exception. A PipelineSimulator instance can be created from a test case declaration using parseURL(). The following code examplifies the use of this class:
 URL url = ClassLoader.getSystemResource("case.test");
 if (url == null)
   throw new Exception("Test file not found: "+file);
 PipelineSimulator sim = PipelineSimulator.parseURL(url);
 sim.run();
 


Field Summary
static boolean DETECT_OPEN_FILE_LEAKS
           
 
Constructor Summary
PipelineSimulator(Configuration cfg, String pipeline_name, boolean status, Map<String,byte[]> input, Map<String,byte[]> output)
           
PipelineSimulator(Configuration cfg, String pipeline_name, boolean status, Map<String,byte[]> input, Map<String,byte[]> output, ModuleAttributes atts)
           
 
Method Summary
 boolean equals(Object object)
           
 Map<String,byte[]> getInputPipes()
           
 ModuleAttributes getModuleAttributes()
           
 Map<String,byte[]> getOutputPipes()
           
 Configuration getPipelineConfiguration()
           
 String getPipelineName()
           
 boolean getStatus()
           
 int hashCode()
           
static PipelineSimulator parseURL(URL url)
           
 void run()
           
 void run(net.sf.qxs.messenger.Messenger messenger)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DETECT_OPEN_FILE_LEAKS

public static boolean DETECT_OPEN_FILE_LEAKS
Constructor Detail

PipelineSimulator

public PipelineSimulator(Configuration cfg,
                         String pipeline_name,
                         boolean status,
                         Map<String,byte[]> input,
                         Map<String,byte[]> output,
                         ModuleAttributes atts)

PipelineSimulator

public PipelineSimulator(Configuration cfg,
                         String pipeline_name,
                         boolean status,
                         Map<String,byte[]> input,
                         Map<String,byte[]> output)
Method Detail

getPipelineConfiguration

public Configuration getPipelineConfiguration()

getPipelineName

public String getPipelineName()

getStatus

public boolean getStatus()

getModuleAttributes

public ModuleAttributes getModuleAttributes()

getInputPipes

public Map<String,byte[]> getInputPipes()

getOutputPipes

public Map<String,byte[]> getOutputPipes()

run

public void run()
         throws Exception
Throws:
Exception

run

public void run(net.sf.qxs.messenger.Messenger messenger)
         throws Exception
Throws:
Exception

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object

parseURL

public static PipelineSimulator parseURL(URL url)
                                  throws Exception
Throws:
Exception


Copyright © 2011 VU University Amsterdam. All Rights Reserved.