IDEA-132440 (tests updated)
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>
Thu, 6 Nov 2014 15:36:28 +0000 (16:36 +0100)
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>
Thu, 6 Nov 2014 15:36:28 +0000 (16:36 +0100)
java/java-tests/testData/inspection/defaultFileTemplateUsage/X.java [moved from java/java-tests/testData/inspection/defaultFileTemplateUsage/defaultFile/src/x/X.java with 95% similarity]
java/java-tests/testData/inspection/defaultFileTemplateUsage/X2.java [moved from java/java-tests/testData/inspection/defaultFileTemplateUsage/defaultFile/src/x/X2.java with 60% similarity]
java/java-tests/testData/inspection/defaultFileTemplateUsage/X3.java [moved from java/java-tests/testData/inspection/defaultFileTemplateUsage/defaultFile/src/x/X3.java with 87% similarity]
java/java-tests/testData/inspection/defaultFileTemplateUsage/defaultFile/expected.xml [deleted file]
java/java-tests/testSrc/com/intellij/codeInspection/DefaultFileTemplateInspectionTest.java [deleted file]
java/java-tests/testSrc/com/intellij/codeInspection/DefaultFileTemplateUsageInspectionTest.java [new file with mode: 0644]

similarity index 95%
rename from java/java-tests/testData/inspection/defaultFileTemplateUsage/defaultFile/src/x/X.java
rename to java/java-tests/testData/inspection/defaultFileTemplateUsage/X.java
index c77b8f372e74b615649236112ef8eed488e0a3a4..a9e7bf01f02583eb053eea70972243b356239075 100644 (file)
@@ -1,9 +1,9 @@
 package x;
 import java.io.*;
 
-/**
+<warning descr="Default File template">/**
  * Created by Alexey on 02.12.2005.
- */
+ */</warning>
 public class X implements Runnable{
     File f; //kkj lkkl jjkuufdffffjkkjjh kjh kjhj kkjh kjh  i k kj kj klj lkj lkj lkjl kj klkl kl
     {
@@ -60,4 +60,3 @@ public class X implements Runnable{
         }
     }
 }
-
similarity index 60%
rename from java/java-tests/testData/inspection/defaultFileTemplateUsage/defaultFile/src/x/X2.java
rename to java/java-tests/testData/inspection/defaultFileTemplateUsage/X2.java
index 89efeb89d00bb004a3c5fcd5e06cda1399eee1e2..545b6c0de29a7a7ee8e0b2a66c6f899ab97af716 100644 (file)
@@ -1,8 +1,8 @@
 package x;
 import java.io.*;
 
-/**
+<warning descr="Default File template">/**
  * Created by Alexey on 02.12.2005.
- */
+ */</warning>
 public class X2 {
 }
similarity index 87%
rename from java/java-tests/testData/inspection/defaultFileTemplateUsage/defaultFile/src/x/X3.java
rename to java/java-tests/testData/inspection/defaultFileTemplateUsage/X3.java
index c50dafa29576fde90eecd312ec05c2d0da525382..a9f45957e068f042de7ab5b3b76a86e6de718bd0 100644 (file)
@@ -5,5 +5,5 @@ import java.io.*;
  * Created by Alexey on 02.12.2005.
  * This class represents something important.
  */
-public class X2 {
+public class X3 {
 }
diff --git a/java/java-tests/testData/inspection/defaultFileTemplateUsage/defaultFile/expected.xml b/java/java-tests/testData/inspection/defaultFileTemplateUsage/defaultFile/expected.xml
deleted file mode 100644 (file)
index 46addf6..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<problems>
-
-<problem>
-  <file>X.java</file>
-  <line>4</line>
-  <problem_class>Default File Template Usage</problem_class>
-  <description>Default File template</description>
-</problem>
-
-  <problem>
-    <file>X2.java</file>
-    <line>4</line>
-    <problem_class>Default File Template Usage</problem_class>
-    <description>Default File template</description>
-  </problem>
-</problems>
\ No newline at end of file
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/DefaultFileTemplateInspectionTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/DefaultFileTemplateInspectionTest.java
deleted file mode 100644 (file)
index 0bfd7e0..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.intellij.codeInspection;
-
-import com.intellij.JavaTestUtil;
-import com.intellij.codeInspection.defaultFileTemplateUsage.DefaultFileTemplateUsageInspection;
-import com.intellij.openapi.projectRoots.Sdk;
-import com.intellij.openapi.roots.LanguageLevelProjectExtension;
-import com.intellij.pom.java.LanguageLevel;
-import com.intellij.testFramework.InspectionTestCase;
-
-public class DefaultFileTemplateInspectionTest extends InspectionTestCase {
-  @Override
-  protected Sdk getTestProjectSdk() {
-    final Sdk sdk = super.getTestProjectSdk();
-    LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.JDK_1_7);
-    return sdk;
-  }
-
-  @Override
-  protected String getTestDataPath() {
-    return JavaTestUtil.getJavaTestDataPath() + "/inspection";
-  }
-
-  private void doTest() throws Exception {
-    doTest("defaultFileTemplateUsage/" + getTestName(true), new DefaultFileTemplateUsageInspection());
-  }
-
-  public void testDefaultFile() throws Exception{
-    doTest();
-  }
-}
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/DefaultFileTemplateUsageInspectionTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/DefaultFileTemplateUsageInspectionTest.java
new file mode 100644 (file)
index 0000000..71b4163
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2014 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.codeInspection;
+
+import com.intellij.JavaTestUtil;
+import com.intellij.codeInspection.defaultFileTemplateUsage.DefaultFileTemplateUsageInspection;
+import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
+
+public class DefaultFileTemplateUsageInspectionTest extends LightCodeInsightFixtureTestCase {
+  @Override
+  protected String getTestDataPath() {
+    return JavaTestUtil.getJavaTestDataPath() + "/inspection/defaultFileTemplateUsage";
+  }
+
+  public void testX() { doTest(); }
+  public void testX2() { doTest(); }
+  public void testX3() { doTest(); }
+
+  public void doTest() {
+    myFixture.enableInspections(new DefaultFileTemplateUsageInspection());
+    myFixture.testHighlighting(true, false, true, getTestName(false) + ".java");
+  }
+}