summaryrefslogtreecommitdiff
path: root/plugins/properties/testSrc/com/intellij/lang/properties/xml/XmlPropertiesTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/properties/testSrc/com/intellij/lang/properties/xml/XmlPropertiesTest.java')
-rw-r--r--plugins/properties/testSrc/com/intellij/lang/properties/xml/XmlPropertiesTest.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/properties/testSrc/com/intellij/lang/properties/xml/XmlPropertiesTest.java b/plugins/properties/testSrc/com/intellij/lang/properties/xml/XmlPropertiesTest.java
index 66bb380d992c..9e1235399b03 100644
--- a/plugins/properties/testSrc/com/intellij/lang/properties/xml/XmlPropertiesTest.java
+++ b/plugins/properties/testSrc/com/intellij/lang/properties/xml/XmlPropertiesTest.java
@@ -5,6 +5,7 @@ import com.intellij.lang.properties.PropertiesImplUtil;
import com.intellij.lang.properties.PropertiesReferenceManager;
import com.intellij.lang.properties.psi.PropertiesFile;
import com.intellij.openapi.application.PluginPathManager;
+import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.psi.PsiFile;
import com.intellij.testFramework.PlatformTestCase;
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
@@ -38,6 +39,22 @@ public class XmlPropertiesTest extends LightPlatformCodeInsightFixtureTestCase {
myFixture.testHighlighting("foo.xml");
}
+ public void testAddProperty() {
+ final PsiFile psiFile = myFixture.configureByFile("foo.xml");
+ final PropertiesFile propertiesFile = PropertiesImplUtil.getPropertiesFile(psiFile);
+ assertNotNull(propertiesFile);
+
+ WriteCommandAction.runWriteCommandAction(getProject(), new Runnable() {
+ public void run() {
+ propertiesFile.addProperty("kkk", "vvv");
+ }
+ });
+
+ final IProperty property = propertiesFile.findPropertyByKey("kkk");
+ assertNotNull(property);
+ assertEquals("vvv", property.getValue());
+ }
+
@Override
protected String getTestDataPath() {
return PluginPathManager.getPluginHomePath("properties") + "/testData/xml/";