Commit b713bef8 authored by Aaron Bray's avatar Aaron Bray
Browse files

Ran the nightly test suit on windows 10 x64, looks good!

parent 70cb6e5d
......@@ -4,20 +4,17 @@
/bin/patients/
/bin/substances/
/bin/markdown/
/bin/compare_results/
/bin/graph_results/
/bin/UnitTests/
/bin/debug/
/bin/debug64/
/bin/graph_results/
/bin/relwithdebinfo/
/bin/relwithdebinfo64/
/bin/release/
/bin/release64/
/bin/scenarios/
/bin/states/
/bin/stable/
/bin/validation/
/bin/states/
/bin/test_results/
/bin/xsd/
/bin/*.jar
/bin/*.log
......
......@@ -7,15 +7,6 @@ if(POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
endif()
find_package(Java REQUIRED)
include(useJava)
if(_JAVA_HOME)
# Overwrite Java if the env variable is set
set(Java_JAVA_EXECUTABLE ${_JAVA_HOME}/bin/java)
endif()
message(STATUS "Java Home : ${_JAVA_HOME}")
message(STATUS "Using Java : ${Java_JAVA_EXECUTABLE}")
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
message( STATUS "64 bits compiler detected" )
set( EX_CONFIG "64" )
......@@ -109,8 +100,10 @@ elseif(NOT PULL_DEPENDENCIES)
CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(FILES ${DLIBS}
CONFIGURATIONS RelWithDeb DESTINATION ${INSTALL_BIN}/relwithdeb${EX_CONFIG})
# TODO put a USE_JAVA option in (you would get no JNI, jar, and test suite, but maybe you just want the C++ SDK)
# Java Compiling
find_package(Java REQUIRED)
include(useJava)
file(GLOB_RECURSE JAVA_FILES
"${CMAKE_SOURCE_DIR}/schema/java/*.java"
"${CMAKE_SOURCE_DIR}/cdm/java/*.java"
......@@ -137,62 +130,46 @@ elseif(NOT PULL_DEPENDENCIES)
COMMAND ${CMAKE_COMMAND} -E copy ${_jarFile} ${INSTALL_BIN})
install_jar(BioGears.jar ${INSTALL_BIN})
set(JAVA_CLASSPATH BioGears.jar;
../jar/jcommon-1.0.16.jar;
../jar/jdom-2.0.2.jar;
../jar/jfreechart-1.0.13.jar;
../jar/guava-11.0.2.jar;
../jar/log4j-1.2.17.jar;
../jar/poi-3.13-20150929.jar;
../jar/poi-ooxml-3.13-20150929.jar;
../jar/poi-ooxml-schemas-3.13-20150929.jar;
../jar/pdfbox-2.0.0-RC3.jar;
../jar/reflections-0.9.9-RC1-uberjar.jar;
../jar/xmlbeans-2.6.0.jar;
../jar/zip4j-1.3.1.jar)
# BioGears Testing
enable_testing()
add_test(NAME genData
COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.biogears.dataset.DataSetReader
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=GenData -P ${CMAKE_SOURCE_DIR}/cmake/Scripts.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME genStates
COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver ../test/config/InitialPatientStates.config
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=InitialPatientStates -P ${CMAKE_SOURCE_DIR}/cmake/Scripts.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME runDebug
COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver ../test/config/DebugRun.config
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=DebugRun -P ${CMAKE_SOURCE_DIR}/cmake/Scripts.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME runCDMUnitTests
COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver ../test/config/CDMUnitTests.config
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=CDMUnitTests -P ${CMAKE_SOURCE_DIR}/cmake/Scripts.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME runBGEUnitTests
COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver ../test/config/BGEUnitTests.config
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=BGEUnitTests -P ${CMAKE_SOURCE_DIR}/cmake/Scripts.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME runSystemValidation
COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver ../test/config/ValidationSystems.config
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=SystemValidation -P ${CMAKE_SOURCE_DIR}/cmake/Scripts.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME runPatientalidation
COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver ../test/config/ValidationPatients.config
add_test(NAME runPatientValidation
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=PatientValidation -P ${CMAKE_SOURCE_DIR}/cmake/Scripts.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME runVerification
COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver ../test/config/VerificationScenarios.config
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=VerificationScenarios -P ${CMAKE_SOURCE_DIR}/cmake/Scripts.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME runDrugValidation
COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver ../test/config/ValidationDrugs.config
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=ValidationDrugs -P ${CMAKE_SOURCE_DIR}/cmake/Scripts.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME runLongVerification
COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver ../test/config/LongVerificationScenarios.config
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=LongVerificationScenarios -P ${CMAKE_SOURCE_DIR}/cmake/Scripts.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
# Sinice I am using wildcard role up of files AND I am generating binding files
# I need a way to force CMAKE to rerun and build everyting to add and remove new/old
# files from any make files or projects when the Data Model is changed
# Make a target that will rebuild cmake, and thus regenerate binding file and projects that point to those new bind files
add_custom_target(refreshCMake)
add_custom_command(TARGET refreshCMake POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/CMakeFiles/generate.stamp
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/schema/CMakeFiles/generate.stamp.depend
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/cdm/CMakeFiles/generate.stamp.depend
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/engine/CMakeFiles/generate.stamp.depend
COMMAND ${CMAKE_COMMAND} .)
# TODO More Test Targets
# Rebasing
# mil.tatrc.physiology.utilities.testing.Rebase [from to (config|ALL)]
#
# Ploting
# mil.tatrc.physiology.utilities.csv.plots.PlotDriver
#
# Reconfigure the config file (in memory) so we can test serialization
# mil.tatrc.physiology.utilities.testing.Reconfiguration
endif()
# Scripts to assist developers
# Mostly these are calling the test suite driver and validator classes in Java
find_package(Java REQUIRED)
include(useJava)
if(_JAVA_HOME)
# Overwrite Java if the env variable is set
message(STATUS "Using JAVA_HOME as my Java executable (set to : ${_JAVA_HOME})")
set(Java_JAVA_EXECUTABLE ${_JAVA_HOME}/bin/java)
endif()
# You tell me what JDK/JRE you want to use
#set(Java_JAVA_EXECUTABLE "/the_jdk_I_want/bin/java)
set(JAVA_CLASSPATH BioGears.jar;
../jar/jcommon-1.0.16.jar;
../jar/jdom-2.0.2.jar;
../jar/jfreechart-1.0.13.jar;
../jar/guava-11.0.2.jar;
../jar/log4j-1.2.17.jar;
../jar/poi-3.13-20150929.jar;
../jar/poi-ooxml-3.13-20150929.jar;
../jar/poi-ooxml-schemas-3.13-20150929.jar;
../jar/pdfbox-2.0.0-RC3.jar;
../jar/reflections-0.9.9-RC1-uberjar.jar;
../jar/xmlbeans-2.6.0.jar;
../jar/zip4j-1.3.1.jar)
if(TYPE STREQUAL "SystemValidation")
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver ../test/config/ValidationSystems.config)
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.validation.SystemValidation)
elseif(TYPE STREQUAL "PatientValidation")
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver ../test/config/ValidationPatients.config)
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.validation.PatientValidation)
elseif(TYPE STREQUAL "GenData")
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.biogears.dataset.DataSetReader)
elseif(TYPE STREQUAL "GenStates")
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver ../test/config/InitialPatientStates.config)
else()
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver ../test/config/${TYPE}.config)
endif()
\ No newline at end of file
......@@ -15,8 +15,8 @@ PercentDifference=2.0
Threads=-1
Executor=mil.tatrc.physiology.biogears.testing.BGEUnitTestDriver
Macro BGEUnitTest=BGEUnitTestDriver FastPlotErrors Baseline=../verification/UnitTests/BioGearsTests/ Computed=./UnitTests/BioGearsTests/
Macro BGEUnitTestFull=BGEUnitTestDriver FullPlotErrors Baseline=../verification/UnitTests/BioGearsTests/ Computed=./UnitTests/BioGearsTests/
Macro BGEUnitTest=BGEUnitTestDriver FastPlotErrors Baseline=../verification/UnitTests/BioGearsTests/ Computed=./test_results/unit_tests/biogears/
Macro BGEUnitTestFull=BGEUnitTestDriver FullPlotErrors Baseline=../verification/UnitTests/BioGearsTests/ Computed=./test_results/unit_tests/biogears/
@group Cardiovascular
CardiovascularCircuitAndTransport = BGEUnitTest Results=CardiovascularCircuitOutput,CardiovascularTransportOutput
......
......@@ -15,7 +15,7 @@ PercentDifference=2.0
Threads=-1
Executor=mil.tatrc.physiology.datamodel.testing.CDMUnitTestDriver
Macro CDMUnitTest=CDMUnitTestDriver FastPlotErrors Baseline=../verification/UnitTests/CDMTests/ Computed=./UnitTests/CDMTests/
Macro CDMUnitTest=CDMUnitTestDriver FastPlotErrors Baseline=../verification/UnitTests/CDMTests/ Computed=./test_results/unit_tests/cdm/
@group Simple Circuits
BadDiodeDC = CDMUnitTest
......
#UniqueName=Directory to process, the baseline directory, Sort=, Divsor=
# This was used to characterize the cv circuit and how modifying the driver changed the circuit hemodynamics
# UniqueName=Directory to process, the baseline directory, Sort=, Divsor=
# - Results will be normalized to the provided baseline directory
# - Sort=Key, where any results column name containing the Key string in it, will be placed into a results file with the Key name
# - A popular use of sort is : Sort=Flow, Sort=Volume, Sort=Pressure
......
......@@ -24,9 +24,9 @@ Executor=mil.tatrc.physiology.datamodel.testing.CDMUnitTestDriver
Executor=mil.tatrc.physiology.biogears.testing.BGEUnitTestDriver
Executor=mil.tatrc.physiology.biogears.testing.ScenarioTestDriver
Macro CDMUnitTest=CDMUnitTestDriver FastPlotErrors Baseline=../verification/UnitTests/CDMTests/ Computed=./UnitTests/CDMTests/
Macro BGEUnitTest=BGEUnitTestDriver FastPlot Baseline=../verification/UnitTests/BioGearsTests/ Computed=./UnitTests/BioGearsTests/
Macro BGEUnitTestFull=BGEUnitTestDriver FullPlot Baseline=../verification/UnitTests/BioGearsTests/ Computed=./UnitTests/BioGearsTests/
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=../verification/Scenarios/ Computed=./Scenarios/ #Results=/BasicStandard
Macro CDMUnitTest=CDMUnitTestDriver FastPlotErrors Baseline=../verification/UnitTests/CDMTests/ Computed=./test_results/unit_tests/cdm/
Macro BGEUnitTest=BGEUnitTestDriver FastPlot Baseline=../verification/UnitTests/BioGearsTests/ Computed=./test_results/unit_tests/biogears/
Macro BGEUnitTestFull=BGEUnitTestDriver FullPlot Baseline=../verification/UnitTests/BioGearsTests/ Computed=./test_results/unit_tests/biogears/
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=../verification/Scenarios/ Computed=./test_results/scenarios/ #Results=/BasicStandard
Patient/BasicStandard.xml = ScenarioTest
......@@ -18,7 +18,7 @@ Patients=all
Executor=mil.tatrc.physiology.biogears.testing.ScenarioTestDriver
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=../verification/Scenarios/ Computed=./Scenarios/
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=../verification/Scenarios/ Computed=./test_results/scenarios/
@group
......
......@@ -24,6 +24,6 @@ Threads=-1
Executor=mil.tatrc.physiology.biogears.testing.ScenarioTestDriver
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=../verification/Scenarios/ Computed=./Scenarios/
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=../verification/Scenarios/ Computed=./test_results/scenarios/
Miscellaneous/12hrFast.xml = ScenarioTest
\ No newline at end of file
......@@ -22,7 +22,7 @@ Threads=-1
Executor=mil.tatrc.physiology.biogears.testing.ScenarioTestDriver
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=../verification/Scenarios/ Computed=./Scenarios/ #Results=/BasicStandard
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=../verification/Scenarios/ Computed=./test_results/scenarios/ #Results=/BasicStandard
Validation/AlbuterolValidation.xml=ScenarioTest
......
......@@ -18,7 +18,7 @@ Patients=all
Executor=mil.tatrc.physiology.biogears.testing.ScenarioTestDriver
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=../verification/Scenarios/ Computed=./Scenarios/
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=../verification/Scenarios/ Computed=./test_results/scenarios/
@group
......
......@@ -18,7 +18,7 @@ Threads=-1
Executor=mil.tatrc.physiology.biogears.testing.ScenarioTestDriver
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=../verification/Scenarios/ Computed=./Scenarios/
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=../verification/Scenarios/ Computed=./test_results/scenarios/
@group
......
......@@ -24,7 +24,7 @@ Threads=-1
Executor=mil.tatrc.physiology.biogears.testing.ScenarioTestDriver
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=../verification/Scenarios/ Computed=./Scenarios/
Macro ScenarioTest=ScenarioTestDriver FastPlot Baseline=../verification/Scenarios/ Computed=./test_results/scenarios/
@group
......
......@@ -19,12 +19,12 @@ specific language governing permissions and limitations under the License.
int main(int argc, char* argv[])
{
std::string cdmDir = ".\\UnitTests\\CDMTests";
Logger cdmLogger(cdmDir + "\\CDMTests.log");
std::string cdmDir = ".\\test_results\\unit_tests\\cdm";
Logger cdmLogger(cdmDir + "\\CDMUnitTests.log");
CommonDataModelTest cdmTest(&cdmLogger);
std::string bgDir = ".\\UnitTests\\BioGearsTests";
Logger bgeLogger(bgDir + "\\BioGearsTests.log");
std::string bgDir = ".\\test_results\\unit_tests\\biogears";
Logger bgeLogger(bgDir + "\\BioGearsUnitTests.log");
BioGearsEngineTest bgeTest(&bgeLogger);
if (argc == 1)
......@@ -98,7 +98,7 @@ int main(int argc, char* argv[])
//bgeTest.AcidBaseFiveCompartmentTestWithProductionConsumptionAndDiffusion(bgDir);
// Our CV Characterization Driver (Not part of the test suite)
//std::string cvDir = ".\\UnitTests\\CVTuningTests";
//std::string cvDir = ".\\test_results\\unit_tests\\biogears\\CVTuningTests";
//MKDIR(cvDir.c_str());
//bgeTest.CardiovascularCircuitScaleTests(cvDir);
......@@ -311,9 +311,9 @@ int main(int argc, char* argv[])
}
else
{
if (cdmTest.RunTest(argv[1], ".\\UnitTests\\CDMTests"))
if (cdmTest.RunTest(argv[1], ".\\test_results\\unit_tests\\cdm"))
return 0;
if (bgeTest.RunTest(argv[1], ".\\UnitTests\\BioGearsTests"))
if (bgeTest.RunTest(argv[1], ".\\test_results\\unit_tests\\biogears"))
return 0;
}
return 1;
......
......@@ -12,8 +12,10 @@ specific language governing permissions and limitations under the License.
package mil.tatrc.physiology.testing;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.*;
......@@ -61,7 +63,12 @@ public class TestDriver
me.environment = args[2];
me.architecture = args[3];
}
me.processConfigFile(args[0]);
File configFile = new File(args[0]);
if(!configFile.exists())
{
System.err.println("Config file "+configFile.getName()+" does not exist");
}
me.processConfigFile(configFile);
int availableThreads = Runtime.getRuntime().availableProcessors();
boolean isPlotting;
......@@ -151,7 +158,7 @@ public class TestDriver
public String architecture = "";
public String commitHash = "";
protected String name;
protected String testName;
protected String reportName;
protected int numThreads=0;
......@@ -222,24 +229,25 @@ public class TestDriver
public void handleFatal(String msg) { Log.fatal("["+name+"] "+msg,""); }
}
public void processConfigFile(String configFile)
{
this.name = configFile.substring(0, configFile.lastIndexOf('.'));
Log.setFileName(this.name+".log");
public void processConfigFile(File configFile)
{
this.testName = configFile.getName();
this.testName = this.testName.substring(0,this.testName.lastIndexOf('.'));
Log.setFileName("./test_results/"+this.testName+".log");
String key;
String value;
this.percentDifference = 2.0;
this.reportName = null;
this.reportName = "TestDriver Report";
this.executors.clear();
this.jobs.clear();
boolean ExecuteJobs=true;
boolean PlotResults=true;
String currentGroup = this.name;
String currentGroup = this.testName;
// Parse the config file
// TODO, make sure all \ are converted to /
......@@ -255,7 +263,7 @@ public class TestDriver
{
currentGroup = line.substring(6).trim();
if(currentGroup.isEmpty())
currentGroup = this.name;
currentGroup = this.testName;
continue;
}
if(line.indexOf('=') == -1)
......@@ -647,7 +655,7 @@ public class TestDriver
{
List<String> currentGroup;
TestReport report = new TestReport();
report.setFullReportPath(".\\"+this.name+"Report.xml");
report.setFullReportPath("./test_results/"+this.testName+"Report.xml");
for(TestJob job : this.jobs)
{
String group = job2groups.get(job);
......@@ -692,7 +700,18 @@ public class TestDriver
}
}
}
report.write();
report.write();
// Write the HTML to a file
try
{
BufferedWriter out = new BufferedWriter(new FileWriter("./test_results/"+this.testName+".html"));
out.write(report.toHTML(this.reportName,groups));
out.close();
}
catch(Exception ex)
{
Log.error("Unable to write HTML report for "+this.testName,ex);
}
}
static void DeleteTestResults(String hint, boolean executeJobs, boolean plotResults)
......
......@@ -227,18 +227,20 @@ public class TestReport
CDMSerializer.writeFile(toDirectory + this.fileName, unload());
}
public String toHTML()
public String toHTML(String title)
{
return toHTML(null);
return toHTML(title, null);
}
public String toHTML(Map<String,List<String>> groups)
public String toHTML(String title, Map<String,List<String>> groups)
{
boolean sortResults = true;
StringBuilder buffer = new StringBuilder();
buffer.append("<html>");
buffer.append("<head><title>"+title+"</title></head>");
buffer.append("<body>");
buffer.append("<h1>"+title+"</h1><br>");
// Any Test Suites Not Run?
buffer.append("<table border=\"1\">");
buffer.append("<tr><th>Missing Reports</th></tr>");
......
......@@ -21,8 +21,8 @@ public class PatientValidation extends ValdiationTool
{
public PatientValidation()
{
DEST_DIRECTORY = "./validation/";
DEFAULT_DIRECTORY = "../docs/validation/";
DEST_DIRECTORY = "./test_results/tables/";
DEFAULT_DIRECTORY = "../test/validation/";
DEFAULT_FILE = "PatientValidationData.xlsx";
TABLE_TYPE = "Patient";
HEADER_PREPEND = "Patient";
......
......@@ -19,8 +19,8 @@ public class SystemValidation extends ValdiationTool
{
public SystemValidation()
{
DEST_DIRECTORY = "./validation/";
DEFAULT_DIRECTORY = "../docs/validation/";
DEST_DIRECTORY = "./test_results/tables/";
DEFAULT_DIRECTORY = "../test/validation/";
DEFAULT_FILE = "SystemValidationData.xlsx";
TABLE_TYPE = "System";
}
......
......@@ -12,9 +12,11 @@ specific language governing permissions and limitations under the License.
package mil.tatrc.physiology.testing.validation;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.lang.reflect.*;
import java.net.InetAddress;
......@@ -130,7 +132,7 @@ public abstract class ValdiationTool
return;
}
// Read in props file
File file = new File("ValidationTables.config");
File file = new File("../test/config/ValidationTables.config");
FileInputStream fileInput = new FileInputStream(file);
Properties config = new Properties();
config.load(fileInput);
......@@ -139,10 +141,11 @@ public abstract class ValdiationTool
html.append("<html>");
html.append("<body>");
html.append("<h1>"+TABLE_TYPE+"Validation</h1><br>");
// Get a list of all the results files we have to work with
File vdir = new File("./Scenarios/Validation/");
File vdir = new File("./test_results/scenarios/Validation/");
String[] vFiles = vdir.list();
// Now read in the spreadsheet
......@@ -179,7 +182,7 @@ public abstract class ValdiationTool
try
{
// Look for a results file
CSVContents results = new CSVContents("./Scenarios/Validation/"+resultsName);
CSVContents results = new CSVContents("./test_results/scenarios/Validation/"+resultsName);
results.readAll(resultData);
// Find any assessments
assessments = new HashMap<String,SEPatientAssessment>();
......@@ -187,7 +190,7 @@ public abstract class ValdiationTool
{
if(vFile.indexOf(sheetName)>-1 && vFile.indexOf('@')>-1)
{
Object aData = CDMSerializer.readFile("./Scenarios/Validation/"+vFile);
Object aData = CDMSerializer.readFile("./test_results/scenarios/Validation/"+vFile);
if(aData instanceof PatientAssessmentData)
{
String aClassName = "SE"+aData.getClass().getSimpleName();
......@@ -449,7 +452,16 @@ public abstract class ValdiationTool
WriteHTML(badSheets,fileName+" Errors");
html.append("</body>");
html.append("</html>");
try
{
BufferedWriter out = new BufferedWriter(new FileWriter("./test_results/"+TABLE_TYPE+"Validation.html"));
out.write(html.toString());
out.close();
}
catch(Exception ex)
{
Log.error("Unable to write "+TABLE_TYPE+" HTML validation report",ex);
}
}
catch(Exception ex)
{
......@@ -461,6 +473,7 @@ public abstract class ValdiationTool
{
String line;
File vDir = new File(destinationDirectory);
vDir.mkdir();
PrintWriter writer = new PrintWriter(destinationDirectory+"/AllValidationTables.md", "UTF-8");
for (String fName : vDir.list())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment