KT-1051 Java interoperability completion - more tests
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
public class Testing {
|
||||||
|
public static void test() {
|
||||||
|
jettesting.some.<caret>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXIST: ClassFromJet
|
||||||
|
// EXIST: namespace
|
||||||
|
// NUMBER: 2
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package jettesting.some
|
||||||
|
|
||||||
|
class ClassFromJet {
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
public class Testing {
|
|
||||||
public static void test() {
|
|
||||||
jett<caret>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// EXIST: jettesting
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
package jettesting
|
|
||||||
|
|
||||||
class ClassFromJet {
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
public class Testing implements TraitFr<caret> {
|
||||||
|
public static void test() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXIST: TraitFromJet
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package jettesting.traits
|
||||||
|
|
||||||
|
trait TraitFromJet {
|
||||||
|
}
|
||||||
@@ -17,23 +17,27 @@ public abstract class JetCompletionMultiTestBase extends CompletionTestCase {
|
|||||||
* @param completionLevel {@see CompletionParameters.getInvocationCount()} javadoc
|
* @param completionLevel {@see CompletionParameters.getInvocationCount()} javadoc
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
protected void doFileTest(int completionLevel) throws Exception {
|
protected void doFileTest(int completionLevel) {
|
||||||
configureByFiles(null, getFileNameList());
|
try {
|
||||||
complete(completionLevel);
|
configureByFiles(null, getFileNameList());
|
||||||
|
complete(completionLevel);
|
||||||
|
|
||||||
final String fileText = getFile().getText();
|
final String fileText = getFile().getText();
|
||||||
final ExpectedCompletionUtils completionUtils = new ExpectedCompletionUtils();
|
final ExpectedCompletionUtils completionUtils = new ExpectedCompletionUtils();
|
||||||
|
|
||||||
assertContainsItems(completionUtils.itemsShouldExist(fileText));
|
assertContainsItems(completionUtils.itemsShouldExist(fileText));
|
||||||
assertNotContainItems(completionUtils.itemsShouldAbsent(fileText));
|
assertNotContainItems(completionUtils.itemsShouldAbsent(fileText));
|
||||||
|
|
||||||
Integer itemsNumber = completionUtils.getExpectedNumber(fileText);
|
Integer itemsNumber = completionUtils.getExpectedNumber(fileText);
|
||||||
if (itemsNumber != null) {
|
if (itemsNumber != null) {
|
||||||
assertEquals(itemsNumber.intValue(), myItems.length);
|
assertEquals(itemsNumber.intValue(), myItems.length);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new AssertionError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doFileTest() throws Exception {
|
protected void doFileTest() {
|
||||||
doFileTest(1);
|
doFileTest(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,16 +7,23 @@ import org.jetbrains.jet.plugin.PluginTestCaseBase;
|
|||||||
*/
|
*/
|
||||||
public class JetInJavaCompletionTest extends JetCompletionMultiTestBase {
|
public class JetInJavaCompletionTest extends JetCompletionMultiTestBase {
|
||||||
|
|
||||||
public void testJetClassInJava() throws Exception {
|
public void testJetClassInJava() {
|
||||||
doFileTest();
|
doFileTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testJetSubpackage() throws Exception {
|
public void testJetSubpackage() {
|
||||||
doFileTest();
|
doFileTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: fix and uncomment
|
public void testClassFromNamespace() {
|
||||||
public void skiptestTopLevelPackages() throws Exception {
|
doFileTest();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testJetFunction() {
|
||||||
|
doFileTest();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testTraitInJava() {
|
||||||
doFileTest();
|
doFileTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user