@@ -5,9 +5,8 @@ import js.externals.jquery.JQueryXHR
5
5
import js.externals.jquery .`$`
6
6
import kotlinx.serialization.json.Json
7
7
import kotlinx.serialization.json.JsonConfiguration
8
- import org.jetbrains.kotlin.spec.entity.SectionsMap
8
+ import org.jetbrains.kotlin.spec.entity.SpecMap
9
9
import org.jetbrains.kotlin.spec.entity.SpecSection
10
- import org.jetbrains.kotlin.spec.entity.TestMap
11
10
import org.jetbrains.kotlin.spec.entity.test.SpecTest
12
11
import org.jetbrains.kotlin.spec.entity.test.TestPlace
13
12
import org.jetbrains.kotlin.spec.entity.test.parameters.TestInfo
@@ -63,9 +62,9 @@ interface GithubTestsLoader {
63
62
mainSectionName : String ,
64
63
path : String ,
65
64
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 >()
69
68
val loadableTestAreas: MutableSet <TestArea > = mutableSetOf ()
70
69
testAreasToLoad.forEach {
71
70
if (sectionsMapByTestArea.isTestsMapExists(testArea = it, requestedMainSection = mainSectionName, requestedSubsectionPath = path)) {
@@ -76,14 +75,14 @@ interface GithubTestsLoader {
76
75
* (loadableTestAreas.associateWith {
77
76
`$`.ajax(getFullTestMapPath(testType, it, mainSectionName, path), jQueryAjaxSettings { })
78
77
.then({ response: Any? , _: Any ->
79
- resultMap[it] = TestMap (parseJsonText(response.toString()))
78
+ resultMap[it] = SpecMap . Tests (parseJsonText(response.toString()))
80
79
})
81
80
}.values.toTypedArray())
82
81
).then({ _: Any? , _: Any -> resolve(resultMap) }, { resolve(resultMap) })
83
82
}
84
83
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
87
86
subsectionsArray.jsonArray.forEach { jsonElement ->
88
87
if (jsonElement.primitive.content == requestedSubsectionPath)
89
88
return true
@@ -99,13 +98,13 @@ interface GithubTestsLoader {
99
98
}
100
99
101
100
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 >()
104
103
`$`.`when `(
105
104
* (testAreasToLoad.asList().associateWith {
106
105
`$`.ajax(getFullSectionsMapPath(it), jQueryAjaxSettings { })
107
106
.then({ response: Any? , _: Any ->
108
- resultMap[it] = SectionsMap (parseJsonText(response.toString()))
107
+ resultMap[it] = SpecMap . Sections (parseJsonText(response.toString()))
109
108
})
110
109
}.values.toTypedArray())
111
110
).then({ _: Any? , _: Any -> resolve(resultMap) }, { resolve(resultMap) })
@@ -136,5 +135,5 @@ interface GithubTestsLoader {
136
135
137
136
}
138
137
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 >>
140
139
}
0 commit comments