+++ /dev/null
-<?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
+++ /dev/null
-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();
- }
-}
--- /dev/null
+/*
+ * 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");
+ }
+}