IDEA-132440 (tests updated)

This commit is contained in:
Roman Shevchenko
2014-11-06 16:36:28 +01:00
parent 1232d9e230
commit 7f5aff2c9b
6 changed files with 41 additions and 53 deletions
@@ -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{
}
}
}
@@ -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 {
}
@@ -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 {
}
@@ -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>
@@ -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();
}
}
@@ -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");
}
}