mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-132440 (tests updated)
This commit is contained in:
+2
-3
@@ -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{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -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 {
|
||||
}
|
||||
+1
-1
@@ -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>
|
||||
-30
@@ -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();
|
||||
}
|
||||
}
|
||||
+36
@@ -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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user