@TestMetadata("kt4711.kt")
 public void testKt4711() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "compiler/testData/diagnostics/testsWithStdLib/resolve/kt4711.kt");
   doTest(fileName);
 }
 @TestMetadata("branched/ifThenToSafeAccess/inspectionData/inspections.test")
 public void testBranched_ifThenToSafeAccess_inspectionData_Inspections_test() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "idea/testData/intentions/branched/ifThenToSafeAccess/inspectionData/inspections.test");
   doTest(fileName);
 }
 @TestMetadata("removeExplicitTypeArguments/inspectionData/inspections.test")
 public void testRemoveExplicitTypeArguments_inspectionData_Inspections_test() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "idea/testData/intentions/removeExplicitTypeArguments/inspectionData/inspections.test");
   doTest(fileName);
 }
 @TestMetadata("simple")
 public void testSimple() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "plugins/android-idea-plugin/testData/android/goto/simple/");
   doTest(fileName);
 }
 @TestMetadata("spelling/inspectionData/inspections.test")
 public void testSpelling_inspectionData_Inspections_test() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "idea/testData/inspections/spelling/inspectionData/inspections.test");
   doTest(fileName);
 }
 @TestMetadata("failOnErrorByDefault")
 public void testFailOnErrorByDefault() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "compiler/testData/integration/ant/jvm/failOnErrorByDefault/");
   doTest(fileName);
 }
 @TestMetadata("fqNameInTag")
 public void testFqNameInTag() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "plugins/android-idea-plugin/testData/android/goto/fqNameInTag/");
   doTest(fileName);
 }
 public void testAllFilesPresentInDecompiledText() throws Exception {
   JetTestUtils.assertAllTestsPresentByMetadata(
       this.getClass(),
       new File("idea/testData/decompiler/decompiledText"),
       Pattern.compile("^([^\\.]+)$"),
       true);
 }
 @TestMetadata("AnnotationsOnPrimaryCtr")
 public void testAnnotationsOnPrimaryCtr() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "idea/testData/decompiler/decompiledText/AnnotationsOnPrimaryCtr/");
   doTest(fileName);
 }
 @TestMetadata("DependencyOnNestedClasses")
 public void ignoredDependencyOnNestedClasses() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "idea/testData/decompiler/decompiledText/DependencyOnNestedClasses/");
   doTest(fileName);
 }
 @TestMetadata("SecondaryConstructors")
 public void ignoredSecondaryConstructors() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "idea/testData/decompiler/decompiledText/SecondaryConstructors/");
   doTest(fileName);
 }
 @TestMetadata("qualifiedCallValue.kt")
 public void testQualifiedCallValue() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "compiler/testData/diagnostics/testsWithStdLib/annotations/qualifiedCallValue.kt");
   doTest(fileName);
 }
 @TestMetadata("kt5534.kt")
 public void testKt5534() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "compiler/testData/diagnostics/testsWithStdLib/varargs/kt5534.kt");
   doTest(fileName);
 }
 public void testAllFilesPresentInVarargs() throws Exception {
   JetTestUtils.assertAllTestsPresentByMetadata(
       this.getClass(),
       new File("compiler/testData/diagnostics/testsWithStdLib/varargs"),
       Pattern.compile("^(.+)\\.kt$"),
       true);
 }
示例#15
0
 @TestMetadata("additionalArguments")
 public void testAdditionalArguments() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "compiler/testData/integration/ant/jvm/additionalArguments/");
   doTest(fileName);
 }
 @TestMetadata("ClassWithClassObject")
 public void testClassWithClassObject() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "idea/testData/decompiler/decompiledText/ClassWithClassObject/");
   doTest(fileName);
 }
