@SuppressWarnings("SpellCheckingInspection") int baddField;
@SuppressWarnings("SpellCheckingInspection") void baddMethod() { }
}
+
+@SuppressWarnings("asdfasd")
+class Foo {
+ {
+ //noinspection asdfasdf
+ int <TYPO descr="Typo: In word 'adsaf'">adsaf</TYPO> = 1;
+ }
+}
\ No newline at end of file
return PluginPathManager.getPluginHomePathRelative("java-i18n") + "/testData/inspection";
}
+ public void testCorrectJava() { doTest(); }
+ public void testTypoInJava() { doTest(); }
+ public void testVarArg() { doTest(); }
+ public void testJapanese() { doTest(); }
+
public void testClassName() { doTest(); }
public void testFieldName() { doTest(); }
public void testMethodName() { doTest(); }
+++ /dev/null
-import java.lang.SuppressWarnings;
-
-@SuppressWarnings("asdfasd")
-class Foo {
- {
- //noinspection asdfasdf
- int <TYPO descr="Typo: In word 'adsaf'">adsaf</TYPO> = 1;
- }
-}
\ No newline at end of file
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2013 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.
package com.intellij.spellchecker.inspection;
/**
- * Created by IntelliJ IDEA.
- * User: Ekaterina Shliakhovetskaja
+ * @author Ekaterina Shliakhovetskaja
*/
public class CommentsWithMistakesInspectionTest extends SpellcheckerInspectionTestCase {
-
-
@Override
protected String getBasePath() {
return getSpellcheckerTestDataPath() + "/inspection/commentsWithMistakes";
}
- public void testJava() throws Throwable {
- doTest("SPITest1.java", getInspectionTools());
+ public void testJava() {
+ doTest("SPITest1.java");
}
- public void testXml() throws Throwable {
- doTest("A.xml", getInspectionTools());
+ public void testXml() {
+ doTest("A.xml");
}
- public void testHtml() throws Throwable {
- doTest("test.html", getInspectionTools());
+ public void testHtml() {
+ doTest("test.html");
}
- public void testTxt() throws Throwable {
- doTest("test.txt", getInspectionTools());
+ public void testTxt() {
+ doTest("test.txt");
}
-
-
}
+++ /dev/null
-/*
- * Copyright 2000-2009 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.spellchecker.inspection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: Ekaterina Shliakhovetskaja
- */
-public class JavaSpellcheckingTest extends SpellcheckerInspectionTestCase {
-
-
- @Override
- protected String getBasePath() {
- return getSpellcheckerTestDataPath() + "/inspection/java";
- }
-
- public void testCorrectJava() throws Throwable {
- doTest("GenericTest.java", getInspectionTools());
- }
-
- public void testTypoInJava() throws Throwable {
- doTest("GenericTestt.java", getInspectionTools());
- }
-
- public void testVarArg() throws Throwable {
- doTest("VarArgTest.java", getInspectionTools());
- }
-
- public void testJapaneese() throws Throwable {
- doTest(getTestName(false) + ".java", getInspectionTools());
- }
-
- public void testSuppression() throws Throwable {
- myFixture.addFileToProject("java/lang/SuppressWarnings.java", "package java.lang; public @interface SuppressWarnings { public String[] value(); }");
- doTest(getTestName(false) + ".java", getInspectionTools());
- }
-}
+++ /dev/null
-/*
- * Copyright 2000-2011 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.spellchecker.inspection;
-
-import com.intellij.spellchecker.inspections.SpellCheckingInspection;
-import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
-
-/**
- * @author yole
- */
-public abstract class LightSpellCheckerTestCase extends LightPlatformCodeInsightFixtureTestCase {
- protected void doTest(final String file) {
- myFixture.enableInspections(new SpellCheckingInspection());
- myFixture.configureByFile(file);
- myFixture.testHighlighting(false, false, true);
- }
-
- @Override
- protected boolean isWriteActionRequired() {
- return false;
- }
-}
/*
- * Copyright 2000-2010 JetBrains s.r.o.
+ * Copyright 2000-2013 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.
return getSpellcheckerTestDataPath() + "/inspection/propertiesWithMistakes";
}
- public void testProperties() throws Throwable {
- doTest("test.properties", getInspectionTools());
+ public void testProperties() {
+ doTest("test.properties");
}
}
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2013 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.
package com.intellij.spellchecker.inspection;
import com.intellij.codeInspection.LocalInspectionTool;
-import com.intellij.openapi.application.PluginPathManager;
import com.intellij.spellchecker.inspections.SpellCheckingInspection;
-import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
+import com.intellij.testFramework.PlatformTestCase;
+import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
+
+public abstract class SpellcheckerInspectionTestCase extends LightPlatformCodeInsightFixtureTestCase {
+ @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
+ protected SpellcheckerInspectionTestCase() {
+ PlatformTestCase.initPlatformLangPrefix();
+ }
+
+ @Override
+ protected boolean isCommunity() {
+ return true;
+ }
+
+ @Override
+ protected boolean isWriteActionRequired() {
+ return false;
+ }
-public abstract class SpellcheckerInspectionTestCase extends CodeInsightFixtureTestCase {
public static String getSpellcheckerTestDataPath() {
- return PluginPathManager.getPluginHomePathRelative("spellchecker") + "/testData";
+ return "/spellchecker/testData/";
}
- protected void doTest(String file, LocalInspectionTool... tools) throws Throwable {
- myFixture.enableInspections(tools);
+ protected void doTest(String file) {
+ myFixture.enableInspections(getInspectionTools());
myFixture.testHighlighting(false, false, true, file);
}
public static LocalInspectionTool[] getInspectionTools() {
return new LocalInspectionTool[]{new SpellCheckingInspection()};
-
}
}
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2013 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.
package com.intellij.spellchecker.inspection;
/**
- * Created by IntelliJ IDEA.
- * User: Ekaterina Shliakhovetskaja
+ * @author Ekaterina Shliakhovetskaja
*/
-public class XmlWithMistakesInspectionTest extends LightSpellCheckerTestCase {
+public class XmlWithMistakesInspectionTest extends SpellcheckerInspectionTestCase {
@Override
protected String getBasePath() {
- return SpellcheckerInspectionTestCase.getSpellcheckerTestDataPath() + "/inspection/xmlWithMistakes";
+ return SpellcheckerInspectionTestCase.getSpellcheckerTestDataPath() + "inspection/xmlWithMistakes";
}
public void testXml() {
doTest("test.xml");
}
}
-
-