mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
Generated
+16
@@ -0,0 +1,16 @@
|
||||
<component name="libraryTable">
|
||||
<library name="assertJ">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/lib/dev/assertj-core-2.1.0.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/dev/assertj-guava-2.0.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$PROJECT_DIR$/lib/dev/assertj-core-2.1.0-javadoc.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/dev/assertj-guava-2.0.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/lib/dev/assertj-core-2.1.0-sources.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/dev/assertj-guava-2.0.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
Generated
+1
@@ -240,6 +240,7 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/usageView/usageView.iml" filepath="$PROJECT_DIR$/platform/usageView/usageView.iml" group="platform" />
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/util/util.iml" filepath="$PROJECT_DIR$/platform/util/util.iml" group="platform" />
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/util-rt/util-rt.iml" filepath="$PROJECT_DIR$/platform/util-rt/util-rt.iml" group="platform" />
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/util/testSrc/util-tests.iml" filepath="$PROJECT_DIR$/platform/util/testSrc/util-tests.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/vcs-api/vcs-api.iml" filepath="$PROJECT_DIR$/platform/vcs-api/vcs-api.iml" group="platform" />
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/vcs-api/vcs-api-core/vcs-api-core.iml" filepath="$PROJECT_DIR$/platform/vcs-api/vcs-api-core/vcs-api-core.iml" group="platform" />
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/vcs-impl/vcs-impl.iml" filepath="$PROJECT_DIR$/platform/vcs-impl/vcs-impl.iml" group="platform" />
|
||||
|
||||
@@ -44,5 +44,6 @@
|
||||
<orderEntry type="module" module-name="java-decompiler-plugin" scope="TEST" />
|
||||
<orderEntry type="module" module-name="RegExpSupport" scope="TEST" />
|
||||
<orderEntry type="module" module-name="spellchecker" scope="TEST" />
|
||||
<orderEntry type="module" module-name="util-tests" scope="TEST" />
|
||||
</component>
|
||||
</module>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,6 @@
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/testSrc" isTestSource="true" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
@@ -13,9 +12,6 @@
|
||||
<orderEntry type="module" module-name="core-api" />
|
||||
<orderEntry type="module" module-name="platform-api" />
|
||||
<orderEntry type="module" module-name="projectModel-impl" />
|
||||
<orderEntry type="library" scope="TEST" name="junit-hamcrest" level="project" />
|
||||
<orderEntry type="module" module-name="testFramework" scope="TEST" />
|
||||
<orderEntry type="module" module-name="platform-impl" />
|
||||
<orderEntry type="module" module-name="eclipse" scope="TEST" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -21,11 +21,7 @@ import com.intellij.testFramework.fixtures.ModuleFixture
|
||||
import com.intellij.testFramework.runInEdtAndWait
|
||||
import com.intellij.util.Function
|
||||
import com.intellij.util.SmartList
|
||||
import org.hamcrest.CoreMatchers.equalTo
|
||||
import org.hamcrest.CoreMatchers.not
|
||||
import org.hamcrest.MatcherAssert.assertThat
|
||||
import org.hamcrest.collection.IsEmptyCollection.empty
|
||||
import org.hamcrest.io.FileMatchers.anExistingFile
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.rules.ExternalResource
|
||||
@@ -61,8 +57,7 @@ class ModuleStoreRenameTest {
|
||||
override fun before() {
|
||||
module.getMessageBus().connect().subscribe(ProjectTopics.MODULES, object : ModuleAdapter() {
|
||||
override fun modulesRenamed(project: Project, modules: MutableList<Module>, oldNameProvider: Function<Module, String>) {
|
||||
assertThat(modules.size(), equalTo(1))
|
||||
assertThat(modules.get(0), equalTo(module))
|
||||
assertThat(modules).containsOnly(module)
|
||||
oldModuleNames.add(oldNameProvider.`fun`(module))
|
||||
}
|
||||
})
|
||||
@@ -87,13 +82,13 @@ class ModuleStoreRenameTest {
|
||||
runInEdtAndWait { module.saveStore() }
|
||||
val storage = module.stateStore.getStateStorageManager().getStateStorage(StoragePathMacros.MODULE_FILE, RoamingType.PER_USER) as FileBasedStorage
|
||||
val oldFile = storage.getFile()
|
||||
assertThat(oldFile, anExistingFile())
|
||||
assertThat(oldFile).isFile()
|
||||
|
||||
val oldName = module.getName()
|
||||
val newName = "foo"
|
||||
module.change { renameModule(module, newName) }
|
||||
assertRename(newName, oldFile)
|
||||
assertThat(oldModuleNames, equalTo(listOf(oldName)))
|
||||
assertThat(oldModuleNames).containsOnly(oldName)
|
||||
}
|
||||
|
||||
// project view
|
||||
@@ -101,13 +96,13 @@ class ModuleStoreRenameTest {
|
||||
runInEdtAndWait { module.saveStore() }
|
||||
var storage = module.stateStore.getStateStorageManager().getStateStorage(StoragePathMacros.MODULE_FILE, RoamingType.PER_USER) as FileBasedStorage
|
||||
val oldFile = storage.getFile()
|
||||
assertThat(oldFile, anExistingFile())
|
||||
assertThat(oldFile).isFile()
|
||||
|
||||
val oldName = module.getName()
|
||||
val newName = "foo"
|
||||
runInEdtAndWait { runWriteAction { LocalFileSystem.getInstance().refreshAndFindFileByIoFile(oldFile)!!.rename(null, "$newName${ModuleFileType.DOT_DEFAULT_EXTENSION}") } }
|
||||
assertRename(newName, oldFile)
|
||||
assertThat(oldModuleNames, equalTo(listOf(oldName)))
|
||||
assertThat(oldModuleNames).containsOnly(oldName)
|
||||
}
|
||||
|
||||
// we cannot test external rename yet, because it is not supported - ModuleImpl doesn't support delete and create events (in case of external change we don't get move event, but get "delete old" and "create new")
|
||||
@@ -115,13 +110,14 @@ class ModuleStoreRenameTest {
|
||||
private fun assertRename(newName: String, oldFile: File) {
|
||||
val storageManager = moduleFixture.getModule().stateStore.getStateStorageManager()
|
||||
val newFile = (storageManager.getStateStorage(StoragePathMacros.MODULE_FILE, RoamingType.PER_USER) as FileBasedStorage).getFile()
|
||||
assertThat(newFile.getName(), equalTo("$newName${ModuleFileType.DOT_DEFAULT_EXTENSION}"))
|
||||
assertThat(oldFile, not(anExistingFile()))
|
||||
assertThat(oldFile, not(equalTo(newFile)))
|
||||
assertThat(newFile, anExistingFile())
|
||||
assertThat(newFile.getName()).isEqualTo("$newName${ModuleFileType.DOT_DEFAULT_EXTENSION}")
|
||||
assertThat(oldFile)
|
||||
.doesNotExist()
|
||||
.isNotEqualTo(newFile)
|
||||
assertThat(newFile).isFile()
|
||||
|
||||
// ensure that macro value updated
|
||||
assertThat(storageManager.expandMacros(StoragePathMacros.MODULE_FILE), equalTo(newFile.systemIndependentPath))
|
||||
assertThat(storageManager.expandMacros(StoragePathMacros.MODULE_FILE)).isEqualTo(newFile.systemIndependentPath)
|
||||
}
|
||||
|
||||
public Test fun `rename module parent virtual dir`() {
|
||||
@@ -135,9 +131,9 @@ class ModuleStoreRenameTest {
|
||||
|
||||
val newFile = File(parentVirtualDir.getPath(), module.getName() + ModuleFileType.DOT_DEFAULT_EXTENSION)
|
||||
try {
|
||||
assertThat(newFile, anExistingFile())
|
||||
assertThat(newFile).isFile()
|
||||
assertRename(module.getName(), oldFile)
|
||||
assertThat(oldModuleNames, empty())
|
||||
assertThat(oldModuleNames).isEmpty()
|
||||
}
|
||||
finally {
|
||||
runInEdtAndWait { runWriteAction { parentVirtualDir.delete(this) } }
|
||||
|
||||
@@ -13,10 +13,7 @@ import com.intellij.openapi.util.io.parentSystemIndependentPath
|
||||
import com.intellij.openapi.util.io.systemIndependentPath
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.testFramework.*
|
||||
import org.hamcrest.CoreMatchers.equalTo
|
||||
import org.hamcrest.MatcherAssert.assertThat
|
||||
import org.hamcrest.core.StringStartsWith.startsWith
|
||||
import org.hamcrest.io.FileMatchers.anExistingFile
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.junit.ClassRule
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
@@ -56,18 +53,17 @@ import java.io.File
|
||||
|
||||
projectRule.project.runInStoreLoadMode {
|
||||
moduleFile.loadModule().useAndDispose {
|
||||
assertThat(getOptionValue("foo"), equalTo("bar"))
|
||||
assertThat(getOptionValue("foo")).isEqualTo("bar")
|
||||
|
||||
setOption("foo", "not bar")
|
||||
saveStore()
|
||||
}
|
||||
|
||||
moduleFile.loadModule().useAndDispose {
|
||||
assertThat(getOptionValue("foo"), equalTo("not bar"))
|
||||
assertThat(getOptionValue("foo")).isEqualTo("not bar")
|
||||
|
||||
setOption("foo", "not bar")
|
||||
saveStore()
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -79,13 +75,13 @@ import java.io.File
|
||||
moduleFile.createModule().useAndDispose {
|
||||
ModuleRootModificationUtil.addContentRoot(this, moduleFile.parentSystemIndependentPath)
|
||||
saveStore()
|
||||
assertThat(moduleFile, anExistingFile())
|
||||
assertThat(moduleFile.readText(), startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"JAVA_MODULE\" version=\"4\">"))
|
||||
assertThat(moduleFile).isFile()
|
||||
assertThat(moduleFile.readText()).startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"JAVA_MODULE\" version=\"4\">")
|
||||
|
||||
ClasspathStorage.setStorageType(ModuleRootManager.getInstance(this), "eclipse")
|
||||
saveStore()
|
||||
assertThat(moduleFile.readText(), equalTo("""<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module classpath="eclipse" classpath-dir="$MODULE_DIR" type="JAVA_MODULE" version="4" />"""))
|
||||
assertThat(moduleFile).hasContent("""<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module classpath="eclipse" classpath-dir="$MODULE_DIR" type="JAVA_MODULE" version="4" />""")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,10 +28,7 @@ import com.intellij.testFramework.ProjectRule
|
||||
import com.intellij.testFramework.RuleChain
|
||||
import com.intellij.testFramework.TemporaryDirectory
|
||||
import com.intellij.testFramework.runInEdtAndWait
|
||||
import org.hamcrest.CoreMatchers.equalTo
|
||||
import org.hamcrest.MatcherAssert.assertThat
|
||||
import org.hamcrest.core.StringStartsWith.startsWith
|
||||
import org.hamcrest.io.FileMatchers.anExistingFile
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.intellij.lang.annotations.Language
|
||||
import org.junit.ClassRule
|
||||
import org.junit.Rule
|
||||
@@ -115,7 +112,7 @@ class ProjectStoreTest {
|
||||
project.getBaseDir().refresh(false, true)
|
||||
(ProjectManager.getInstance() as StoreAwareProjectManager).flushChangedAlarm()
|
||||
|
||||
assertThat(testComponent.getState(), equalTo(TestState("newValue")))
|
||||
assertThat(testComponent.getState()).isEqualTo(TestState("newValue"))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,16 +125,16 @@ class ProjectStoreTest {
|
||||
private fun test(project: Project): TestComponent {
|
||||
val testComponent = TestComponent()
|
||||
project.stateStore.initComponent(testComponent, true)
|
||||
assertThat(testComponent.getState(), equalTo(TestState("customValue")))
|
||||
assertThat(testComponent.getState()).isEqualTo(TestState("customValue"))
|
||||
|
||||
testComponent.getState()!!.value = "foo"
|
||||
project.saveStore()
|
||||
|
||||
val file = File(project.stateStore.getStateStorageManager().expandMacros(StoragePathMacros.PROJECT_FILE))
|
||||
assertThat(file, anExistingFile())
|
||||
assertThat(file).isFile()
|
||||
// test exact string - xml prolog, line separators, indentation and so on must be exactly the same
|
||||
// todo get rid of default component states here
|
||||
assertThat(file.readText(), startsWith(iprFileContent.replace("customValue", "foo").replace("</project>", "")))
|
||||
assertThat(file.readText()).startsWith(iprFileContent.replace("customValue", "foo").replace("</project>", ""))
|
||||
|
||||
return testComponent
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.intellij.openapi.options.BaseSchemeProcessor
|
||||
import com.intellij.openapi.options.ExternalizableScheme
|
||||
import com.intellij.openapi.options.SchemesManagerFactory
|
||||
import com.intellij.openapi.util.JDOMUtil
|
||||
import com.intellij.openapi.util.io.BufferExposingByteArrayOutputStream
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
import com.intellij.testFramework.PlatformTestUtil
|
||||
@@ -28,20 +27,14 @@ import com.intellij.testFramework.ProjectRule
|
||||
import com.intellij.testFramework.TemporaryDirectory
|
||||
import com.intellij.util.SmartList
|
||||
import com.intellij.util.lang.CompoundRuntimeException
|
||||
import com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters
|
||||
import com.intellij.util.xmlb.XmlSerializer
|
||||
import com.intellij.util.xmlb.annotations.Attribute
|
||||
import com.intellij.util.xmlb.annotations.Tag
|
||||
import com.intellij.util.xmlb.annotations.Transient
|
||||
import com.intellij.util.xmlb.serialize
|
||||
import com.intellij.util.xmlb.toByteArray
|
||||
import gnu.trove.THashMap
|
||||
import org.hamcrest.CoreMatchers.equalTo
|
||||
import org.hamcrest.CoreMatchers.not
|
||||
import org.hamcrest.CoreMatchers.notNullValue
|
||||
import org.hamcrest.CoreMatchers.sameInstance
|
||||
import org.hamcrest.MatcherAssert.assertThat
|
||||
import org.hamcrest.collection.IsMapContaining.hasKey
|
||||
import org.hamcrest.io.FileMatchers.anExistingDirectory
|
||||
import org.hamcrest.io.FileMatchers.anExistingFile
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.jdom.Element
|
||||
import org.junit.ClassRule
|
||||
import org.junit.Rule
|
||||
@@ -90,8 +83,7 @@ class SchemeManagerTest {
|
||||
val manager = createAndLoad("options1")
|
||||
|
||||
val scheme = manager.findSchemeByName("first")
|
||||
assertThat(scheme, notNullValue())
|
||||
assert(scheme != null)
|
||||
assertThat(scheme).isNotNull()
|
||||
scheme!!.setName("renamed")
|
||||
manager.save()
|
||||
|
||||
@@ -102,11 +94,11 @@ class SchemeManagerTest {
|
||||
val manager = createAndLoad("options1")
|
||||
|
||||
val first = manager.findSchemeByName("first")
|
||||
assertThat(first, notNullValue())
|
||||
assertThat(first).isNotNull()
|
||||
assert(first != null)
|
||||
first!!.setName("2")
|
||||
val second = manager.findSchemeByName("second")
|
||||
assertThat(second, notNullValue())
|
||||
assertThat(second).isNotNull()
|
||||
assert(second != null)
|
||||
second!!.setName("1")
|
||||
manager.save()
|
||||
@@ -118,7 +110,7 @@ class SchemeManagerTest {
|
||||
val manager = createAndLoad("options1")
|
||||
|
||||
val firstScheme = manager.findSchemeByName("first")
|
||||
assertThat(firstScheme, notNullValue())
|
||||
assertThat(firstScheme).isNotNull()
|
||||
assert(firstScheme != null)
|
||||
firstScheme!!.setName("first_renamed")
|
||||
manager.save()
|
||||
@@ -137,7 +129,7 @@ class SchemeManagerTest {
|
||||
public Test fun testDeleteAndCreateSchemeWithTheSameName() {
|
||||
val manager = createAndLoad("options1")
|
||||
val firstScheme = manager.findSchemeByName("first")
|
||||
assertThat(firstScheme, notNullValue())
|
||||
assertThat(firstScheme).isNotNull()
|
||||
|
||||
manager.removeScheme(firstScheme!!)
|
||||
manager.addScheme(TestScheme("first"))
|
||||
@@ -150,7 +142,7 @@ class SchemeManagerTest {
|
||||
val scheme = TestScheme("first")
|
||||
manager.addNewScheme(scheme, false)
|
||||
|
||||
assertThat("first2", equalTo(scheme.getName()))
|
||||
assertThat("first2").isEqualTo(scheme.getName())
|
||||
}
|
||||
|
||||
fun TestScheme.save(file: File) {
|
||||
@@ -170,43 +162,42 @@ class SchemeManagerTest {
|
||||
override fun getSchemeExtension() = ".icls"
|
||||
}, RoamingType.PER_USER, null, dir)
|
||||
schemesManager.loadSchemes()
|
||||
assertThat(schemesManager.getAllSchemes(), equalTo(listOf(scheme)))
|
||||
assertThat(schemesManager.getAllSchemes()).containsOnly(scheme)
|
||||
|
||||
assertThat(File(dir, "1.icls"), anExistingFile())
|
||||
assertThat(File(dir, "1.xml"), anExistingFile())
|
||||
assertThat(File(dir, "1.icls")).isFile()
|
||||
assertThat(File(dir, "1.xml")).isFile()
|
||||
|
||||
scheme.data = "newTrue"
|
||||
schemesManager.save()
|
||||
|
||||
assertThat(File(dir, "1.icls"), anExistingFile())
|
||||
assertThat(File(dir, "1.xml"), not(anExistingFile()))
|
||||
assertThat(File(dir, "1.icls")).isFile()
|
||||
assertThat(File(dir, "1.xml")).doesNotExist()
|
||||
}
|
||||
|
||||
public Test fun setSchemes() {
|
||||
val dir = tempDirManager.newDirectory()
|
||||
val schemeManager = createSchemeManager(dir)
|
||||
schemeManager.loadSchemes()
|
||||
assertThat(schemeManager.getAllSchemes().isEmpty(), equalTo(true))
|
||||
assertThat(schemeManager.getAllSchemes()).isEmpty()
|
||||
|
||||
val scheme = TestScheme("s1")
|
||||
schemeManager.setSchemes(listOf(scheme))
|
||||
|
||||
val schemes = schemeManager.getAllSchemes()
|
||||
assertThat(schemes.size(), equalTo(1))
|
||||
assertThat(schemes.get(0), sameInstance(scheme))
|
||||
assertThat(schemes).containsOnly(scheme)
|
||||
|
||||
assertThat(File(dir, "s1.xml"), not(anExistingFile()))
|
||||
assertThat(File(dir, "s1.xml")).doesNotExist()
|
||||
|
||||
scheme.data = "newTrue"
|
||||
schemeManager.save()
|
||||
|
||||
assertThat(File(dir, "s1.xml"), anExistingFile())
|
||||
assertThat(File(dir, "s1.xml")).isFile()
|
||||
|
||||
schemeManager.setSchemes(emptyList())
|
||||
|
||||
schemeManager.save()
|
||||
|
||||
assertThat(dir, not(anExistingFile()))
|
||||
assertThat(dir).doesNotExist()
|
||||
}
|
||||
|
||||
public Test fun `save only if scheme differs from bundled`() {
|
||||
@@ -216,35 +207,31 @@ class SchemeManagerTest {
|
||||
val bundledPath = "/bundledSchemes/default"
|
||||
schemeManager.loadBundledScheme(bundledPath, this, converter)
|
||||
var schemes = schemeManager.getAllSchemes()
|
||||
assertThat(schemes.size(), equalTo(1))
|
||||
val customScheme = TestScheme("default")
|
||||
assertThat(schemes.get(0), equalTo(customScheme))
|
||||
assertThat(schemes).containsOnly(customScheme)
|
||||
|
||||
schemeManager.save()
|
||||
assertThat(dir, not(anExistingFile()))
|
||||
assertThat(dir).doesNotExist()
|
||||
|
||||
schemeManager.save()
|
||||
schemeManager.setSchemes(listOf(customScheme))
|
||||
assertThat(dir, not(anExistingFile()))
|
||||
assertThat(dir).doesNotExist()
|
||||
|
||||
schemes = schemeManager.getAllSchemes()
|
||||
assertThat(schemes.size(), equalTo(1))
|
||||
assertThat(schemes.get(0), sameInstance(customScheme))
|
||||
assertThat(schemes).containsOnly(customScheme)
|
||||
|
||||
customScheme.data = "foo"
|
||||
schemeManager.save()
|
||||
val schemeFile = File(dir, "default.xml")
|
||||
assertThat(schemeFile, anExistingFile())
|
||||
assertThat(File(dir, "default.xml")).isFile()
|
||||
|
||||
schemeManager = createSchemeManager(dir)
|
||||
schemeManager.loadBundledScheme(bundledPath, this, converter)
|
||||
schemeManager.loadSchemes()
|
||||
|
||||
schemes = schemeManager.getAllSchemes()
|
||||
assertThat(schemes.get(0), equalTo(customScheme))
|
||||
assertThat(schemes).containsOnly(customScheme)
|
||||
}
|
||||
|
||||
|
||||
public Test fun `don't remove dir if no schemes but at least one non-hidden file exists`() {
|
||||
val dir = tempDirManager.newDirectory()
|
||||
val schemeManager = createSchemeManager(dir)
|
||||
@@ -255,7 +242,7 @@ class SchemeManagerTest {
|
||||
schemeManager.save()
|
||||
|
||||
val schemeFile = File(dir, "s1.xml")
|
||||
assertThat(schemeFile.exists(), equalTo(true))
|
||||
assertThat(schemeFile).isFile()
|
||||
|
||||
schemeManager.setSchemes(emptyList())
|
||||
|
||||
@@ -263,8 +250,8 @@ class SchemeManagerTest {
|
||||
|
||||
schemeManager.save()
|
||||
|
||||
assertThat(schemeFile.exists(), equalTo(false))
|
||||
assertThat(dir.exists(), equalTo(true))
|
||||
assertThat(schemeFile).doesNotExist()
|
||||
assertThat(dir).isDirectory()
|
||||
}
|
||||
|
||||
public Test fun `remove empty directory only if some file was deleted`() {
|
||||
@@ -272,45 +259,44 @@ class SchemeManagerTest {
|
||||
val schemeManager = createSchemeManager(dir)
|
||||
schemeManager.loadSchemes()
|
||||
|
||||
assertThat(dir.mkdirs(), equalTo(true))
|
||||
assertThat(dir.mkdirs()).isTrue()
|
||||
schemeManager.save()
|
||||
assertThat(dir, anExistingDirectory())
|
||||
assertThat(dir).isDirectory()
|
||||
|
||||
schemeManager.addScheme(TestScheme("test"))
|
||||
schemeManager.save()
|
||||
assertThat(dir, anExistingDirectory())
|
||||
assertThat(dir).isDirectory()
|
||||
|
||||
schemeManager.setSchemes(emptyList())
|
||||
schemeManager.save()
|
||||
assertThat(dir, not(anExistingDirectory()))
|
||||
assertThat(dir).doesNotExist()
|
||||
}
|
||||
|
||||
public Test fun rename() {
|
||||
val dir = tempDirManager.newDirectory()
|
||||
val schemeManager = createSchemeManager(dir)
|
||||
schemeManager.loadSchemes()
|
||||
assertThat(schemeManager.getAllSchemes().isEmpty(), equalTo(true))
|
||||
assertThat(schemeManager.getAllSchemes()).isEmpty()
|
||||
|
||||
val scheme = TestScheme("s1")
|
||||
schemeManager.setSchemes(listOf(scheme))
|
||||
|
||||
val schemes = schemeManager.getAllSchemes()
|
||||
assertThat(schemes.size(), equalTo(1))
|
||||
assertThat(schemes.get(0), sameInstance(scheme))
|
||||
assertThat(schemes).containsOnly(scheme)
|
||||
|
||||
assertThat(File(dir, "s1.xml").exists(), equalTo(false))
|
||||
assertThat(File(dir, "s1.xml")).doesNotExist()
|
||||
|
||||
scheme.data = "newTrue"
|
||||
schemeManager.save()
|
||||
|
||||
assertThat(File(dir, "s1.xml").exists(), equalTo(true))
|
||||
assertThat(File(dir, "s1.xml")).isFile()
|
||||
|
||||
scheme.setName("s2")
|
||||
|
||||
schemeManager.save()
|
||||
|
||||
assertThat(File(dir, "s1.xml").exists(), equalTo(false))
|
||||
assertThat(File(dir, "s2.xml").exists(), equalTo(true))
|
||||
assertThat(File(dir, "s1.xml")).doesNotExist()
|
||||
assertThat(File(dir, "s2.xml")).isFile()
|
||||
}
|
||||
|
||||
public Test fun `path must not contains ROOT_CONFIG macro`() {
|
||||
@@ -369,13 +355,13 @@ private fun checkSchemes(baseDir: File, expected: String, ignoreDeleted: Boolean
|
||||
for (file in files) {
|
||||
val fileName = FileUtil.getNameWithoutExtension(file)
|
||||
if ("--deleted" == fileName && ignoreDeleted) {
|
||||
assertThat<Map<String, String>>(fileToSchemeMap, hasKey(fileName))
|
||||
assertThat(fileToSchemeMap).containsKey(fileName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (file in fileToSchemeMap.keySet()) {
|
||||
assertThat(File(baseDir, "$file.xml").isFile(), equalTo(true))
|
||||
assertThat(File(baseDir, "$file.xml")).isFile()
|
||||
}
|
||||
|
||||
if (files != null) {
|
||||
@@ -383,12 +369,13 @@ private fun checkSchemes(baseDir: File, expected: String, ignoreDeleted: Boolean
|
||||
for (file in files) {
|
||||
val fileName = FileUtil.getNameWithoutExtension(file)
|
||||
val scheme = schemesProcessor.readScheme(JDOMUtil.load(file), true)
|
||||
assertThat(fileToSchemeMap.get(fileName), equalTo(scheme!!.getName()))
|
||||
assertThat(fileToSchemeMap.get(fileName)).isEqualTo(scheme!!.getName())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public data Tag("scheme") class TestScheme(Attribute private var name: String = "", Attribute var data: String? = null) : ExternalizableScheme {
|
||||
Tag("scheme")
|
||||
public data class TestScheme(@Attribute private var name: String = "", @Attribute public var data: String? = null) : ExternalizableScheme {
|
||||
override fun getName() = name
|
||||
|
||||
override Transient fun setName(newName: String) {
|
||||
@@ -409,12 +396,4 @@ fun SchemeManagerImpl<*, *>.save() {
|
||||
val errors = SmartList<Throwable>()
|
||||
save(errors)
|
||||
CompoundRuntimeException.doThrow(errors)
|
||||
}
|
||||
|
||||
public fun <T : Any> T.serialize(): Element = XmlSerializer.serialize(this, SkipDefaultValuesSerializationFilters())
|
||||
|
||||
public fun Element.toByteArray(): ByteArray {
|
||||
val out = BufferExposingByteArrayOutputStream(512)
|
||||
JDOMUtil.writeParent(this, out, "\n")
|
||||
return out.toByteArray()
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="true" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
||||
<orderEntry type="module" module-name="util" />
|
||||
<orderEntry type="module" module-name="core-api" />
|
||||
<orderEntry type="module" module-name="platform-api" />
|
||||
<orderEntry type="module" module-name="projectModel-impl" />
|
||||
<orderEntry type="library" scope="TEST" name="assertJ" level="project" />
|
||||
<orderEntry type="module" module-name="testFramework" scope="TEST" />
|
||||
<orderEntry type="module" module-name="platform-impl" />
|
||||
<orderEntry type="module" module-name="eclipse" scope="TEST" />
|
||||
<orderEntry type="module" module-name="configuration-store-impl" />
|
||||
<orderEntry type="module" module-name="util-tests" scope="TEST" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.ui;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author traff
|
||||
*/
|
||||
public abstract class AbstractCollectionComboBoxModel<T> extends CollectionListModel<T> implements ComboBoxModel {
|
||||
protected T mySelection;
|
||||
|
||||
public AbstractCollectionComboBoxModel(@Nullable T selection) {
|
||||
mySelection = selection;
|
||||
}
|
||||
|
||||
public AbstractCollectionComboBoxModel(@Nullable T selection, @NotNull Collection<T> items) {
|
||||
super(items);
|
||||
|
||||
mySelection = selection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelectedItem(@Nullable Object item) {
|
||||
if (mySelection != item) {
|
||||
//noinspection unchecked
|
||||
mySelection = (T)item;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Object getSelectedItem() {
|
||||
return mySelection;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public T getSelected() {
|
||||
return mySelection;
|
||||
}
|
||||
|
||||
public void update() {
|
||||
super.fireContentsChanged(this, -1, -1);
|
||||
}
|
||||
|
||||
public boolean contains(T item) {
|
||||
return getElementIndex(item) != -1;
|
||||
}
|
||||
}
|
||||
@@ -15,24 +15,60 @@
|
||||
*/
|
||||
package com.intellij.ui;
|
||||
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
* @author traff
|
||||
*/
|
||||
public class CollectionComboBoxModel<T> extends AbstractCollectionComboBoxModel<T> {
|
||||
public CollectionComboBoxModel(@NotNull List<T> items, @Nullable T selection) {
|
||||
super(selection, items);
|
||||
public class CollectionComboBoxModel<T> extends CollectionListModel<T> implements ComboBoxModel {
|
||||
protected T mySelection;
|
||||
|
||||
public CollectionComboBoxModel() {
|
||||
super();
|
||||
|
||||
mySelection = null;
|
||||
}
|
||||
|
||||
public CollectionComboBoxModel(@NotNull List<T> items) {
|
||||
super(items.isEmpty() ? null : items.get(0), items);
|
||||
this(items, ContainerUtil.getFirstItem(items));
|
||||
}
|
||||
|
||||
public CollectionComboBoxModel() {
|
||||
super(null);
|
||||
public CollectionComboBoxModel(@NotNull List<T> items, @Nullable T selection) {
|
||||
super(items, true);
|
||||
|
||||
mySelection = selection;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelectedItem(@Nullable Object item) {
|
||||
if (mySelection != item) {
|
||||
//noinspection unchecked
|
||||
mySelection = (T)item;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Object getSelectedItem() {
|
||||
return mySelection;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public T getSelected() {
|
||||
return mySelection;
|
||||
}
|
||||
|
||||
public void update() {
|
||||
super.fireContentsChanged(this, -1, -1);
|
||||
}
|
||||
|
||||
public boolean contains(T item) {
|
||||
return getElementIndex(item) != -1;
|
||||
}
|
||||
}
|
||||
@@ -35,8 +35,13 @@ public class CollectionListModel<T> extends AbstractListModel implements Editabl
|
||||
myItems = new ArrayList<T>(items);
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnusedParameters")
|
||||
protected CollectionListModel(@NotNull List<T> items, boolean useListAsIs) {
|
||||
myItems = items;
|
||||
}
|
||||
|
||||
public CollectionListModel(@NotNull final List<? extends T> items) {
|
||||
this((Collection<? extends T>)items);
|
||||
myItems = new ArrayList<T>(items);
|
||||
}
|
||||
|
||||
public CollectionListModel(final T... items) {
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.intellij.ui;
|
||||
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -24,17 +23,17 @@ import java.util.List;
|
||||
/**
|
||||
* @author traff
|
||||
*/
|
||||
public class MutableCollectionComboBoxModel<T> extends AbstractCollectionComboBoxModel<T> {
|
||||
public class MutableCollectionComboBoxModel<T> extends CollectionComboBoxModel<T> {
|
||||
public MutableCollectionComboBoxModel(@NotNull List<T> items) {
|
||||
this(items, ContainerUtil.getFirstItem(items));
|
||||
super(items);
|
||||
}
|
||||
|
||||
public MutableCollectionComboBoxModel() {
|
||||
super(null);
|
||||
super();
|
||||
}
|
||||
|
||||
public MutableCollectionComboBoxModel(@NotNull List<T> items, @Nullable T selection) {
|
||||
super(selection, items);
|
||||
super(items, selection);
|
||||
}
|
||||
|
||||
public void update(@NotNull List<T> items) {
|
||||
|
||||
@@ -26,5 +26,6 @@
|
||||
<orderEntry type="module" module-name="jps-model-impl" scope="TEST" />
|
||||
<orderEntry type="library" name="gson" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="KotlinJavaRuntime" level="project" />
|
||||
<orderEntry type="module" module-name="util-tests" scope="TEST" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -49,8 +49,7 @@ public class TemporaryDirectory : ExternalResource() {
|
||||
*/
|
||||
public fun newDirectory(directoryName: String? = null): File {
|
||||
val file = generatePath(directoryName)
|
||||
val fs = LocalFileSystem.getInstance()
|
||||
if (fs != null) {
|
||||
LocalFileSystem.getInstance()?.let { fs ->
|
||||
// If a temp directory is reused from some previous test run, there might be cached children in its VFS. Ensure they're removed.
|
||||
val virtualFile = fs.findFileByIoFile(file)
|
||||
if (virtualFile != null) {
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import sun.reflect.ConstructorAccessor;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.*;
|
||||
import java.util.*;
|
||||
|
||||
@@ -483,6 +484,23 @@ public class ReflectionUtil {
|
||||
return constructor.newInstance();
|
||||
}
|
||||
catch (Exception e) {
|
||||
// support Kotlin data classes - pass null as default value
|
||||
for (Annotation annotation : aClass.getAnnotations()) {
|
||||
if (annotation.annotationType().getName().equals("kotlin.jvm.internal.KotlinClass")) {
|
||||
Constructor<?>[] constructors = aClass.getDeclaredConstructors();
|
||||
if (constructors.length > 0) {
|
||||
try {
|
||||
Constructor<?> constructor = constructors[0];
|
||||
//noinspection unchecked
|
||||
return (T)constructor.newInstance(new Object[constructor.getParameterTypes().length]);
|
||||
}
|
||||
catch (Exception e1) {
|
||||
throw new RuntimeException(e1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.intellij.util.ThreeState;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.ContainerUtilRt;
|
||||
import com.intellij.util.containers.MultiMap;
|
||||
import com.intellij.util.xmlb.annotations.AbstractCollection;
|
||||
import com.intellij.util.xmlb.annotations.*;
|
||||
import gnu.trove.TObjectFloatHashMap;
|
||||
import org.jdom.Comment;
|
||||
@@ -263,17 +264,41 @@ class BeanBinding extends Binding implements MainBinding {
|
||||
|
||||
accessors = ContainerUtil.newArrayList();
|
||||
|
||||
Map<String, Couple<Method>> nameToAccessors;
|
||||
if (aClass != Rectangle.class) { // special case for Rectangle.class to avoid infinite recursion during serialization due to bounds() method
|
||||
collectPropertyAccessors(aClass, accessors);
|
||||
nameToAccessors = collectPropertyAccessors(aClass, accessors);
|
||||
}
|
||||
else {
|
||||
nameToAccessors = Collections.emptyMap();
|
||||
}
|
||||
|
||||
int propertyAccessorCount = accessors.size();
|
||||
collectFieldAccessors(aClass, accessors);
|
||||
|
||||
// if there are field accessor and property accessor, prefer field - Kotlin generates private var and getter/setter, but annotation moved to var, not to getter/setter
|
||||
// so, we must remove duplicated accessor
|
||||
for (int j = propertyAccessorCount; j < accessors.size(); j++) {
|
||||
String name = accessors.get(j).getName();
|
||||
if (nameToAccessors.containsKey(name)) {
|
||||
for (int i = 0; i < propertyAccessorCount; i++) {
|
||||
if (accessors.get(i).getName().equals(name)) {
|
||||
accessors.remove(i);
|
||||
propertyAccessorCount--;
|
||||
//noinspection AssignmentToForLoopParameter
|
||||
j--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ourAccessorCache.put(aClass, accessors);
|
||||
|
||||
return accessors;
|
||||
}
|
||||
|
||||
private static void collectPropertyAccessors(@NotNull Class<?> aClass, @NotNull List<MutableAccessor> accessors) {
|
||||
@NotNull
|
||||
private static Map<String, Couple<Method>> collectPropertyAccessors(@NotNull Class<?> aClass, @NotNull List<MutableAccessor> accessors) {
|
||||
final Map<String, Couple<Method>> candidates = ContainerUtilRt.newTreeMap(); // (name,(getter,setter))
|
||||
for (Method method : aClass.getMethods()) {
|
||||
if (!Modifier.isPublic(method.getModifiers())) {
|
||||
@@ -296,7 +321,8 @@ class BeanBinding extends Binding implements MainBinding {
|
||||
candidate = Couple.of(propertyData.second ? candidate.first : method, propertyData.second ? method : candidate.second);
|
||||
candidates.put(propertyData.first, candidate);
|
||||
}
|
||||
for (Map.Entry<String, Couple<Method>> candidate: candidates.entrySet()) {
|
||||
for (Iterator<Map.Entry<String, Couple<Method>>> iterator = candidates.entrySet().iterator(); iterator.hasNext(); ) {
|
||||
Map.Entry<String, Couple<Method>> candidate = iterator.next();
|
||||
Couple<Method> methods = candidate.getValue(); // (getter,setter)
|
||||
if (methods.first != null && methods.second != null &&
|
||||
methods.first.getReturnType().equals(methods.second.getParameterTypes()[0]) &&
|
||||
@@ -304,7 +330,11 @@ class BeanBinding extends Binding implements MainBinding {
|
||||
methods.second.getAnnotation(Transient.class) == null) {
|
||||
accessors.add(new PropertyAccessor(candidate.getKey(), methods.first.getReturnType(), methods.first, methods.second));
|
||||
}
|
||||
else {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
return candidates;
|
||||
}
|
||||
|
||||
private static void collectFieldAccessors(@NotNull Class<?> aClass, @NotNull List<MutableAccessor> accessors) {
|
||||
@@ -320,6 +350,8 @@ class BeanBinding extends Binding implements MainBinding {
|
||||
field.getAnnotation(Property.class) != null ||
|
||||
field.getAnnotation(Text.class) != null ||
|
||||
field.getAnnotation(CollectionBean.class) != null ||
|
||||
field.getAnnotation(MapAnnotation.class) != null ||
|
||||
field.getAnnotation(AbstractCollection.class) != null ||
|
||||
(Modifier.isPublic(modifiers) &&
|
||||
// we don't want to allow final fields of all types, but only supported
|
||||
(!Modifier.isFinal(modifiers) || Collection.class.isAssignableFrom(field.getType())) &&
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.lang.ref.SoftReference;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Type;
|
||||
import java.lang.reflect.TypeVariable;
|
||||
import java.lang.reflect.WildcardType;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -88,6 +89,9 @@ class XmlSerializerImpl {
|
||||
Type bound = ((TypeVariable)type).getBounds()[0];
|
||||
return bound instanceof Class ? (Class)bound : (Class<?>)((ParameterizedType)bound).getRawType();
|
||||
}
|
||||
else if (type instanceof WildcardType) {
|
||||
return (Class<?>)((WildcardType) type).getUpperBounds()[0];
|
||||
}
|
||||
else {
|
||||
return (Class<?>)((ParameterizedType)type).getRawType();
|
||||
}
|
||||
@@ -292,13 +296,22 @@ class XmlSerializerImpl {
|
||||
@NotNull
|
||||
static String getTextValue(@NotNull Element element, @NotNull String defaultText) {
|
||||
List<Content> content = element.getContent();
|
||||
String value = defaultText;
|
||||
if (!content.isEmpty()) {
|
||||
Content child = content.get(0);
|
||||
int size = content.size();
|
||||
StringBuilder builder = null;
|
||||
for (int i = 0; i < size; i++) {
|
||||
Content child = content.get(i);
|
||||
if (child instanceof Text) {
|
||||
value = child.getValue();
|
||||
String value = child.getValue();
|
||||
if (builder == null && i == (size - 1)) {
|
||||
return value;
|
||||
}
|
||||
|
||||
if (builder == null) {
|
||||
builder = new StringBuilder();
|
||||
}
|
||||
builder.append(value);
|
||||
}
|
||||
}
|
||||
return value;
|
||||
return builder == null ? defaultText : builder.toString();
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="true" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="TEST" name="Groovy" level="project" />
|
||||
<orderEntry type="module" module-name="util" scope="TEST" />
|
||||
<orderEntry type="library" scope="TEST" name="JDOM" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="KotlinJavaRuntime" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="assertJ" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="JUnit4" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="picocontainer" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="jna" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -4,7 +4,6 @@
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/testSrc" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
|
||||
</content>
|
||||
<orderEntry type="library" scope="PROVIDED" name="Mac" level="project" />
|
||||
@@ -19,8 +18,6 @@
|
||||
<orderEntry type="module" module-name="util-rt" exported="" />
|
||||
<orderEntry type="library" name="jna" level="project" />
|
||||
<orderEntry type="library" name="OroMatcher" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="JUnit4" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Groovy" level="project" />
|
||||
<orderEntry type="library" exported="" name="ForkJoin" level="project" />
|
||||
<orderEntry type="library" exported="" name="Snappy-Java" level="project" />
|
||||
<orderEntry type="library" name="imgscalr" level="project" />
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
<orderEntry type="module" module-name="external-system-impl" />
|
||||
<orderEntry type="library" name="Slf4j" level="project" />
|
||||
<orderEntry type="library" name="Log4J" level="project" />
|
||||
<orderEntry type="module" module-name="util-tests" scope="TEST" />
|
||||
</component>
|
||||
<component name="copyright">
|
||||
<Base>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module relativePaths="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$/testSrc">
|
||||
<sourceFolder url="file://$MODULE_DIR$/testSrc" isTestSource="true" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="platform-api" />
|
||||
<orderEntry type="module" module-name="platform-impl" />
|
||||
<orderEntry type="module" module-name="vcs-impl" />
|
||||
<orderEntry type="module" module-name="projectModel-impl" />
|
||||
<orderEntry type="module" module-name="testFramework" scope="TEST" />
|
||||
<orderEntry type="library" name="JSch" level="project" />
|
||||
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
||||
<orderEntry type="library" name="jna" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Log4J" level="project" />
|
||||
<orderEntry type="library" name="Slf4j" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="JUnit4" level="project" />
|
||||
<orderEntry type="module" module-name="configuration-store-impl" />
|
||||
<orderEntry type="module" module-name="configuration-store-tests" scope="TEST" />
|
||||
<orderEntry type="module" module-name="util-tests" scope="TEST" />
|
||||
<orderEntry type="module" module-name="settings-repository" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -4,14 +4,13 @@
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/resources" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/testSrc" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="platform-api" />
|
||||
<orderEntry type="module" module-name="platform-impl" />
|
||||
<orderEntry type="module-library">
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library name="jgit">
|
||||
<ANNOTATIONS>
|
||||
<root url="file://$MODULE_DIR$/lib" />
|
||||
@@ -27,10 +26,6 @@
|
||||
</orderEntry>
|
||||
<orderEntry type="module" module-name="vcs-impl" />
|
||||
<orderEntry type="module" module-name="projectModel-impl" />
|
||||
<orderEntry type="module" module-name="platform-resources" scope="TEST" />
|
||||
<orderEntry type="module" module-name="platform-resources-en" scope="TEST" />
|
||||
<orderEntry type="module" module-name="testFramework" scope="TEST" />
|
||||
<orderEntry type="module" module-name="bootstrap" scope="TEST" />
|
||||
<orderEntry type="library" name="JSch" level="project" />
|
||||
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
||||
<orderEntry type="library" name="jna" level="project" />
|
||||
@@ -54,7 +49,6 @@
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="Slf4j" level="project" />
|
||||
<orderEntry type="library" name="JUnit4" level="project" />
|
||||
<orderEntry type="module" module-name="configuration-store-impl" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -15,8 +15,12 @@
|
||||
*/
|
||||
package org.jetbrains.settingsRepository.test
|
||||
|
||||
import com.intellij.configurationStore.*
|
||||
import com.intellij.configurationStore.SchemeManagerImpl
|
||||
import com.intellij.configurationStore.TestScheme
|
||||
import com.intellij.configurationStore.TestSchemesProcessor
|
||||
import com.intellij.openapi.components.RoamingType
|
||||
import com.intellij.util.xmlb.serialize
|
||||
import com.intellij.util.xmlb.toByteArray
|
||||
import org.eclipse.jgit.lib.Repository
|
||||
import org.hamcrest.CoreMatchers.equalTo
|
||||
import org.jetbrains.settingsRepository.ReadonlySource
|
||||
|
||||
Reference in New Issue
Block a user