Fix serialization of facet settings in order to read properly

settings of native platforms
This commit is contained in:
Andrey Uskov
2019-06-28 13:05:48 +03:00
parent 404ce1a8c1
commit 9fc60be9d8
5 changed files with 78 additions and 1 deletions
@@ -96,6 +96,16 @@ open class ConfigureKotlinInTempDirTest : AbstractConfigureKotlinInTempDirTest()
Assert.assertEquals(moduleFileContentBefore, moduleFileContentAfter)
}
fun testLoadAndSaveOldNativeFacet() {
val moduleFileContentBefore = String(module.moduleFile!!.contentsToByteArray())
val application = ApplicationManager.getApplication() as ApplicationImpl
application.isSaveAllowed = true
application.saveAll()
val moduleFileContentAfter = String(module.moduleFile!!.contentsToByteArray())
Assert.assertEquals(moduleFileContentBefore.replace("platform=\"Native \"", "platform=\"Native \" allPlatforms=\"Native []\""), moduleFileContentAfter)
}
//TODO(auskov): test parsing common target platform with multiple versions of java, add parsing common platforms
fun testLoadAndSaveProjectWithV2OldPlatformFacetConfig() {
val moduleFileContentBefore = String(module.moduleFile!!.contentsToByteArray())