示例#17
0
 public void testAllFilesPresentInJvm() throws Exception {
   JetTestUtils.assertAllTestsPresentByMetadata(
       this.getClass(),
       new File("compiler/testData/integration/ant/jvm"),
       Pattern.compile("^([^\\.]+)$"),
       false);
 }
 public void testAllFilesPresentInJs() throws Exception {
   JetTestUtils.assertAllTestsPresentByMetadata(
       this.getClass(),
       new File("idea/testData/diagnosticMessage/js"),
       Pattern.compile("^(.+)\\.kt$"),
       false);
 }
 public void testAllFilesPresentInGoto() throws Exception {
   JetTestUtils.assertAllTestsPresentByMetadata(
       this.getClass(),
       new File("plugins/android-idea-plugin/testData/android/goto"),
       Pattern.compile("^([^\\.]+)$"),
       false);
 }
 public void testAllFilesPresentInExpressionSelection() throws Exception {
   JetTestUtils.assertAllTestsPresentByMetadata(
       this.getClass(),
       new File("idea/testData/expressionSelection"),
       Pattern.compile("^([^\\.]+)\\.kt$"),
       true);
 }
 @TestMetadata("multiFileFragment")
 public void testMultiFileFragment() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "plugins/android-idea-plugin/testData/android/goto/multiFileFragment/");
   doTest(fileName);
 }
  protected void doTest(String xmlPath) throws IOException {
    File txtFile = new File(FileUtil.getNameWithoutExtension(xmlPath) + ".txt");

    ModuleScriptData result =
        ModuleXmlParser.parseModuleScript(
            xmlPath,
            new MessageCollector() {
              @Override
              public void report(
                  @NotNull CompilerMessageSeverity severity,
                  @NotNull String message,
                  @NotNull CompilerMessageLocation location) {
                throw new AssertionError(
                    MessageRenderer.PLAIN_FULL_PATHS.render(severity, message, location));
              }
            });

    StringBuilder sb = new StringBuilder();
    for (Module module : result.getModules()) {
      sb.append(moduleToString(module)).append("\n");
    }

    String actual = sb.toString();

    if (!txtFile.exists()) {
      FileUtil.writeToFile(txtFile, actual);
      fail("Expected data file does not exist. A new file created: " + txtFile);
    }

    JetTestUtils.assertEqualsToFile(txtFile, actual);
  }
 @TestMetadata("reflectionNotFound/inspectionData/inspections.test")
 public void testReflectionNotFound_inspectionData_Inspections_test() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "idea/testData/inspections/reflectionNotFound/inspectionData/inspections.test");
   doTest(fileName);
 }
示例#24
0
 @TestMetadata("moduleNameWithKotlin")
 public void testModuleNameWithKotlin() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "compiler/testData/integration/ant/jvm/moduleNameWithKotlin/");
   doTest(fileName);
 }
 @TestMetadata("unusedSymbol/typeParameter/inspectionData/inspections.test")
 public void testUnusedSymbol_typeParameter_inspectionData_Inspections_test() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "idea/testData/inspections/unusedSymbol/typeParameter/inspectionData/inspections.test");
   doTest(fileName);
 }
示例#26
0
 @TestMetadata("stdlibForJavacWithNoKotlin")
 public void testStdlibForJavacWithNoKotlin() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "compiler/testData/integration/ant/jvm/stdlibForJavacWithNoKotlin/");
   doTest(fileName);
 }
 @TestMetadata("convertToStringTemplate/inspectionData/inspections.test")
 public void testConvertToStringTemplate_inspectionData_Inspections_test() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "idea/testData/intentions/convertToStringTemplate/inspectionData/inspections.test");
   doTest(fileName);
 }
示例#28
0
 @TestMetadata("withKotlinNoJavaSources")
 public void testWithKotlinNoJavaSources() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "compiler/testData/integration/ant/jvm/withKotlinNoJavaSources/");
   doTest(fileName);
 }
 @TestMetadata("PropertyAsPropertyInitalizerInvalidCode.kt")
 public void testPropertyAsPropertyInitalizerInvalidCode() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "idea/testData/stubs/PropertyAsPropertyInitalizerInvalidCode.kt");
   doTest(fileName);
 }
 @TestMetadata("reifiedNothingSubstitution.kt")
 public void testReifiedNothingSubstitution() throws Exception {
   String fileName =
       JetTestUtils.navigationMetadata(
           "compiler/testData/diagnostics/testsWithStdLib/reified/reifiedNothingSubstitution.kt");
   doTest(fileName);
 }