Commit f7a48b28 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Update test definitions.

parent be35681d
Pipeline #23474 passed with stage
in 2 minutes and 12 seconds
......@@ -96,6 +96,7 @@ class LocalTestRun {
val outputFolder = "/home/jonas/memobase/data/test/step-4"
val mappingFile = "/config/localTransforms.yml"
val global = GlobalTransformsLoader("src/test/resources/global/transforms.yml")
global.parse()
val local = LocalTransformsLoader(File(folder + mappingFile).readBytes())
local.parse("test-key")
val transformConfigs = local.get() + global.get()
......
......@@ -24,6 +24,7 @@ import ch.memobase.transform.DateNormalizationTransform
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import org.junit.jupiter.api.assertAll
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class TestDates {
......@@ -34,14 +35,27 @@ class TestDates {
val feb = Date.validateMonthValue("févr.")
val march = Date.validateMonthValue("5")
val nullDate = Date.validateMonthValue(null)
assertThat(dez)
.isEqualTo("12")
assertThat(feb)
.isEqualTo("02")
assertThat(march)
.isEqualTo("05")
assertThat(nullDate)
.isEqualTo(null)
assertAll("",
{
assertThat(dez)
.isEqualTo("12")
},
{
assertThat(feb)
.isEqualTo("02")
},
{
assertThat(march)
.isEqualTo("05")
},
{
assertThat(nullDate)
.isEqualTo(null)
}
)
}
@Test
......@@ -55,7 +69,9 @@ class TestDates {
)
resource.addLiteral(RICO.expressedDate, value)
val transforms = GlobalTransformsLoader(TestUtils.pathGlobalTransformSettings).get()
val transformLoader = GlobalTransformsLoader(TestUtils.pathGlobalTransformSettings)
transformLoader.parse()
val transforms = transformLoader.get()
val dateNormalizer = transforms.first { it is DateNormalizationTransform }
dateNormalizer as DateNormalizationTransform
......
(?<singleYear>[0-2][0-9]{3})
(?<fromYear>\d{4})[-](?<fromMonth>\d{2})[-](?<fromDay>\d{2})/(?<untilYear>\d{4})[-](?<untilMonth>\d{2})[-](?<untilDay>\d{2})
(?<fromYear>[0-2][0-9]{3})[-/](?<untilYear>[0-2][0-9]{3})
(?<fromYear>[0-2][0-9]{3})-(?<untilYear>[0-2][0-9]{3})
(?<fromYear>[0-2][0-9]{3})/(?<untilYear>[0-2][0-9]{3})
(?<fromDay>[0-3]?[0-9])[.-](?<fromMonth>[0-1]?[0-9])?[.-]?(?<fromYear>[0-2][0-9]{3})?[.-]?[.-](?<untilDay>[0-3]?[0-9])[.-](?<untilMonth>[0-1]?[0-9])[.-](?<untilYear>[0-2][0-9]{3})
(?<fromYear>\?)/(?<untilYear>[0-2][0-9]{3})
(?<fromYear>\?)/(?<untilYear>\d{4})[-](?<untilMonth>\d{2})[-](?<untilDay>\d{2})
\ No newline at end of file
......@@ -28,14 +28,10 @@ _:b0 a rico:Language ;
rico:resultsFrom _:b1 ;
rico:type "caption" .
_:b2 a rico:Language ;
rico:name "Deutsch" ;
rico:type "caption" .
_:b1 a rico:Activity ;
rico:affects _:b2 ;
rico:beginningDate "2021-02-09T10:02:53+0000"^^xsd:dateTime ;
rico:endDate "2021-02-09T10:02:53+0000"^^xsd:dateTime ;
rico:beginningDate "2021-04-19T12:04:29+0000"^^xsd:dateTime ;
rico:endDate "2021-04-19T12:04:29+0000"^^xsd:dateTime ;
rico:performedBy [ a rico:Mechanism ;
rico:name "LanguagesNormalizer" ;
rico:performs _:b1
......@@ -43,6 +39,10 @@ _:b1 a rico:Activity ;
rico:resultsIn _:b0 ;
rico:type "enrichment" .
_:b2 a rico:Language ;
rico:name "Deutsch" ;
rico:type "caption" .
[ a rico:Record ;
rico:hasLanguage _:b0 , _:b2
] .
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