diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2013-01-08 11:11:20 -0800 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2013-01-08 11:11:20 -0800 |
commit | b56ea2a18f232d79481e778085fd64e8ae486fc3 (patch) | |
tree | 44e1f6eb4864a45033f865b74fe783e3d784dd6a /java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java | |
download | idea-b56ea2a18f232d79481e778085fd64e8ae486fc3.tar.gz |
Snapshot of commit d5ec1d5018ed24f1b4f32b1d09df6dbd7e2fc425
from branch master of git://git.jetbrains.org/idea/community.git
Diffstat (limited to 'java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java')
-rw-r--r-- | java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java b/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java new file mode 100644 index 000000000000..db20eca0956a --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java @@ -0,0 +1,60 @@ +package com.intellij.codeInspection; + +import com.intellij.codeInspection.ex.LocalInspectionToolWrapper; +import com.intellij.codeInspection.redundantCast.RedundantCastInspection; +import com.intellij.openapi.projectRoots.JavaSdkVersion; +import com.intellij.openapi.projectRoots.JavaVersionService; +import com.intellij.openapi.projectRoots.JavaVersionServiceImpl; +import com.intellij.openapi.roots.LanguageLevelProjectExtension; +import com.intellij.pom.java.LanguageLevel; +import com.intellij.testFramework.InspectionTestCase; + +public class RedundantCast15Test extends InspectionTestCase { + @Override + protected void setUp() throws Exception { + super.setUp(); + LanguageLevelProjectExtension.getInstance(myJavaFacade.getProject()).setLanguageLevel(LanguageLevel.JDK_1_5); + } + + + private void doTest() throws Exception { + final LocalInspectionToolWrapper tool = new LocalInspectionToolWrapper(new RedundantCastInspection()); + doTest("redundantCast/generics/" + getTestName(false), tool, "java 1.5"); + } + + public void testBoxingInRef() throws Exception { doTest(); } + + public void testInference1() throws Exception { doTest(); } + + public void testInference2() throws Exception { doTest(); } + + public void testInference3() throws Exception { doTest(); } + + public void testNullInVarargsParameter() throws Exception { doTest(); } + + public void testWrapperToPrimitiveCast() throws Exception { doTest(); } + + public void testEnumConstant() throws Exception { doTest(); } + + public void testRawCast() throws Exception { doTest();} + public void testCastToUnboundWildcard() throws Exception { doTest();} + + public void testRawCastsToAvoidIncompatibility() throws Exception { doTest();} + + public void testIDEA22899() throws Exception { doTest();} + public void testRawCast1() throws Exception { doTest();} + public void testInferenceFromCast() throws Exception { doTest();} + + public void testTypeParameterAccessChecksJava7() throws Exception { + ((JavaVersionServiceImpl)JavaVersionService.getInstance()).setTestVersion(JavaSdkVersion.JDK_1_7, getTestRootDisposable()); + doTest(); + } + + public void testIgnore() throws Exception { + final RedundantCastInspection castInspection = new RedundantCastInspection(); + castInspection.IGNORE_ANNOTATED_METHODS = true; + castInspection.IGNORE_SUSPICIOUS_METHOD_CALLS = true; + final LocalInspectionToolWrapper tool = new LocalInspectionToolWrapper(castInspection); + doTest("redundantCast/generics/" + getTestName(false), tool, "java 1.5"); + } +}
\ No newline at end of file |