Skip to content

Commit e178b0a

Browse files
committed
Fixing failing tests.
1 parent 732c560 commit e178b0a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/test/groovy/edu/ie3/datamodel/utils/validation/SystemParticipantValidationUtilsTest.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import static edu.ie3.util.quantities.PowerSystemUnits.KILOVOLTAMPERE
1111
import static tech.units.indriya.unit.Units.PERCENT
1212

1313
import edu.ie3.datamodel.exceptions.InvalidEntityException
14-
import edu.ie3.datamodel.models.input.NodeInput
1514
import edu.ie3.datamodel.models.input.system.characteristic.WecCharacteristicInput
1615
import edu.ie3.datamodel.models.input.system.type.*
1716
import edu.ie3.datamodel.models.input.system.type.chargingpoint.ChargingPointType
@@ -454,7 +453,7 @@ class SystemParticipantValidationUtilsTest extends Specification {
454453
where:
455454
invalidWecType || expectedException
456455
new WecTypeInput(uuid, id, capex, opex, sRated, cosPhiRated, wecCharacteristic, Quantities.getQuantity(110d, EFFICIENCY), rotorArea, hubHeight) || new InvalidEntityException("Efficiency of the converter of WecTypeInput must be between 0% and 100%", invalidWecType)
457-
new WecTypeInput(uuid, id, capex, opex, sRated, cosPhiRated, wecCharacteristic, etaConv, Quantities.getQuantity(-10, ROTOR_AREA), Quantities.getQuantity(-200, HUB_HEIGHT)) || new InvalidEntityException("The following quantities have to be zero or positive: -10 , -200 m", invalidWecType)
456+
new WecTypeInput(uuid, id, capex, opex, sRated, cosPhiRated, wecCharacteristic, etaConv, Quantities.getQuantity(-10, ROTOR_AREA), Quantities.getQuantity(-200, HUB_HEIGHT)) || new InvalidEntityException("The following quantities have to be zero or positive: -10 , -200 m", invalidWecType)
458457
}
459458

460459
def "SystemParticipantValidationUtils.checkEvcs() recognizes all potential errors for a evcs"() {

src/test/groovy/edu/ie3/datamodel/utils/validation/ThermalValidationUtilsTest.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ class ThermalValidationUtilsTest extends Specification {
119119
invalidCylindricalStorage || expectedSize || expectedException
120120
new CylindricalStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, storageVolumeLvl, Quantities.getQuantity(100, StandardUnits.TEMPERATURE), Quantities.getQuantity(200, StandardUnits.TEMPERATURE), c, Quantities.getQuantity(20, PowerSystemUnits.KILOWATT)) || 1 || new InvalidEntityException("Inlet temperature of the cylindrical storage cannot be lower or equal than outlet temperature", invalidCylindricalStorage)
121121
new CylindricalStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, storageVolumeLvl, Quantities.getQuantity(100, StandardUnits.TEMPERATURE), Quantities.getQuantity(100, StandardUnits.TEMPERATURE), c, Quantities.getQuantity(20, PowerSystemUnits.KILOWATT)) || 1 || new InvalidEntityException("Inlet temperature of the cylindrical storage cannot be lower or equal than outlet temperature", invalidCylindricalStorage)
122-
new CylindricalStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, Quantities.getQuantity(-100, StandardUnits.VOLUME), inletTemp, returnTemp, Quantities.getQuantity(-1.05, StandardUnits.SPECIFIC_HEAT_CAPACITY), Quantities.getQuantity(20, PowerSystemUnits.KILOWATT)) || 1 || new InvalidEntityException("The following quantities have to be positive: -100 , -1.05 kWh/K*m³", invalidCylindricalStorage)
123-
new CylindricalStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, Quantities.getQuantity(-100, StandardUnits.VOLUME), inletTemp, returnTemp, Quantities.getQuantity(-1.05, StandardUnits.SPECIFIC_HEAT_CAPACITY), Quantities.getQuantity(-20, PowerSystemUnits.KILOWATT)) || 1 || new InvalidEntityException("The following quantities have to be positive: -100 , -1.05 kWh/K*m³, -20 kW", invalidCylindricalStorage)
122+
new CylindricalStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, Quantities.getQuantity(-100, StandardUnits.VOLUME), inletTemp, returnTemp, Quantities.getQuantity(-1.05, StandardUnits.SPECIFIC_HEAT_CAPACITY), Quantities.getQuantity(20, PowerSystemUnits.KILOWATT)) || 1 || new InvalidEntityException("The following quantities have to be positive: -100 , -1.05 kWh/K*m³", invalidCylindricalStorage)
123+
new CylindricalStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, Quantities.getQuantity(-100, StandardUnits.VOLUME), inletTemp, returnTemp, Quantities.getQuantity(-1.05, StandardUnits.SPECIFIC_HEAT_CAPACITY), Quantities.getQuantity(-20, PowerSystemUnits.KILOWATT)) || 1 || new InvalidEntityException("The following quantities have to be positive: -100 , -1.05 kWh/K*m³, -20 kW", invalidCylindricalStorage)
124124
}
125125

126126
def "ThermalValidationUtils.checkDomesticHotWaterStorage() recognizes all potential errors for a domestic hot water storage"() {
@@ -137,8 +137,8 @@ class ThermalValidationUtilsTest extends Specification {
137137
invalidDomesticHotWaterStorage || expectedSize || expectedException
138138
new DomesticHotWaterStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, storageVolumeLvl, Quantities.getQuantity(100, StandardUnits.TEMPERATURE), Quantities.getQuantity(200, StandardUnits.TEMPERATURE), c, Quantities.getQuantity(20, PowerSystemUnits.KILOWATT)) || 1 || new InvalidEntityException("Inlet temperature of the domestic hot water storage cannot be lower or equal than outlet temperature", invalidDomesticHotWaterStorage)
139139
new DomesticHotWaterStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, storageVolumeLvl, Quantities.getQuantity(100, StandardUnits.TEMPERATURE), Quantities.getQuantity(100, StandardUnits.TEMPERATURE), c, Quantities.getQuantity(20, PowerSystemUnits.KILOWATT)) || 1 || new InvalidEntityException("Inlet temperature of the domestic hot water storage cannot be lower or equal than outlet temperature", invalidDomesticHotWaterStorage)
140-
new DomesticHotWaterStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, Quantities.getQuantity(-100, StandardUnits.VOLUME), inletTemp, returnTemp, Quantities.getQuantity(-1.05, StandardUnits.SPECIFIC_HEAT_CAPACITY), Quantities.getQuantity(20, PowerSystemUnits.KILOWATT)) || 1 || new InvalidEntityException("The following quantities have to be positive: -100 , -1.05 kWh/K*m³", invalidDomesticHotWaterStorage)
141-
new DomesticHotWaterStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, Quantities.getQuantity(-100, StandardUnits.VOLUME), inletTemp, returnTemp, Quantities.getQuantity(-1.05, StandardUnits.SPECIFIC_HEAT_CAPACITY), Quantities.getQuantity(-20, PowerSystemUnits.KILOWATT)) || 1 || new InvalidEntityException("The following quantities have to be positive: -100 , -1.05 kWh/K*m³, -20 kW", invalidDomesticHotWaterStorage)
140+
new DomesticHotWaterStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, Quantities.getQuantity(-100, StandardUnits.VOLUME), inletTemp, returnTemp, Quantities.getQuantity(-1.05, StandardUnits.SPECIFIC_HEAT_CAPACITY), Quantities.getQuantity(20, PowerSystemUnits.KILOWATT)) || 1 || new InvalidEntityException("The following quantities have to be positive: -100 , -1.05 kWh/K*m³", invalidDomesticHotWaterStorage)
141+
new DomesticHotWaterStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, Quantities.getQuantity(-100, StandardUnits.VOLUME), inletTemp, returnTemp, Quantities.getQuantity(-1.05, StandardUnits.SPECIFIC_HEAT_CAPACITY), Quantities.getQuantity(-20, PowerSystemUnits.KILOWATT)) || 1 || new InvalidEntityException("The following quantities have to be positive: -100 , -1.05 kWh/K*m³, -20 kW", invalidDomesticHotWaterStorage)
142142
}
143143

144144
def "ThermalValidationUtils.check() works for complete ThermalGrid as well"() {

0 commit comments

Comments
 (0)