|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ipdr.test.IPDRWriteTool
public class IPDRWriteTool
This class is used for generation of IPDRDoc in XDR/XML format. It takes input parameter as comma delimited test data file having its first line as SchemaURI. More than one input files can be passed as input command line arguments. Optional command line arguments are load and roundrobin. Load parameter is used for specifying number of CompositeData records to be written in IPDRDoc. Roundrobin parameter is used for writing of CompositeData records in a roundrobin fashion.
Field Summary | |
---|---|
protected int |
docTypeCount_
To check that doctype parameter is not given twice. |
protected java.io.FileOutputStream |
fOut_
Object of FileOutputStream class. |
static java.lang.String |
ipdrVersion_
String to store the IPDR Version. |
protected int |
loadCount_
To check that load parameter is not given twice. |
protected boolean |
loadFlag_
Flag indicating presence of load option as input. |
protected int |
loadParam_
To store value of load. |
protected int |
loopIteration_
LoopIteration is incremented when any parameter is succesful. |
protected java.io.File |
outFile_
Object of File class. |
protected int |
outFileCount_
To check that outfile parameter is not given twice. |
protected boolean |
outFileFlag_
Flag indicating presence of outfile parameter. |
protected java.util.ArrayList |
passedArguments_
To store all the input command line parameters for validation. |
protected int |
roundRobinCount_
To check that roundrobin parameter is not given twice. |
protected boolean |
roundRobinFlag_
Flag indicating presence of roundrobin option passed as input. |
protected static boolean |
settlementDoc_
Flag indicating document is Settlement Doc. |
protected java.util.ArrayList |
testDataFiles_
To store all files location which are to be used for test data. |
protected int |
testFileCount_
To store total test data files in an array. |
protected int |
totalArguments_
Length of the input string. |
static boolean |
validateSchema_
Flag indicating validation of Schema. |
protected boolean |
xdrFlag_
Flag indicating document type as XDR. |
protected boolean |
xmlFlag_
Flag indicating document type as XML. |
Constructor Summary | |
---|---|
IPDRWriteTool()
|
Method Summary | |
---|---|
protected CompositeData |
generateCompositeData(java.util.ArrayList lineArray,
int testNdx,
OpenType[] openType,
java.lang.String serviceType)
This method is used to generate a CompositeData object when OpenType array and the test data line is passed corresponding to a CompositeData. |
CompositeData[] |
generateCompositeDataArray(java.io.File dataFile)
This method is used to generate array of CompositeData objects when a CSV File (having its first line as SchemaURI) is passed as an input to it. |
protected java.lang.Object |
generateObject(java.lang.String str,
OpenType type)
This method is used to convert object of Object class to different data objects. |
protected java.lang.String |
getHeaderInfo(java.io.BufferedReader br)
This method is used to obtain the header information. |
protected java.util.ArrayList |
inputFileProcessing()
This method is used for code reuse in simpleProcessing and loadProcessing methods. |
protected void |
loadAndRoundRobinProcessing(IPDRDocWriter w)
This method is used for when load parameter and roundrobin is specified in the input arguments of test tool. |
protected void |
loadProcessing(IPDRDocWriter w)
This method is used for when load parameter is specified but roundrobin is not present in the input arguments of test tool. |
static void |
main(java.lang.String[] args)
Entry point to the write tool. |
protected void |
parameterHandling(java.lang.String[] arguments)
This method is used for validation of command line arguments provided in the test tool. |
protected java.util.ArrayList |
readNameSpaces(java.io.BufferedReader br)
This method is used to obtain the NameSpaceInfo information. |
protected java.util.ArrayList |
readServDefs(java.io.BufferedReader br)
This method is used to obtain the ServiceDefinitionURI information. |
protected void |
roundRobinProcessing(IPDRDocWriter w)
This method is used for when load parameter is not specified but roundrobin is specified in the input arguments of test tool. |
protected void |
simpleProcessing(IPDRDocWriter w)
This method is used for when load and roundrobin is not present in the input arguments of test tool. |
void |
testFTP(int docType,
java.lang.String[] testDataFiles,
java.lang.String outFile)
This method is used for testing purposes from File based transfer protocol APIs. |
protected void |
testToolUsage()
This method is used for showing test tool usage. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean validateSchema_
public static java.lang.String ipdrVersion_
protected boolean xdrFlag_
protected boolean xmlFlag_
protected static boolean settlementDoc_
protected boolean outFileFlag_
protected boolean loadFlag_
protected boolean roundRobinFlag_
protected int totalArguments_
protected int loopIteration_
protected int loadCount_
protected int roundRobinCount_
protected int testFileCount_
protected int loadParam_
protected int outFileCount_
protected int docTypeCount_
protected java.io.File outFile_
protected java.io.FileOutputStream fOut_
protected java.util.ArrayList testDataFiles_
protected java.util.ArrayList passedArguments_
Constructor Detail |
---|
public IPDRWriteTool()
Method Detail |
---|
public CompositeData[] generateCompositeDataArray(java.io.File dataFile) throws IPDRException, BadCompositeException, org.xml.sax.SAXException
dataFile
- Input CSV file object
IPDRException
- when a IPDR functionality related exception occurs
org.xml.sax.SAXException
- when an exception occurs during parsing
BadCompositeException
- when an exception occurs during the
creation of the Composite Type objectprotected CompositeData generateCompositeData(java.util.ArrayList lineArray, int testNdx, OpenType[] openType, java.lang.String serviceType) throws IPDRException, BadCompositeException
lineArray
- Array of lines from the data filetestNdx
- Index of line to processopenType
- Array of OpenTypeserviceType
- The Service Type
IPDRException
BadCompositeException
protected java.lang.Object generateObject(java.lang.String str, OpenType type) throws BadCompositeException, IPDRException
str
- String containing object valuetype
- Type of the object
BadCompositeException
IPDRException
protected void testToolUsage()
protected java.util.ArrayList inputFileProcessing() throws IPDRException, org.xml.sax.SAXException, BadCompositeException
IPDRException
org.xml.sax.SAXException
BadCompositeException
protected void simpleProcessing(IPDRDocWriter w) throws IPDRException, org.xml.sax.SAXException, BadCompositeException
w
- Object of IPDRDocWriter
IPDRException
org.xml.sax.SAXException
BadCompositeException
protected void loadProcessing(IPDRDocWriter w) throws org.xml.sax.SAXException, IPDRException, BadCompositeException
w
- Object of IPDRDocWriter
org.xml.sax.SAXException
IPDRException
BadCompositeException
protected void roundRobinProcessing(IPDRDocWriter w) throws BadCompositeException, java.io.IOException, IPDRException, org.xml.sax.SAXException
w
- Object of IPDRDocWriter
BadCompositeException
java.io.IOException
IPDRException
org.xml.sax.SAXException
protected void loadAndRoundRobinProcessing(IPDRDocWriter w) throws BadCompositeException, java.io.IOException, IPDRException, org.xml.sax.SAXException
w
- Object of IPDRDocWriter.
BadCompositeException
java.io.IOException
IPDRException
org.xml.sax.SAXException
protected void parameterHandling(java.lang.String[] arguments)
arguments
- Command line arguments.protected java.lang.String getHeaderInfo(java.io.BufferedReader br) throws java.io.IOException
br
- BufferedReader object for Input test data file.
java.io.IOException
protected java.util.ArrayList readNameSpaces(java.io.BufferedReader br) throws java.io.IOException
br
- BufferedReader object for Input test data file.
java.io.IOException
protected java.util.ArrayList readServDefs(java.io.BufferedReader br) throws java.io.IOException
br
- BufferedReader object for Input test data file.
java.io.IOException
public static void main(java.lang.String[] args) throws org.xml.sax.SAXException, java.io.IOException, BadCompositeException
org.xml.sax.SAXException
java.io.IOException
BadCompositeException
public void testFTP(int docType, java.lang.String[] testDataFiles, java.lang.String outFile) throws IPDRException, org.xml.sax.SAXException, java.io.IOException, BadCompositeException
docType
- Document TypetestDataFiles
- Array of input CSV file namesoutFile
- Output file name
IPDRException
org.xml.sax.SAXException
java.io.IOException
BadCompositeException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |