diff --git a/build.gradle.kts b/build.gradle.kts index 61c1a0bb99..2135ec6a6b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -46,7 +46,7 @@ val studioPath: String return androidStudioPath ?: downloadStudioIfNeededAndGetPath() } -val jacksonVersion = "2.10.0" +val jacksonVersion = "2.13.4" val okhttpVersion = "3.14.0" val ideaSandbox = "${project.buildDir.absolutePath}/idea-sandbox" @@ -236,17 +236,8 @@ allprojects { dependencies { implementation(group = "org.twitter4j", name = "twitter4j-core", version = "4.0.1") implementation("org.jsoup:jsoup:1.12.1") - implementation(group = "com.fasterxml.jackson.dataformat", name = "jackson-dataformat-yaml", version = jacksonVersion) { - exclude(module = "snakeyaml") - } + implementation(group = "com.fasterxml.jackson.dataformat", name = "jackson-dataformat-yaml", version = jacksonVersion) implementation(group = "com.fasterxml.jackson.datatype", name = "jackson-datatype-jsr310", version = jacksonVersion) - - //transitive dependency is specified explicitly to avoid conflict with lib bundled since idea 181 - implementation(group = "com.fasterxml.jackson.core", name = "jackson-core", version = jacksonVersion) - - //transitive dependency is specified explicitly because of the issue https://github.com/FasterXML/jackson-dataformats-text/issues/81 - //intellij platform uses affected snakeyaml version inside - implementation(group = "org.yaml", name = "snakeyaml", version = "1.21") implementation(group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin", version = jacksonVersion) { excludeKotlinDeps() } diff --git a/educational-core/testSrc/com/jetbrains/edu/coursecreator/yaml/YamlRemoteDeserializationTest.kt b/educational-core/testSrc/com/jetbrains/edu/coursecreator/yaml/YamlRemoteDeserializationTest.kt index 7f67efba98..99be308812 100644 --- a/educational-core/testSrc/com/jetbrains/edu/coursecreator/yaml/YamlRemoteDeserializationTest.kt +++ b/educational-core/testSrc/com/jetbrains/edu/coursecreator/yaml/YamlRemoteDeserializationTest.kt @@ -184,6 +184,19 @@ class YamlRemoteDeserializationTest : YamlTestCase() { assertEquals(attempt, task.attempt) } + fun `test quited date`() { + val id = 1 + val yamlText = """ + |id: $id + |update_date: "Thu, 01 Jan 1970 00:00:01 UTC" + |""".trimMargin() + + val configFile = createConfigFile(yamlText, REMOTE_COURSE_CONFIG) + val course = YamlDeserializer.deserializeRemoteItem(configFile) as EduCourse + assertEquals(1, course.id) + assertEquals(Date(1000), course.updateDate) + } + private fun createConfigFile(yamlText: String, configName: String): LightVirtualFile { val configFile = LightVirtualFile(configName) runWriteAction { VfsUtil.saveText(configFile, yamlText) } diff --git a/educational-core/testSrc/com/jetbrains/edu/coursecreator/yaml/YamlRemoteSerializationTest.kt b/educational-core/testSrc/com/jetbrains/edu/coursecreator/yaml/YamlRemoteSerializationTest.kt index 1b6a720e1e..81f4aec0e6 100644 --- a/educational-core/testSrc/com/jetbrains/edu/coursecreator/yaml/YamlRemoteSerializationTest.kt +++ b/educational-core/testSrc/com/jetbrains/edu/coursecreator/yaml/YamlRemoteSerializationTest.kt @@ -27,7 +27,7 @@ class YamlRemoteSerializationTest : YamlTestCase() { course.updateDate = Date("Fri, 01 Jan 2010 00:00:00 UTC") doTest(course, """ |id: 1 - |update_date: Fri, 01 Jan 2010 00:00:00 UTC + |update_date: "Fri, 01 Jan 2010 00:00:00 UTC" |default_section: 1 |""".trimMargin()) } @@ -57,7 +57,7 @@ class YamlRemoteSerializationTest : YamlTestCase() { | ide_files: ${hyperskillProject.ideFiles} | is_template_based: ${hyperskillProject.isTemplateBased} | use_ide: true - |update_date: Fri, 01 Jan 2010 00:00:00 UTC + |update_date: "Fri, 01 Jan 2010 00:00:00 UTC" |stages: |- id: 1 | step: 11 @@ -84,7 +84,7 @@ class YamlRemoteSerializationTest : YamlTestCase() { course.updateDate = Date("Fri, 01 Jan 2010 00:00:00 UTC") doTest(course, """ |id: 1 - |update_date: Fri, 01 Jan 2010 00:00:00 UTC + |update_date: "Fri, 01 Jan 2010 00:00:00 UTC" |""".trimMargin()) } @@ -97,7 +97,7 @@ class YamlRemoteSerializationTest : YamlTestCase() { section.updateDate = Date("Fri, 01 Jan 2010 00:00:00 UTC") doTest(section, """ |id: 1 - |update_date: Fri, 01 Jan 2010 00:00:00 UTC + |update_date: "Fri, 01 Jan 2010 00:00:00 UTC" |""".trimMargin()) } @@ -138,7 +138,7 @@ class YamlRemoteSerializationTest : YamlTestCase() { task.updateDate = Date("Fri, 01 Jan 2010 00:00:00 UTC") doTest(task, """ |id: 1 - |update_date: Fri, 01 Jan 2010 00:00:00 UTC + |update_date: "Fri, 01 Jan 2010 00:00:00 UTC" |""".trimMargin()) } @@ -152,7 +152,7 @@ class YamlRemoteSerializationTest : YamlTestCase() { doTest(task, """ |type: dataset |id: 1 - |update_date: Fri, 01 Jan 2010 00:00:00 UTC + |update_date: "Fri, 01 Jan 2010 00:00:00 UTC" |""".trimMargin()) } @@ -170,10 +170,10 @@ class YamlRemoteSerializationTest : YamlTestCase() { doTest(task, """ |type: dataset |id: 1 - |update_date: Fri, 01 Jan 2010 00:00:00 UTC + |update_date: "Fri, 01 Jan 2010 00:00:00 UTC" |attempt: | id: 2 - | end_date_time: Thu, 01 Jan 1970 00:05:00 UTC + | end_date_time: "Thu, 01 Jan 1970 00:05:00 UTC" |""".trimMargin()) } diff --git a/educational-core/testSrc/com/jetbrains/edu/learning/format/yaml/StudentYamlSerializationTest.kt b/educational-core/testSrc/com/jetbrains/edu/learning/format/yaml/StudentYamlSerializationTest.kt index c55630f55b..9f809c2b81 100644 --- a/educational-core/testSrc/com/jetbrains/edu/learning/format/yaml/StudentYamlSerializationTest.kt +++ b/educational-core/testSrc/com/jetbrains/edu/learning/format/yaml/StudentYamlSerializationTest.kt @@ -245,7 +245,7 @@ class StudentYamlSerializationTest : EduTestCase() { |status: Failed |feedback: | message: $message - | time: Thu, 01 Jan 1970 00:00:00 UTC + | time: "Thu, 01 Jan 1970 00:00:00 UTC" | expected: $expected | actual: $actual |record: 1 @@ -267,7 +267,7 @@ class StudentYamlSerializationTest : EduTestCase() { |type: edu |status: Failed |feedback: - | time: Thu, 01 Jan 1970 00:00:00 UTC + | time: "Thu, 01 Jan 1970 00:00:00 UTC" |record: 1 |""".trimMargin()) } diff --git a/educational-core/testSrc/com/jetbrains/edu/learning/stepik/StepikCreateSubmissionTest.kt b/educational-core/testSrc/com/jetbrains/edu/learning/stepik/StepikCreateSubmissionTest.kt index 554c6187f4..4fc740ab6a 100644 --- a/educational-core/testSrc/com/jetbrains/edu/learning/stepik/StepikCreateSubmissionTest.kt +++ b/educational-core/testSrc/com/jetbrains/edu/learning/stepik/StepikCreateSubmissionTest.kt @@ -74,7 +74,11 @@ class StepikCreateSubmissionTest : StepikBasedCreateSubmissionTest() { | is_visible: true | - name: src/Test.kt | is_visible: false - | edu_task: '{"task":{"name":"Edu problem","stepic_id":1,"status":"Unchecked","files":{"src/Task.kt":{"name":"src/Task.kt","placeholders":[],"is_visible":true,"text":""},"src/Test.kt":{"name":"src/Test.kt","placeholders":[],"is_visible":false,"text":""}},"task_type":"edu"}}' + | edu_task: "{\"task\":{\"name\":\"Edu problem\",\"stepic_id\":1,\"status\":\"Unchecked\"\ + | ,\"files\":{\"src/Task.kt\":{\"name\":\"src/Task.kt\",\"placeholders\":[],\"\ + | is_visible\":true,\"text\":\"\"},\"src/Test.kt\":{\"name\":\"src/Test.kt\",\"\ + | placeholders\":[],\"is_visible\":false,\"text\":\"\"}},\"task_type\":\"edu\"\ + | }}" | version: $JSON_FORMAT_VERSION | """.trimMargin())