completion tests should reflect real-life item order

This commit is contained in:
peter
2012-02-01 20:56:02 +01:00
parent 76bde18206
commit 5eb09ef3fa
6 changed files with 8 additions and 35 deletions
@@ -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>
}
}
@@ -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 {
@@ -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 {}");
@@ -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();