completion tests should reflect real-life item order
authorpeter <peter@jetbrains.com>
Wed, 1 Feb 2012 19:55:11 +0000 (20:55 +0100)
committerpeter <peter@jetbrains.com>
Wed, 1 Feb 2012 19:56:02 +0000 (20:56 +0100)
java/java-tests/testData/codeInsight/completion/normalSorting/PreselectMostRelevantInTheMiddle.java [deleted file]
java/java-tests/testSrc/com/intellij/codeInsight/completion/JavadocCompletionTest.java
java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionOrderingTest.groovy
java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java
platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java
plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GrCompletionWithLibraryTest.groovy

diff --git a/java/java-tests/testData/codeInsight/completion/normalSorting/PreselectMostRelevantInTheMiddle.java b/java/java-tests/testData/codeInsight/completion/normalSorting/PreselectMostRelevantInTheMiddle.java
deleted file mode 100644 (file)
index e7bd758..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-class Foo {
-  int ELEMENT_A = 1;
-  int ELEMENT_B = 1;
-  int ELEMENT_C = 1;
-  int ELEMENT_D = 1;
-  int ELEMENT_E = 1;
-  int ELEMENT_F = 1;
-  int ELEMENT_G = 1;
-  int ELEMENT_H = 1;
-  int ELEMENT_I = 1;
-
-
-    {
-        El<caret>
-    }
-
-}
\ No newline at end of file
index 7aed97b25e6ca14e0ac35a28095cf853c38b829a..b7fb373b9024d2ba5249487cf840d79edc84e299 100644 (file)
@@ -74,7 +74,7 @@ public class JavadocCompletionTest extends LightFixtureCompletionTestCase {
 
   public void testSee0() throws Exception {
     configureByFile("See0.java");
-    assertStringItems("foo", "clone", "equals", "finalize", "getClass", "hashCode", "notify", "notifyAll", "Object", "registerNatives", "toString", "wait", "wait", "wait");
+    assertStringItems("foo", "clone", "equals", "getClass", "hashCode", "notify", "notifyAll", "Object", "toString", "wait", "wait", "wait", "finalize", "registerNatives");
   }
 
   public void testSee1() throws Exception {
index de77849ddd9befac6e24fe124daba5a131fd16c0..43e49fc42e02cbfe6a6c5b1dae2efcaf2b14a24c 100644 (file)
@@ -233,16 +233,6 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
     checkPreferredItems(0, "FooOCSomething", "FooObjectCollector");
   }
 
-  public void testPreselectMostRelevantInTheMiddle() {
-    myFixture.addClass("package foo; public class Elaaaaaaaaaaaaaaaaaaaa {}");
-    invokeCompletion(getTestName(false) + ".java");
-    myFixture.completeBasic();
-    LookupImpl lookup = getLookup();
-    assertPreferredItems(lookup.getList().getSelectedIndex());
-    assertEquals("Elaaaaaaaaaaaaaaaaaaaa", lookup.getItems().get(0).getLookupString());
-    assertEquals("ELEMENT_A", lookup.getCurrentItem().getLookupString());
-  }
-
   public void testPreferSamePackageOverImported() {
     myFixture.addClass("package bar; public class Bar1 {}");
     myFixture.addClass("package bar; public class Bar2 {}");
index f9b0ffd9eab69eaffca5131de1f9014aef444b44..97e7156fc63df93c149684f1e1087c4a8749f472 100644 (file)
@@ -474,7 +474,7 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
 
   public void testVoidExpectedType() throws Throwable {
     configureByTestName();
-    assertStringItems("notify", "notifyAll", "wait", "wait", "wait", "equals", "getClass", "hashCode", "toString");
+    assertStringItems("notify", "notifyAll", "wait", "wait", "wait", "getClass", "equals", "hashCode", "toString");
     type('e');
     assertEquals("equals", assertOneElement(getLookup().getItems()).getLookupString());
     select();
index 08e6b502c4f2e74208325c71266dabe400477f26..1ee382a684d96e783f2306425a638383225a825b 100644 (file)
@@ -606,7 +606,7 @@ public class LookupImpl extends LightweightHint implements LookupEx, Disposable
   }
 
   public static boolean limitRelevance() {
-    return ApplicationManager.getApplication().isUnitTestMode() || Registry.is("limited.relevance.sorting.in.completion");
+    return Registry.is("limited.relevance.sorting.in.completion");
   }
 
   public boolean isFrozen(@NotNull LookupElement element) {
index 9d2b20d90aaa607c6ce9641d14a8b8a6792a9e4e..fbdb4e312da7ac91e7eea4fed3aa7f75251d6d41 100644 (file)
@@ -152,20 +152,20 @@ fromThis4
 fromThis5
 overridden
 thisProp
-class
-equals
 fromSuper
 fromSuper2
+metaPropertyValues
+properties
+superProp
+class
+equals
 getProperty
 hashCode
 invokeMethod
 metaClass
-metaPropertyValues
 notify
 notifyAll
-properties
 setProperty
-superProp
 toString
 wait
 wait