@@ -5,9 +5,8 @@ import js.externals.jquery.JQueryXHR
55import js.externals.jquery .`$`
66import kotlinx.serialization.json.Json
77import kotlinx.serialization.json.JsonConfiguration
8- import org.jetbrains.kotlin.spec.entity.SectionsMap
8+ import org.jetbrains.kotlin.spec.entity.SpecMap
99import org.jetbrains.kotlin.spec.entity.SpecSection
10- import org.jetbrains.kotlin.spec.entity.TestMap
1110import org.jetbrains.kotlin.spec.entity.test.SpecTest
1211import org.jetbrains.kotlin.spec.entity.test.TestPlace
1312import org.jetbrains.kotlin.spec.entity.test.parameters.TestInfo
@@ -63,9 +62,9 @@ interface GithubTestsLoader {
6362 mainSectionName : String ,
6463 path : String ,
6564 testType : TestOrigin ,
66- sectionsMapByTestArea : Map <TestArea , SectionsMap >
67- ): Promise <Map <TestArea , TestMap >> = Promise { resolve, _ ->
68- val resultMap = mutableMapOf<TestArea , TestMap >()
65+ sectionsMapByTestArea : Map <TestArea , SpecMap . Sections >
66+ ): Promise <Map <TestArea , SpecMap . Tests >> = Promise { resolve, _ ->
67+ val resultMap = mutableMapOf<TestArea , SpecMap . Tests >()
6968 val loadableTestAreas: MutableSet <TestArea > = mutableSetOf ()
7069 testAreasToLoad.forEach {
7170 if (sectionsMapByTestArea.isTestsMapExists(testArea = it, requestedMainSection = mainSectionName, requestedSubsectionPath = path)) {
@@ -76,14 +75,14 @@ interface GithubTestsLoader {
7675 * (loadableTestAreas.associateWith {
7776 `$`.ajax(getFullTestMapPath(testType, it, mainSectionName, path), jQueryAjaxSettings { })
7877 .then({ response: Any? , _: Any ->
79- resultMap[it] = TestMap (parseJsonText(response.toString()))
78+ resultMap[it] = SpecMap . Tests (parseJsonText(response.toString()))
8079 })
8180 }.values.toTypedArray())
8281 ).then({ _: Any? , _: Any -> resolve(resultMap) }, { resolve(resultMap) })
8382 }
8483
85- private fun Map <TestArea , SectionsMap >.isTestsMapExists (testArea : TestArea , requestedMainSection : String , requestedSubsectionPath : String ): Boolean {
86- val subsectionsArray = this [testArea]?.sectionTestMap ?.jsonObject?.get(requestedMainSection) ? : return false
84+ private fun Map <TestArea , SpecMap . Sections >.isTestsMapExists (testArea : TestArea , requestedMainSection : String , requestedSubsectionPath : String ): Boolean {
85+ val subsectionsArray = this [testArea]?.json ?.jsonObject?.get(requestedMainSection) ? : return false
8786 subsectionsArray.jsonArray.forEach { jsonElement ->
8887 if (jsonElement.primitive.content == requestedSubsectionPath)
8988 return true
@@ -99,13 +98,13 @@ interface GithubTestsLoader {
9998 }
10099
101100
102- fun loadSectionsMapFileFromRawGithub (): Promise <Map <TestArea , SectionsMap >> = Promise { resolve, _ ->
103- val resultMap = mutableMapOf<TestArea , SectionsMap >()
101+ fun loadSectionsMapFileFromRawGithub (): Promise <Map <TestArea , SpecMap . Sections >> = Promise { resolve, _ ->
102+ val resultMap = mutableMapOf<TestArea , SpecMap . Sections >()
104103 `$`.`when `(
105104 * (testAreasToLoad.asList().associateWith {
106105 `$`.ajax(getFullSectionsMapPath(it), jQueryAjaxSettings { })
107106 .then({ response: Any? , _: Any ->
108- resultMap[it] = SectionsMap (parseJsonText(response.toString()))
107+ resultMap[it] = SpecMap . Sections (parseJsonText(response.toString()))
109108 })
110109 }.values.toTypedArray())
111110 ).then({ _: Any? , _: Any -> resolve(resultMap) }, { resolve(resultMap) })
@@ -136,5 +135,5 @@ interface GithubTestsLoader {
136135
137136 }
138137
139- fun loadTestFiles (sectionName : String , mainSectionName : String , sectionsPath : List <String >, sectionsMapsByTestArea : Map <TestArea , SectionsMap >): Promise <Promise <SpecSection >>
138+ fun loadTestFiles (sectionName : String , mainSectionName : String , sectionsPath : List <String >, sectionsMapsByTestArea : Map <TestArea , SpecMap . Sections >): Promise <Promise <SpecSection >>
140139}
0 commit comments