public class MultiLogResults
extends java.lang.Object
JVM Arguments:
Same as JVM Option: -Dsafs.multilog.summary="<path/to/xml/summary.xml>"
Ex: -Dsafs.multilog.summary="EMinerSummary.xml"
Ex: -Dsafs.multilog.summary="C:\\SAFS\\Project\\Reports\\EMinerSummary.xml"
This class requires a "registered" JAXP XSLT Processor to be in the runtime CLASSPATH.
A registered JAXP XSLT Processor generally contains TransformerFactory services information in the
META-INF\services directory of its JAR file library. This class was tested using the SAXON 9.4
JAR files be in the runtime CLASSPATH:
Other XSLT Processors conforming to the JAXP standards and XSLT 2.0 specification should also work.
The processor must support XSLT 2.0 or higher. Specifically, that result tree fragments can be internally converted to and be treated as valid node-sets. MSXML, the MSXSL.EXE program, and older (sometimes default) versions of XALAN do not support such tree fragment conversions when they strictly adhere to XSLT 1.0 specifications.
Modifier and Type | Field and Description |
---|---|
protected boolean |
absoluteList |
protected boolean |
absoluteLog |
protected boolean |
absoluteLogs |
protected boolean |
absoluteOut |
protected boolean |
absoluteSummary |
protected boolean |
absoluteXSL |
static java.lang.String |
ARG_DIR
"-dir"
|
static java.lang.String |
ARG_LIST
"-list"
|
static java.lang.String |
ARG_LOG
"-log"
|
static java.lang.String |
ARG_NOSUMMARY
"-nosummary"
|
static java.lang.String |
ARG_OUT
"-out"
|
static java.lang.String |
ARG_SUMMARY
"-summary"
|
static java.lang.String |
ARG_XSL
"-xsl"
|
static java.lang.String |
DEFAULT_LIST_FILENAME
"MultiLogResultsList.xml"
|
static java.lang.String |
DEFAULT_SUMMARY_FILENAME
"MultiLogResultsSummary.xml"
|
static java.lang.String |
DEFAULT_XSL_FILENAME
"XSLMultiLogsListSummary.xsl"
|
protected java.io.File |
DIR_LOGS |
protected java.io.File |
DIR_OUT |
boolean |
DO_SUMMARY
Create an XML summary file from one or more SAFS XML log files.
|
protected java.io.File |
FILE_LIST |
protected java.io.File |
FILE_LOG |
protected java.io.File |
FILE_SUMMARY |
protected java.io.File |
FILE_XSL |
protected boolean |
isListInput |
protected boolean |
isValidated |
static java.lang.String |
PROP_KEY_SAFS_MULTILOG_DIR
"safs.multilog.dir"
|
static java.lang.String |
PROP_KEY_SAFS_MULTILOG_LIST
"safs.multilog.list"
|
static java.lang.String |
PROP_KEY_SAFS_MULTILOG_LOG
"safs.multilog.log"
|
static java.lang.String |
PROP_KEY_SAFS_MULTILOG_NOSUMMARY
"safs.multilog.nosummary"
|
static java.lang.String |
PROP_KEY_SAFS_MULTILOG_OUT
"safs.multilog.out"
|
static java.lang.String |
PROP_KEY_SAFS_MULTILOG_SUMMARY
"safs.multilog.summary"
|
static java.lang.String |
PROP_KEY_SAFS_MULTILOG_XSL
"safs.multilog.xsl"
|
protected static java.lang.String |
UTF8_CHARSET
"UTF-8"
|
protected static java.lang.String |
XML_SUFFIX_LC
".xml"
|
protected static java.lang.String |
XSL_SUFFIX_LC
".xsl"
|
Constructor and Description |
---|
MultiLogResults() |
Modifier and Type | Method and Description |
---|---|
protected static org.w3c.dom.Document |
buildDoc(java.lang.String document)
Used internally.
|
java.io.File |
createSingleXMLLogList(java.lang.String inputLogDir,
java.lang.String inputLogFile)
Create an XML List File listing a single SAFS XML log file.
|
java.io.File |
createXMLLogsList(java.lang.String inputLogsDir)
Create an XML List File listing all SAFS XML log files in the inputLogsDir.
|
java.io.File |
createXMLLogsSummary(java.lang.String inputXMLFile,
java.lang.String inputXSLFile,
java.lang.String outputXMLFile)
Create an XML Summary File from the transformation of an XML List file and XSL transformation file.
|
org.w3c.dom.Node |
createXMLLogsSummaryNodes(java.lang.String inputXMLFile,
java.lang.String inputXSLFile)
Create an JAXP XML Document Node from the transformation of an XML List file and XSL transformation file.
|
void |
execute()
Perform the end-to-end execution of creating an XML List File and XML Summary File
from the current configuration of the instance.
|
protected static java.lang.String |
getSystemProperty(java.lang.String pname)
convenience routine to retrieve a System property value or null--
catching any thrown "not found" exceptions.
|
java.io.File |
getXMLListFile()
Normally only called AFTER a successful execution.
|
java.io.File |
getXMLSummaryFile()
Normally only called AFTER a successful execution.
|
java.io.File |
getXSLFile() |
boolean |
hasListInput() |
boolean |
hasLogInput() |
boolean |
hasValidated() |
boolean |
hasXMLListFile()
Normally only called AFTER a successful execution.
|
boolean |
hasXMLSummaryFile()
Normally only called AFTER a successful execution.
|
boolean |
hasXSLFile() |
boolean |
hasXSLInput() |
static void |
log(java.lang.String message)
Currently logs to System.out.
|
static void |
main(java.lang.String[] args)
primarily a testing/debug command-line entry point.
|
void |
processArgs(java.lang.String[] args)
String[] args will override any processJVMOptions previously set--
assuming JVM Options are processed BEFORE these args.
|
void |
processJVMOptions()
(Re)Set any arguments passed in as JVM -D Options.
|
void |
resetValidation()
clears ALL flags associated with validated settings including the isValidated flag.
|
boolean |
validate()
Call this routine to validate the current instance configuration settings.
|
public boolean DO_SUMMARY
public static final java.lang.String DEFAULT_LIST_FILENAME
public static final java.lang.String DEFAULT_SUMMARY_FILENAME
public static final java.lang.String DEFAULT_XSL_FILENAME
public static final java.lang.String PROP_KEY_SAFS_MULTILOG_DIR
public static final java.lang.String PROP_KEY_SAFS_MULTILOG_OUT
public static final java.lang.String PROP_KEY_SAFS_MULTILOG_XSL
public static final java.lang.String PROP_KEY_SAFS_MULTILOG_LIST
public static final java.lang.String PROP_KEY_SAFS_MULTILOG_LOG
public static final java.lang.String PROP_KEY_SAFS_MULTILOG_NOSUMMARY
public static final java.lang.String PROP_KEY_SAFS_MULTILOG_SUMMARY
public static final java.lang.String ARG_DIR
public static final java.lang.String ARG_OUT
public static final java.lang.String ARG_LOG
public static final java.lang.String ARG_XSL
public static final java.lang.String ARG_LIST
public static final java.lang.String ARG_NOSUMMARY
public static final java.lang.String ARG_SUMMARY
protected boolean absoluteLogs
protected boolean absoluteList
protected boolean absoluteLog
protected boolean absoluteXSL
protected boolean absoluteSummary
protected boolean absoluteOut
protected boolean isValidated
protected boolean isListInput
protected java.io.File DIR_LOGS
protected java.io.File DIR_OUT
protected java.io.File FILE_LIST
protected java.io.File FILE_LOG
protected java.io.File FILE_XSL
protected java.io.File FILE_SUMMARY
protected static final java.lang.String XML_SUFFIX_LC
protected static final java.lang.String XSL_SUFFIX_LC
protected static final java.lang.String UTF8_CHARSET
public static void log(java.lang.String message)
public boolean hasListInput()
public boolean hasXSLInput()
public boolean hasValidated()
public boolean hasLogInput()
public void resetValidation()
protected static java.lang.String getSystemProperty(java.lang.String pname)
public void processJVMOptions()
public void processArgs(java.lang.String[] args)
args
- -- the String[] command-line args received or otherwise provided.public boolean validate() throws java.lang.IllegalArgumentException
LOGS (-dir) must be specified unless an absolute LOG _OR_ an absolute LIST is specified. It is an error to specify both a LOG and a LIST. LOGS (-dir) will be assigned the LOG parent directory when an absolute LOG is specified. LOGS (-dir) will be assigned the LIST parent directory when an absolute LIST is specified and LOGS is not specified. OUT is optional always. OUT will be assigned the LOGS directory if OUT is not specified. OUT will be assigned the SUMMARY parent directory when an absolute SUMMARY is specified and OUT is not specified. SUMMARY is optional always. SUMMARY will be assigned the default name if not specified. LIST is optional always. LIST will be assigned the default name if not specified and we are NOT processing a single LOG.
java.lang.IllegalArgumentException
- if a problem is found with the current configuration.public java.io.File createXMLLogsList(java.lang.String inputLogsDir) throws java.lang.IllegalArgumentException
inputLogsDir
- -- fullpath directory to process for SAFS XML log files. If this is null then
we will use whatever arguments have previously been provided. If non-null, a call to re-validate
all arguments will occur.outputListFile
- -- fullpath XML list file to create. If this is null then we will
use whatever arguments have previously been provided. If non-null, a call to re-validate all
arguments will occur.java.lang.IllegalArgumentException
- if inputLogsDir is invalid, does not exist, or if the outputListFile
cannot be created.public java.io.File createSingleXMLLogList(java.lang.String inputLogDir, java.lang.String inputLogFile) throws java.lang.IllegalArgumentException
inputLogDir
- -- full path to directory containing XML log file. If this is null then
we will use whatever arguments have previously been provided. If non-null, a call to re-validate
all arguments will occur.inputLogFile
- -- full or relative path to single SAFS XML log file. If this is null then
we will use whatever arguments have previously been provided. If non-null, a call to re-validate
all arguments will occur.outputListFile
- -- full path to the XML list file to create. If this is null then we will
use whatever arguments have previously been provided. If non-null, a call to re-validate all
arguments will occur.java.lang.IllegalArgumentException
- if inputLogFile is invalid, does not exist, or if the outputListFile
cannot be created.public java.io.File createXMLLogsSummary(java.lang.String inputXMLFile, java.lang.String inputXSLFile, java.lang.String outputXMLFile) throws java.lang.IllegalArgumentException, java.lang.Exception
inputXMLFile
- -- fullpath to valid XML List File to be used in transformation.inputXSLFile
- -- fullpath to valid XSL File to be used in transformation.outputXMLFile
- -- fullpath to the desired output XML File to be created or overwritten.
The directory for this file must already exist.java.lang.IllegalArgumentException
- if any of the input parameters are invalid or otherwise not usable.java.lang.Exception
- --various exceptions that might be thrown from the JAXP XML transformation classes.public org.w3c.dom.Node createXMLLogsSummaryNodes(java.lang.String inputXMLFile, java.lang.String inputXSLFile) throws java.lang.Exception
inputXMLFile
- -- fullpath to valid XML List File to be used in transformation.inputXSLFile
- -- fullpath to valid XSL File to be used in transformation.java.lang.IllegalArgumentException
- if any of the input parameters are invalid or otherwise not usable.java.lang.Exception
- -- various exceptions that might be thrown from the JAXP XML transformation classes.protected static org.w3c.dom.Document buildDoc(java.lang.String document) throws java.lang.Exception
document
- -- fullpath to valid (XSL) file to be used in transformation.java.lang.Exception
- -- various exceptions that might be thrown from the JAXP XML transformation classes.public boolean hasXMLListFile()
public java.io.File getXMLListFile() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the current configuration is not "validated" or the
requested file does not exist.public boolean hasXSLFile()
public java.io.File getXSLFile() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the current configuration is not "validated" or the
requested file does not exist.public boolean hasXMLSummaryFile()
public java.io.File getXMLSummaryFile() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the current configuration is not "validated" or the
requested file does not exist.public void execute() throws java.lang.IllegalArgumentException
The routine will first validate() the current configuration, then create the XML List File as necessary from a single XML log file, or all XML log files as required by the current configuration. This portion of the process is bypassed if the current configuration specifies to use a pre-existing XML List File.
With the XML List File ready, the routine will then create an XML Summary File consolidating all test results specified in the XML List File. This portion of the process is bypassed if the current configuration has the -nosummary setting set true.
java.lang.IllegalArgumentException
- as may be thrown during configuration validation.java.lang.Exception
- as may be thrown by the JAXP XML transformation process.public static void main(java.lang.String[] args)
MultiLogResults process = new MultiLogResults(); process.processJVMOptions(); process.processArgs(args); process.execute();
args
- -- command-line args.Copyright © SAS Institute. All Rights Reserved.