From e50721e044ec9fd34246a9f147d67a5f7e872a21 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 15 Sep 2014 16:48:23 +0400 Subject: [PATCH 01/19] exception --- .../intellij/openapi/progress/util/ProgressIndicatorTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/progress/util/ProgressIndicatorTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/progress/util/ProgressIndicatorTest.java index a93b3eef8376..4014541202fb 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/progress/util/ProgressIndicatorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/progress/util/ProgressIndicatorTest.java @@ -49,7 +49,7 @@ public class ProgressIndicatorTest extends LightPlatformTestCase { fail("Please restore ProgressIndicatorBase.checkCanceled() check!"); } catch(ProcessCanceledException ex) { - assertTrue("Should have no stackframe", ex.getStackTrace().length == 0); + assertTrue("Should have no stackframe", ApplicationManager.getApplication().isInternal() ? ex.getStackTrace().length != 0 : ex.getStackTrace().length == 0); } } @@ -288,7 +288,6 @@ public class ProgressIndicatorTest extends LightPlatformTestCase { @Override public void initStateFrom(@NotNull ProgressIndicator indicator) { - throw new RuntimeException(); } @NotNull From 759f26454a25f88b351d7387bcb4efbb87c8f8a3 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 15 Sep 2014 18:23:32 +0400 Subject: [PATCH 02/19] removed HashMap inherent ambiguity --- .../intellij/util/xmlb/XmlSerializerTest.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.java b/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.java index 8d0576c12405..71e785195eb8 100644 --- a/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.java +++ b/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.java @@ -19,7 +19,6 @@ package com.intellij.util.xmlb; import com.intellij.openapi.util.JDOMUtil; import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.text.StringUtil; -import com.intellij.util.containers.ContainerUtil; import com.intellij.util.xmlb.annotations.*; import junit.framework.AssertionFailedError; import junit.framework.TestCase; @@ -254,7 +253,7 @@ public class XmlSerializerTest extends TestCase { } public static class BeanWithMap { - public Map VALUES = new HashMap(); + public Map VALUES = new LinkedHashMap(); { VALUES.put("a", "1"); @@ -302,7 +301,7 @@ public class XmlSerializerTest extends TestCase { keyAttributeName = "name", valueAttributeName = "value" ) - public Map VALUES = new HashMap(); + public Map VALUES = new LinkedHashMap(); { VALUES.put("a", "1"); @@ -336,7 +335,7 @@ public class XmlSerializerTest extends TestCase { public static class BeanWithMapWithBeanValue { - public Map VALUES = new HashMap(); + public Map VALUES = new LinkedHashMap(); } public void testMapWithBeanValue() { @@ -519,7 +518,7 @@ public class XmlSerializerTest extends TestCase { Element element = serialize(bean, null); - Element node = (Element)element.getChildren().get(0); + Element node = element.getChildren().get(0); element.removeContent(node); element.addContent(node); @@ -1007,15 +1006,15 @@ public class XmlSerializerTest extends TestCase { } public static class BeanWithSetKeysInMap { - public Map, String> myMap = new HashMap, String>(); + public Map, String> myMap = new LinkedHashMap, String>(); } public void testSetKeysInMap() { final BeanWithSetKeysInMap bean = new BeanWithSetKeysInMap(); - bean.myMap.put(new HashSet(Arrays.asList("1", "2", "3")), "numbers"); - bean.myMap.put(new HashSet(Arrays.asList("a", "b", "c")), "letters"); + bean.myMap.put(new LinkedHashSet(Arrays.asList("a", "b", "c")), "letters"); + bean.myMap.put(new LinkedHashSet(Arrays.asList("1", "2", "3")), "numbers"); - BeanWithSetKeysInMap bb = (BeanWithSetKeysInMap)doSerializerTest( + BeanWithSetKeysInMap bb = doSerializerTest( "\n" + "