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

Skip to content
Snippets Groups Projects
Commit 4bab7194 authored by Franz KOBER josef's avatar Franz KOBER josef
Browse files

hash sort test files and order restructured and missing sorted test files added

parent 531e53d1
No related branches found
No related tags found
No related merge requests found
Showing
with 123 additions and 49 deletions
<?xml version="1.0" encoding="utf-8"?>
<tns:VectoInputDeclaration xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.10.1" xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationComponent:v2.10" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xmlns:v2.3="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.3" xmlns:v2.10.1="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.10.1" xmlns:di="http://www.w3.org/2000/09/xmldsig#" schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationComponent v:\VectoCore\VectoCore\Resources\XSD/VectoDeclarationComponent.xsd">
<tns:CapacitorSystem xsi:type="v2.10.1:CapacitorSystemComponentDeclarationType">
<Data xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.10.1" xsi:type="CapacitorSystemDataType" id="CAP-asdf" xmlns:v2.9="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.9">
<Manufacturer>a</Manufacturer>
<Model>a</Model>
<CertificationNumber>token</CertificationNumber>
<Date>2021-11-18T14:14:06.0791626Z</Date>
<AppVersion>aaaaa</AppVersion>
<CertificationMethod>Measured</CertificationMethod>
<Capacitance>1.00</Capacitance>
<InternalResistance>23.45</InternalResistance>
<MinVoltage>3.55</MinVoltage>
<MaxVoltage>30.45</MaxVoltage>
<MaxChargingCurrent>100.00</MaxChargingCurrent>
<MaxDischargingCurrent>99.45</MaxDischargingCurrent>
<TestingTemperature>30</TestingTemperature>
</Data>
<v2.10.1:Signature>
<di:Reference URI="#CAP-asdf">
<di:Transforms>
<di:Transform Algorithm="urn:vecto:xml:2017:canonicalization" />
<di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</di:Transforms>
<di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<di:DigestValue>dBadIN60l8Iqcanj/nrx1EbD+KixtDxLAusUcutITk8=</di:DigestValue>
</di:Reference>
</v2.10.1:Signature>
</tns:CapacitorSystem>
</tns:VectoInputDeclaration>
\ No newline at end of file
......@@ -8,10 +8,12 @@ using TUGraz.VectoHashing;
namespace VectoHashingTest
{
public class VectoHashSortTest
{
protected IXMLInputDataReader xmlInputReader;
public class VectoHashSortTest
{
private IXMLInputDataReader xmlInputReader;
private IKernel _kernel;
private const string UnsortedComponentPath = @"Testdata\XML\Sort\Component\Unsorted\";
private const string SortedComponentPath = @"Testdata\XML\Sort\Component\Sorted\";
[OneTimeSetUp]
public void RunBeforeAnyTests()
......@@ -29,8 +31,8 @@ namespace VectoHashingTest
var hash = loadedFile.ComputeHash(VectoComponents.Axlegear);
}
[TestCase("ttvMnXYdQrEAu47QEO2AKyfzOdPSlcdsR/MrmH/mX+k=", @"Testdata\XML\Sort\Engine.xml"),
TestCase("ttvMnXYdQrEAu47QEO2AKyfzOdPSlcdsR/MrmH/mX+k=", @"Testdata\XML\Sort\Engine_unsorted.xml")]
[TestCase("ttvMnXYdQrEAu47QEO2AKyfzOdPSlcdsR/MrmH/mX+k=", SortedComponentPath + "Engine.xml"),
TestCase("ttvMnXYdQrEAu47QEO2AKyfzOdPSlcdsR/MrmH/mX+k=", UnsortedComponentPath + "Engine.xml")]
public void TestEngineHashSort(string expectedHash, string filePath)
{
var loadedFile = VectoHash.Load(filePath);
......@@ -38,18 +40,20 @@ namespace VectoHashingTest
}
[TestCase("hRzWfx3/El/LwEtP86Utm3dgBAF6CagrpEREsca7+/0=", @"Testdata\XML\Sort\Gearbox_APT-N_unsorted.xml"),
TestCase("XZCluPiG05mOAj5rTjTllCWbhCTEYVxCbE940ck3XsA=", @"Testdata\XML\Sort\Gearbox_IHPC_unsorted.xml"),
TestCase("LrsR3WfAkFia53dMiwGEIeAiA+9bdWvaS6x7dIL9yiQ=", @"Testdata\XML\Sort\Gearbox_FWD.xml"),
TestCase("LrsR3WfAkFia53dMiwGEIeAiA+9bdWvaS6x7dIL9yiQ=", @"Testdata\XML\Sort\Gearbox_FWD_unsorted.xml")]
[TestCase("LrsR3WfAkFia53dMiwGEIeAiA+9bdWvaS6x7dIL9yiQ=", SortedComponentPath + "Gearbox_FWD.xml"),
TestCase("LrsR3WfAkFia53dMiwGEIeAiA+9bdWvaS6x7dIL9yiQ=", UnsortedComponentPath + "Gearbox_FWD.xml"),
TestCase("hRzWfx3/El/LwEtP86Utm3dgBAF6CagrpEREsca7+/0=", SortedComponentPath + "Gearbox_APT-N.xml"),
TestCase("hRzWfx3/El/LwEtP86Utm3dgBAF6CagrpEREsca7+/0=", UnsortedComponentPath + "Gearbox_APT-N.xml"),
TestCase("XZCluPiG05mOAj5rTjTllCWbhCTEYVxCbE940ck3XsA=", SortedComponentPath + "Gearbox_IHPC.xml"),
TestCase("XZCluPiG05mOAj5rTjTllCWbhCTEYVxCbE940ck3XsA=", UnsortedComponentPath + "Gearbox_IHPC.xml")]
public void TestGearboxComponentHashSort(string expectedHash, string filePath)
{
var loadedFile = VectoHash.Load(filePath);
Assert.AreEqual(expectedHash, loadedFile.ComputeHash(VectoComponents.Gearbox));
}
[TestCase("og41nROicUT1OoesUTZ9/uoroCUbqlTo7nKmCRYQap4=", @"Testdata\XML\Sort\Axlegear.xml"),
TestCase("og41nROicUT1OoesUTZ9/uoroCUbqlTo7nKmCRYQap4=", @"Testdata\XML\Sort\Axlegear_unsorted.xml")]
[TestCase("og41nROicUT1OoesUTZ9/uoroCUbqlTo7nKmCRYQap4=", SortedComponentPath + "Axlegear.xml"),
TestCase("og41nROicUT1OoesUTZ9/uoroCUbqlTo7nKmCRYQap4=", UnsortedComponentPath + "Axlegear.xml")]
public void TestAxlegearComponentHashSort(string expectedHash, string filePath)
{
var loadedFile = VectoHash.Load(filePath);
......@@ -57,8 +61,8 @@ namespace VectoHashingTest
}
[TestCase("uMH8HJlAtm/SNaj8QOhuX/cBNXTHAZ1la3oEXI42bls=", @"Testdata\XML\Sort\Retarder.xml"),
TestCase("uMH8HJlAtm/SNaj8QOhuX/cBNXTHAZ1la3oEXI42bls=", @"Testdata\XML\Sort\Retarder_unsorted.xml")]
[TestCase("uMH8HJlAtm/SNaj8QOhuX/cBNXTHAZ1la3oEXI42bls=", SortedComponentPath + "Retarder.xml"),
TestCase("uMH8HJlAtm/SNaj8QOhuX/cBNXTHAZ1la3oEXI42bls=", UnsortedComponentPath + "Retarder.xml")]
public void TestRetarderComponentHashSort(string expectedHash, string filePath)
{
var loadedFile = VectoHash.Load(filePath);
......@@ -66,8 +70,8 @@ namespace VectoHashingTest
}
[TestCase("o5/ZtRQ8nAui3rhM6adKiHVU9jRync6f1cDlBcnyOg4=", @"Testdata\XML\Sort\TorqueConverter.xml"),
TestCase("o5/ZtRQ8nAui3rhM6adKiHVU9jRync6f1cDlBcnyOg4=", @"Testdata\XML\Sort\TorqueConverter_unsorted.xml")]
[TestCase("o5/ZtRQ8nAui3rhM6adKiHVU9jRync6f1cDlBcnyOg4=", SortedComponentPath + "TorqueConverter.xml"),
TestCase("o5/ZtRQ8nAui3rhM6adKiHVU9jRync6f1cDlBcnyOg4=", UnsortedComponentPath + "TorqueConverter.xml")]
public void TestTorqueConverterComponentHashSort(string expectedHash, string filePath)
{
var loadedFile = VectoHash.Load(filePath);
......@@ -75,8 +79,8 @@ namespace VectoHashingTest
}
[TestCase("FGaItzPcx1qGytVlroFp+PU9rzsaQWRWnxmIspkqCRM=", @"Testdata\XML\Sort\Angledrive.xml"),
TestCase("FGaItzPcx1qGytVlroFp+PU9rzsaQWRWnxmIspkqCRM=", @"Testdata\XML\Sort\Angledrive_unsorted.xml")]
[TestCase("FGaItzPcx1qGytVlroFp+PU9rzsaQWRWnxmIspkqCRM=", SortedComponentPath + "Angledrive.xml"),
TestCase("FGaItzPcx1qGytVlroFp+PU9rzsaQWRWnxmIspkqCRM=", UnsortedComponentPath + "Angledrive.xml")]
public void TestAngledriveComponentHashSort(string expectedHash, string filePath)
{
var loadedFile = VectoHash.Load(filePath);
......@@ -84,30 +88,36 @@ namespace VectoHashingTest
}
[TestCase("NiyH2Xp0rQswwXIOf52Jm0wvK4Yc2/PL/T+zQCWQGFo=", @"Testdata\XML\Sort\ADC_unsorted.xml")]
[TestCase("NiyH2Xp0rQswwXIOf52Jm0wvK4Yc2/PL/T+zQCWQGFo=", SortedComponentPath + "ADC.xml"),
TestCase("NiyH2Xp0rQswwXIOf52Jm0wvK4Yc2/PL/T+zQCWQGFo=", UnsortedComponentPath + "ADC.xml")]
public void TestADCHashSort(string expectedHash, string filePath)
{
var loadedFile = VectoHash.Load(filePath);
Assert.AreEqual(expectedHash, loadedFile.ComputeHash(VectoComponents.ADC));
}
[TestCase("tam1LGpdznHGFGo+rp0WVr0/6+F2yU2Kv4G4tYvAe+Y=", @"Testdata\XML\Sort\BatterySystem_1_unsorted.xml")]
[TestCase("tam1LGpdznHGFGo+rp0WVr0/6+F2yU2Kv4G4tYvAe+Y=", SortedComponentPath + "BatterySystem_1.xml"),
TestCase("tam1LGpdznHGFGo+rp0WVr0/6+F2yU2Kv4G4tYvAe+Y=", UnsortedComponentPath + "BatterySystem_1.xml")]
public void TestBatterySystemHashSort(string expectedHash, string filePath)
{
var loadedFile = VectoHash.Load(filePath);
Assert.AreEqual(expectedHash, loadedFile.ComputeHash(VectoComponents.BatterySystem));
}
[TestCase("dBadIN60l8Iqcanj/nrx1EbD+KixtDxLAusUcutITk8=", @"Testdata\XML\Sort\CapacitorSystem_1.xml")]
[TestCase("dBadIN60l8Iqcanj/nrx1EbD+KixtDxLAusUcutITk8=", SortedComponentPath + "CapacitorSystem_1.xml"),
TestCase("dBadIN60l8Iqcanj/nrx1EbD+KixtDxLAusUcutITk8=", UnsortedComponentPath + "CapacitorSystem_1.xml")]
public void TestCapacitorHashSort(string expectedHash, string filePath)
{
var loadedFile = VectoHash.Load(filePath);
Assert.AreEqual(expectedHash, loadedFile.ComputeHash(VectoComponents.CapacitorSystem));
}
[TestCase("X5dgavua/V/jzBQeJ6SxZXsXm3i1jruL48LedzZ5IxU=", @"Testdata\XML\Sort\ElectricMachineSystem-IHPC_1_unsorted.xml"),
TestCase("wLFLpJxFZ6mDXeqdlZCGVOLCoXTCf7XTL0q9ZKkmt7o=", @"Testdata\XML\Sort\ElectricMachineSystem_1_unsorted.xml"),
TestCase("CunnDxsiE9kciX+v9oeEGADZpEc88NtfMtmrHyJkCQ0=", @"Testdata\XML\Sort\ElectricMachineSystem_StdValues_unsorted.xml")]
[TestCase("X5dgavua/V/jzBQeJ6SxZXsXm3i1jruL48LedzZ5IxU=", SortedComponentPath + "ElectricMachineSystem-IHPC_1.xml"),
TestCase("X5dgavua/V/jzBQeJ6SxZXsXm3i1jruL48LedzZ5IxU=", UnsortedComponentPath + "ElectricMachineSystem-IHPC_1.xml"),
TestCase("wLFLpJxFZ6mDXeqdlZCGVOLCoXTCf7XTL0q9ZKkmt7o=", SortedComponentPath + "ElectricMachineSystem_1.xml"),
TestCase("wLFLpJxFZ6mDXeqdlZCGVOLCoXTCf7XTL0q9ZKkmt7o=", UnsortedComponentPath + "ElectricMachineSystem_1.xml"),
TestCase("CunnDxsiE9kciX+v9oeEGADZpEc88NtfMtmrHyJkCQ0=", SortedComponentPath + "ElectricMachineSystem_StdValues.xml"),
TestCase("CunnDxsiE9kciX+v9oeEGADZpEc88NtfMtmrHyJkCQ0=", UnsortedComponentPath + "ElectricMachineSystem_StdValues.xml")]
public void TestElectricMachineHashSort(string expectedHash, string filePath)
{
var loadedFile = VectoHash.Load(filePath);
......@@ -115,8 +125,10 @@ namespace VectoHashingTest
}
[TestCase("3L/fYxKTdIwzADHQMnUBPxcNwZNEHM+sKEC2M32UnEA=", @"Testdata\XML\Sort\IEPC_1_unsorted.xml"),
TestCase("BTHs/Hh2SgycIwU5OSuTgU/2SptMvmRFvPXr2X1Y7XQ=", @"Testdata\XML\Sort\IEPC_StdValues_unsorted.xml")]
[TestCase("3L/fYxKTdIwzADHQMnUBPxcNwZNEHM+sKEC2M32UnEA=", SortedComponentPath + "IEPC_1.xml"),
TestCase("3L/fYxKTdIwzADHQMnUBPxcNwZNEHM+sKEC2M32UnEA=", UnsortedComponentPath + "IEPC_1.xml"),
TestCase("BTHs/Hh2SgycIwU5OSuTgU/2SptMvmRFvPXr2X1Y7XQ=", SortedComponentPath + "IEPC_StdValues.xml"),
TestCase("BTHs/Hh2SgycIwU5OSuTgU/2SptMvmRFvPXr2X1Y7XQ=", UnsortedComponentPath + "IEPC_StdValues.xml")]
public void TestIEPCHashSort(string expectedHash, string filePath)
{
var loadedFile = VectoHash.Load(filePath);
......
......@@ -87,70 +87,100 @@
<Content Include="Testdata\XML\simple_document.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\ADC_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Sorted\ADC.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Angledrive.xml">
<Content Include="Testdata\XML\Sort\Component\Sorted\BatterySystem_1.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Angledrive_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Sorted\ElectricMachineSystem-IHPC_1.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Axlegear.xml">
<Content Include="Testdata\XML\Sort\Component\Sorted\ElectricMachineSystem_1.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Axlegear_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Sorted\ElectricMachineSystem_StdValues.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\BatterySystem_1_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Sorted\Gearbox_APT-N.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\CapacitorSystem_1.xml">
<Content Include="Testdata\XML\Sort\Component\Sorted\Gearbox_IHPC.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\ElectricMachineSystem-IHPC_1_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Sorted\IEPC_1.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\ElectricMachineSystem_1_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Sorted\IEPC_StdValues.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\ElectricMachineSystem_StdValues_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Unsorted\ADC.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Engine.xml">
<Content Include="Testdata\XML\Sort\Component\Sorted\Angledrive.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Engine_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Unsorted\Angledrive.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Gearbox_APT-N_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Sorted\Axlegear.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Gearbox_FWD.xml">
<Content Include="Testdata\XML\Sort\Component\Unsorted\Axlegear.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Gearbox_FWD_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Unsorted\BatterySystem_1.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Gearbox_IHPC_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Sorted\CapacitorSystem_1.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\IEPC_1_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Unsorted\CapacitorSystem_1.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\IEPC_StdValues_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Unsorted\ElectricMachineSystem-IHPC_1.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Retarder.xml">
<Content Include="Testdata\XML\Sort\Component\Unsorted\ElectricMachineSystem_1.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Retarder_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Unsorted\ElectricMachineSystem_StdValues.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\TorqueConverter.xml">
<Content Include="Testdata\XML\Sort\Component\Sorted\Engine.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\TorqueConverter_unsorted.xml">
<Content Include="Testdata\XML\Sort\Component\Unsorted\Engine.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Component\Unsorted\Gearbox_APT-N.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Component\Sorted\Gearbox_FWD.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Component\Unsorted\Gearbox_FWD.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Component\Unsorted\Gearbox_IHPC.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Component\Unsorted\IEPC_1.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Component\Unsorted\IEPC_StdValues.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Component\Sorted\Retarder.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Component\Unsorted\Retarder.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Component\Sorted\TorqueConverter.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\Component\Unsorted\TorqueConverter.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\ToHash\multiple_components.xml">
......@@ -262,7 +292,9 @@
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="Testdata\XML\Sort\Job\" />
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
......
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