Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 0f60e475 authored by Harald MARTINI's avatar Harald MARTINI
Browse files

Added Testcase for CompletedExempted without TPMLM

parent 604e4866
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,11 @@ namespace TUGraz.VectoCore.Tests.Integration.Multistage
private const string CompletedDiesel = TestDataDir + "newVifCompletedConventional.vecto";
private const string CompletedExempted = TestDataDir + "newVifExempted.vecto";
private const string CompletedExemptedWithoutTPMLM = TestDataDir + "newVifExempted-noTPMLM.vecto";
private const string InterimExempted = TestDataDir + "newVifExemptedIncomplete.vecto";
private const string InterimDiesel = TestDataDir + "newVifInterimDiesel.vecto";
......@@ -66,14 +71,8 @@ namespace TUGraz.VectoCore.Tests.Integration.Multistage
[Test]//, Timeout(3000)]
public void ExemptedPrimaryAndCompletedTest()
{
var inputFile = Path.GetFullPath(CompletedExempted);
var input = JSONInputDataFactory.ReadJsonJob(inputFile);
StartSimulation(input);
_jobContainer.WaitFinished();
//while (!_jobContainer.AllCompleted) {
// //Busy wait
//}
StartSimulation(CompletedExempted);
var writtenFiles = GetWrittenFiles();
ShowWrittenFiles(writtenFiles);
......@@ -82,26 +81,31 @@ namespace TUGraz.VectoCore.Tests.Integration.Multistage
Assert.IsTrue(writtenFiles.Contains(_fileoutputWriter.XMLFullReportName));
Assert.IsTrue(writtenFiles.Contains(_fileoutputWriter.XMLCustomerReportName));
Assert.IsTrue(writtenFiles.Contains(_fileoutputWriter.XMLMultistageReportFileName));
}
[Test]//, Timeout(3000)]
public void ExemptedPrimaryAndInterimTest()
[Test]
public void ExemptedPrimaryAndCompletedWithoutTPMLMTest()
{
var inputFile = Path.GetFullPath(InterimExempted);
var input = JSONInputDataFactory.ReadJsonJob(inputFile);
StartSimulation(input);
_jobContainer.WaitFinished();
//while (!_jobContainer.AllCompleted)
//{
// //Busy wait
//}
StartSimulation(CompletedExemptedWithoutTPMLM);
var writtenFiles = GetWrittenFiles();
ShowWrittenFiles(writtenFiles);
Assert.IsTrue(writtenFiles.Contains(_tempFileOutputWriter.XMLFullReportName));
Assert.IsTrue(writtenFiles.Contains(_fileoutputWriter.XMLFullReportName));
Assert.IsTrue(writtenFiles.Contains(_fileoutputWriter.XMLCustomerReportName));
Assert.IsTrue(writtenFiles.Contains(_fileoutputWriter.XMLMultistageReportFileName));
}
[Test]//, Timeout(3000)]
public void ExemptedPrimaryAndInterimTest()
{
StartSimulation(InterimExempted);
var writtenFiles = GetWrittenFiles();
ShowWrittenFiles(writtenFiles);
Assert.IsTrue(writtenFiles.Contains(_tempFileOutputWriter.XMLFullReportName));
Assert.IsFalse(writtenFiles.Contains(_fileoutputWriter.XMLFullReportName));
Assert.IsFalse(writtenFiles.Contains(_fileoutputWriter.XMLCustomerReportName));
......@@ -124,16 +128,7 @@ namespace TUGraz.VectoCore.Tests.Integration.Multistage
[Test, Timeout(1000 * 20 * 60)]
public void PrimaryAndCompletedTest()
{
var inputFile = Path.GetFullPath(CompletedDiesel);
var input = JSONInputDataFactory.ReadJsonJob(inputFile);
StartSimulation(input);
_jobContainer.WaitFinished();
//while (!_jobContainer.AllCompleted)
//{
// //Busy wait
//}
StartSimulation(CompletedDiesel);
var writtenFiles = GetWrittenFiles();
ShowWrittenFiles(writtenFiles);
......@@ -150,17 +145,8 @@ namespace TUGraz.VectoCore.Tests.Integration.Multistage
[Test, Timeout(1000 * 10 * 60)]
public void PrimaryAndInterimTest()
{
var inputFile = Path.GetFullPath(InterimDiesel);
var input = JSONInputDataFactory.ReadJsonJob(inputFile);
StartSimulation(input);
StartSimulation(InterimDiesel);
_jobContainer.WaitFinished();
//while (!_jobContainer.AllCompleted)
//{
// //Busy wait
//}
var writtenFiles = GetWrittenFiles();
ShowWrittenFiles(writtenFiles);
......@@ -171,6 +157,17 @@ namespace TUGraz.VectoCore.Tests.Integration.Multistage
Assert.IsTrue(writtenFiles.Contains(_fileoutputWriter.XMLMultistageReportFileName));
}
private void StartSimulation(string path)
{
var inputFile = Path.GetFullPath(path);
var input = JSONInputDataFactory.ReadJsonJob(inputFile);
StartSimulation(input);
_jobContainer.WaitFinished();
}
private void StartSimulation(IInputDataProvider input)
{
......
{
"Header": {
"CreatedBy": "Harry",
"Date": "2021-08-25T00:00:00+02:00",
"AppVersion": "Vecto3GUI2020",
"FileVersion": 10
},
"Body": {
"PrimaryVehicle": "..\\..\\XML\\XMLReaderDeclaration\\SchemaVersion2.10\\exempted_primary_heavyBus.xml",
"InterimStage": "..\\..\\XML\\XMLReaderDeclaration\\SchemaVersion2.10\\vecto_vehicle-exempted_input_completewithoutTMPLM.xml",
"Completed": false
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<tns:VectoInputDeclaration xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationInput:v2.0" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.10.2" schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationJob V:\VectoCore\VectoCore\Resources\XSD\VectoDeclarationJob.xsd">
<v2.0:Vehicle id="VEH-1234567890" xsi:type="Vehicle_Exempted_CompletedBusDeclarationType">
<Manufacturer>Some Manufacturer</Manufacturer>
<ManufacturerAddress>Infinite Loop</ManufacturerAddress>
<VIN>VEH-1234567891</VIN>
<Date>2021-09-19T22:00:00Z</Date>
<Model>Sample Bus Model 2</Model>
<LegislativeCategory>M3</LegislativeCategory>
<CorrectedActualMass>7000</CorrectedActualMass>
<ClassBus>A</ClassBus>
<NumberPassengerSeatsLowerDeck>10</NumberPassengerSeatsLowerDeck>
<NumberPassengersStandingLowerDeck>0</NumberPassengersStandingLowerDeck>
<NumberPassengerSeatsUpperDeck>20</NumberPassengerSeatsUpperDeck>
<NumberPassengersStandingUpperDeck>0</NumberPassengersStandingUpperDeck>
<BodyworkCode>CE</BodyworkCode>
<LowEntry>false</LowEntry>
<HeightIntegratedBody>2500</HeightIntegratedBody>
</v2.0:Vehicle>
</tns:VectoInputDeclaration>
\ No newline at end of file
......@@ -2362,6 +2362,9 @@
<None Include="TestData\Integration\Multistage\newVifCompletedConventional.vecto">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Integration\Multistage\newVifExempted-noTPMLM.vecto">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="TestData\Integration\Multistage\newVifExempted.vecto">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment