diff --git a/platform/configuration-store-impl/testSrc/DirectoryBasedStorageTest.kt b/platform/configuration-store-impl/testSrc/DirectoryBasedStorageTest.kt index 27663ecbc040..75d15662fe08 100644 --- a/platform/configuration-store-impl/testSrc/DirectoryBasedStorageTest.kt +++ b/platform/configuration-store-impl/testSrc/DirectoryBasedStorageTest.kt @@ -40,7 +40,7 @@ private fun StateStorage.ExternalizationSession.save() { private fun StateStorageBase<*>.setStateAndSave(componentName: String, state: String?) { var externalizationSession = startExternalization()!! - externalizationSession.setState(null, componentName, if (state == null) Element("state") else JDOMUtil.load(state.reader)) + externalizationSession.setState(null, componentName, if (state == null) Element("state") else JDOMUtil.load(state.reader())) externalizationSession.save() } diff --git a/platform/configuration-store-impl/testSrc/ProjectStoreTest.kt b/platform/configuration-store-impl/testSrc/ProjectStoreTest.kt index 1e66ba93b924..8eab00a7b829 100644 --- a/platform/configuration-store-impl/testSrc/ProjectStoreTest.kt +++ b/platform/configuration-store-impl/testSrc/ProjectStoreTest.kt @@ -25,6 +25,7 @@ import com.intellij.openapi.project.impl.ProjectManagerImpl import com.intellij.openapi.util.io.systemIndependentPath import com.intellij.openapi.vfs.VirtualFile import com.intellij.testFramework.* +import com.intellij.util.PathUtil import org.assertj.core.api.Assertions.assertThat import org.intellij.lang.annotations.Language import org.junit.ClassRule @@ -64,7 +65,7 @@ private fun createOrLoadProject(tempDirManager: TemporaryDirectory, task: (Proje } } -class ProjectStoreTest { +internal class ProjectStoreTest { companion object { @ClassRule val projectRule = ProjectRule() } @@ -76,12 +77,7 @@ class ProjectStoreTest { @Language("XML") private val iprFileContent = - "\n" + - "\n" + - " \n" + - " \n" + - "" + "\n\n \n \n" @State(name = "AATestComponent", storages = arrayOf(Storage(file = StoragePathMacros.PROJECT_FILE))) private class TestComponent : PersistentStateComponent { @@ -103,6 +99,8 @@ class ProjectStoreTest { }) { project -> val testComponent = test(project) + assertThat(project.basePath).isEqualTo(PathUtil.getParentPath((PathUtil.getParentPath(project.projectFilePath!!)))) + // test reload on external change val file = File(project.stateStore.stateStorageManager.expandMacros(StoragePathMacros.PROJECT_FILE)) file.writeText(file.readText().replace("""