mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
redundant throws cleanup in test sources
This commit is contained in:
@@ -48,7 +48,7 @@ public class RegExpCompletionTest extends CodeInsightFixtureTestCase {
|
||||
"KISSING FACE WITH SMILING EYES"), strings);
|
||||
}
|
||||
|
||||
public void testBackSlashVariants() throws Throwable {
|
||||
public void testBackSlashVariants() {
|
||||
List<String> nameList =
|
||||
new ArrayList<>(Arrays.asList("d", "D", "s", "S", "w", "W", "b", "B", "A", "G", "Z", "z", "Q", "E",
|
||||
"t", "n", "r", "f", "a", "e", "h", "H", "v", "V", "R", "X", "b{g}"));
|
||||
@@ -58,7 +58,7 @@ public class RegExpCompletionTest extends CodeInsightFixtureTestCase {
|
||||
myFixture.testCompletionVariants(getInputDataFileName(getTestName(true)), ArrayUtil.toStringArray(nameList));
|
||||
}
|
||||
|
||||
public void testPropertyVariants() throws Throwable {
|
||||
public void testPropertyVariants() {
|
||||
List<String> nameList = new ArrayList<>();
|
||||
for (String[] stringArray : DefaultRegExpPropertiesProvider.getInstance().getAllKnownProperties()) {
|
||||
nameList.add("{" + stringArray[0] + "}");
|
||||
@@ -66,13 +66,13 @@ public class RegExpCompletionTest extends CodeInsightFixtureTestCase {
|
||||
myFixture.testCompletionVariants(getInputDataFileName(getTestName(true)), ArrayUtil.toStringArray(nameList));
|
||||
}
|
||||
|
||||
public void testPropertyAlpha() throws Throwable {
|
||||
public void testPropertyAlpha() {
|
||||
myFixture.configureByText(RegExpFileType.INSTANCE, "\\P{Alp<caret>}");
|
||||
myFixture.completeBasic();
|
||||
myFixture.checkResult("\\P{Alpha<caret>}");
|
||||
}
|
||||
|
||||
public void doTest() throws Throwable {
|
||||
public void doTest() {
|
||||
String inputDataFileName = getInputDataFileName(getTestName(true));
|
||||
String expectedResultFileName = getExpectedResultFileName(getTestName(true));
|
||||
myFixture.testCompletion(inputDataFileName, expectedResultFileName);
|
||||
|
||||
@@ -344,7 +344,7 @@ public abstract class BaseCompilerTestCase extends ModuleTestCase {
|
||||
PlatformTestCase.myFilesToDelete.add(moduleFile);
|
||||
return new WriteAction<Module>() {
|
||||
@Override
|
||||
protected void run(@NotNull Result<Module> result) throws Throwable {
|
||||
protected void run(@NotNull Result<Module> result) {
|
||||
Module module = ModuleManager.getInstance(myProject)
|
||||
.newModule(FileUtil.toSystemIndependentName(moduleFile.getAbsolutePath()), getModuleType().getId());
|
||||
module.getModuleFile();
|
||||
|
||||
+2
-3
@@ -19,7 +19,6 @@ import com.intellij.util.io.TestFileSystemItem;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import static com.intellij.compiler.artifacts.ArtifactsTestCase.commitModel;
|
||||
|
||||
@@ -71,7 +70,7 @@ public abstract class ArtifactCompilerTestCase extends BaseCompilerTestCase {
|
||||
return make(getArtifactManager().getArtifacts());
|
||||
}
|
||||
|
||||
protected void changeFileInJar(String jarPath, String pathInJar) throws Exception {
|
||||
protected void changeFileInJar(String jarPath, String pathInJar) {
|
||||
final VirtualFile jarFile = LocalFileSystem.getInstance().findFileByPath(jarPath);
|
||||
assertNotNull(jarFile);
|
||||
final VirtualFile jarRoot = JarFileSystem.getInstance().getJarRootForLocalFile(jarFile);
|
||||
@@ -96,7 +95,7 @@ public abstract class ArtifactCompilerTestCase extends BaseCompilerTestCase {
|
||||
assertFalse(new File(FileUtil.toSystemDependentName(outputPath)).exists());
|
||||
}
|
||||
|
||||
public static void assertEmptyOutput(Artifact a1) throws IOException {
|
||||
public static void assertEmptyOutput(Artifact a1) {
|
||||
assertOutput(a1, ArtifactCompilerTestCase.fs());
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -832,7 +832,7 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
|
||||
doItemTest();
|
||||
}
|
||||
|
||||
public void testInsertOverride() throws Exception {
|
||||
public void testInsertOverride() {
|
||||
JavaCodeStyleSettings styleSettings = CodeStyleSettingsManager.getSettings(getProject()).getCustomSettings(JavaCodeStyleSettings.class);
|
||||
styleSettings.INSERT_OVERRIDE_ANNOTATION = true;
|
||||
doItemTest();
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ import com.intellij.openapi.editor.impl.AbstractEditorTest;
|
||||
import com.intellij.testFramework.TestFileType;
|
||||
|
||||
public class JavaEditingTest extends AbstractEditorTest {
|
||||
public void testSmartHomeInJavadoc() throws Exception {
|
||||
public void testSmartHomeInJavadoc() {
|
||||
init("/**\n" +
|
||||
" * some text<caret>\n" +
|
||||
" */\n" +
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ public class MoveElementLeftRightTest extends AbstractMoveElementLeftRightTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configureEditor(String contents) throws Exception {
|
||||
protected void configureEditor(String contents) {
|
||||
init(contents, TestFileType.JAVA);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-7
@@ -24,7 +24,6 @@ import com.intellij.openapi.editor.impl.AbstractEditorTest;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.testFramework.TestFileType;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
@@ -33,7 +32,7 @@ import java.util.Arrays;
|
||||
*/
|
||||
public class FoldingProcessingOnDocumentModificationTest extends AbstractEditorTest {
|
||||
|
||||
public void testUnexpectedClassLevelJavadocExpandingOnClassSignatureChange() throws IOException {
|
||||
public void testUnexpectedClassLevelJavadocExpandingOnClassSignatureChange() {
|
||||
// Inspired by IDEA-61275
|
||||
|
||||
String text =
|
||||
@@ -60,7 +59,7 @@ public class FoldingProcessingOnDocumentModificationTest extends AbstractEditorT
|
||||
assertFalse(foldRegion.isExpanded());
|
||||
}
|
||||
|
||||
public void testCollapseAllHappensBeforeFirstCodeFoldingPass() throws Exception {
|
||||
public void testCollapseAllHappensBeforeFirstCodeFoldingPass() {
|
||||
init("class Foo {\n" +
|
||||
" void m() {\n" +
|
||||
" System.out.println();\n" +
|
||||
@@ -74,7 +73,7 @@ public class FoldingProcessingOnDocumentModificationTest extends AbstractEditorT
|
||||
assertEquals(1, myEditor.getFoldingModel().getAllFoldRegions().length);
|
||||
}
|
||||
|
||||
public void testSurvivingBrokenPsi() throws Exception {
|
||||
public void testSurvivingBrokenPsi() {
|
||||
openJavaEditor("class Foo {\n" +
|
||||
" void m() {\n" +
|
||||
"\n" +
|
||||
@@ -98,7 +97,7 @@ public class FoldingProcessingOnDocumentModificationTest extends AbstractEditorT
|
||||
checkFoldingState("[FoldRegion +(25:33), placeholder='{}']");
|
||||
}
|
||||
|
||||
public void testInvalidRegionIsRemovedOnExpanding() throws Exception {
|
||||
public void testInvalidRegionIsRemovedOnExpanding() {
|
||||
openJavaEditor("class Foo {\n" +
|
||||
" void m() {\n" +
|
||||
"\n" +
|
||||
@@ -120,7 +119,7 @@ public class FoldingProcessingOnDocumentModificationTest extends AbstractEditorT
|
||||
checkFoldingState("[FoldRegion -(0:37), placeholder='/.../']");
|
||||
}
|
||||
|
||||
public void testEditingNearRegionExpandsIt() throws Exception {
|
||||
public void testEditingNearRegionExpandsIt() {
|
||||
openJavaEditor("class Foo {\n" +
|
||||
" void m() <caret>{\n" +
|
||||
"\n" +
|
||||
@@ -131,7 +130,7 @@ public class FoldingProcessingOnDocumentModificationTest extends AbstractEditorT
|
||||
checkFoldingState("[]");
|
||||
}
|
||||
|
||||
private void openJavaEditor(String text) throws Exception {
|
||||
private void openJavaEditor(String text) {
|
||||
init(text, TestFileType.JAVA);
|
||||
buildInitialFoldRegions();
|
||||
runFoldingPass(true);
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import com.intellij.openapi.editor.impl.AbstractEditorTest;
|
||||
import com.intellij.testFramework.TestFileType;
|
||||
|
||||
public class JavaAutoIndentLinesTest extends AbstractEditorTest {
|
||||
public void testSelection() throws Exception {
|
||||
public void testSelection() {
|
||||
init("class C {\n" +
|
||||
"int <selection>a<caret></selection> = 1;\n" +
|
||||
"}",
|
||||
|
||||
+146
-146
File diff suppressed because it is too large
Load Diff
+22
-22
@@ -28,7 +28,7 @@ import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
|
||||
*/
|
||||
public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
|
||||
public void testRightMargin() throws Exception {
|
||||
public void testRightMargin() {
|
||||
getSettings().WRAP_LONG_LINES = true;
|
||||
getSettings().RIGHT_MARGIN = 35;
|
||||
doTextTest(
|
||||
@@ -65,7 +65,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
}
|
||||
|
||||
|
||||
public void testDoNotWrapLink() throws Exception {
|
||||
public void testDoNotWrapLink() {
|
||||
getSettings().WRAP_LONG_LINES = true;
|
||||
getSettings().RIGHT_MARGIN = 70;
|
||||
doTextTest(
|
||||
@@ -104,7 +104,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
}
|
||||
|
||||
|
||||
public void testPackageJavadoc() throws Exception {
|
||||
public void testPackageJavadoc() {
|
||||
doTextTest(
|
||||
"/**\n" +
|
||||
" * super auper\n" +
|
||||
@@ -172,7 +172,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
);
|
||||
}
|
||||
|
||||
public void testEA49739() throws Exception {
|
||||
public void testEA49739() {
|
||||
getSettings().WRAP_LONG_LINES = true;
|
||||
getSettings().RIGHT_MARGIN = 35;
|
||||
getSettings().WRAP_COMMENTS = true;
|
||||
@@ -195,7 +195,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
"}");
|
||||
}
|
||||
|
||||
public void testOneLineCommentWrappedByRightMarginIntoMultiLine() throws Exception {
|
||||
public void testOneLineCommentWrappedByRightMarginIntoMultiLine() {
|
||||
getSettings().getRootSettings().WRAP_COMMENTS = true;
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
getJavaSettings().JD_DO_NOT_WRAP_ONE_LINE_COMMENTS = true;
|
||||
@@ -235,7 +235,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
);
|
||||
}
|
||||
|
||||
public void testSCR11296() throws Exception {
|
||||
public void testSCR11296() {
|
||||
final CommonCodeStyleSettings settings = getSettings();
|
||||
settings.RIGHT_MARGIN = 50;
|
||||
settings.getRootSettings().WRAP_COMMENTS = true;
|
||||
@@ -245,7 +245,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSCR2632() throws Exception {
|
||||
public void testSCR2632() {
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
getSettings().getRootSettings().WRAP_COMMENTS = true;
|
||||
getSettings().RIGHT_MARGIN = 20;
|
||||
@@ -327,7 +327,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
);
|
||||
}
|
||||
|
||||
public void testParameterDescriptionNotOnNewLine() throws Exception {
|
||||
public void testParameterDescriptionNotOnNewLine() {
|
||||
// IDEA-107383
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
getJavaSettings().JD_ALIGN_PARAM_COMMENTS = true;
|
||||
@@ -351,7 +351,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
"}");
|
||||
}
|
||||
|
||||
public void testWrappedParameterDescription() throws Exception {
|
||||
public void testWrappedParameterDescription() {
|
||||
// Inspired by IDEA-13072
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
getSettings().getRootSettings().WRAP_COMMENTS = true;
|
||||
@@ -421,7 +421,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
doTextTest(before, after);
|
||||
}
|
||||
|
||||
public void testDoNotWrapMultiLineCommentIntoOneLine() throws Exception {
|
||||
public void testDoNotWrapMultiLineCommentIntoOneLine() {
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
getJavaSettings().JD_DO_NOT_WRAP_ONE_LINE_COMMENTS = true;
|
||||
String test = "/**\n" +
|
||||
@@ -433,7 +433,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
doClassTest(test, test);
|
||||
}
|
||||
|
||||
public void testLeaveOneLineComment() throws Exception {
|
||||
public void testLeaveOneLineComment() {
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
getJavaSettings().JD_DO_NOT_WRAP_ONE_LINE_COMMENTS = true;
|
||||
String test = "/** foo */\n" +
|
||||
@@ -443,7 +443,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
doClassTest(test, test);
|
||||
}
|
||||
|
||||
public void testWrapOneLineComment() throws Exception {
|
||||
public void testWrapOneLineComment() {
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
getJavaSettings().JD_DO_NOT_WRAP_ONE_LINE_COMMENTS = false;
|
||||
String test = "/** foo */\n" +
|
||||
@@ -459,7 +459,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
doClassTest(test, after);
|
||||
}
|
||||
|
||||
public void testWrapStrangeComment() throws Exception {
|
||||
public void testWrapStrangeComment() {
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
getJavaSettings().JD_DO_NOT_WRAP_ONE_LINE_COMMENTS = false;
|
||||
String test = "/** foo" +
|
||||
@@ -476,7 +476,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
doClassTest(test, after);
|
||||
}
|
||||
|
||||
public void testWrapStrangeCommentIfNotWrapOneLines() throws Exception {
|
||||
public void testWrapStrangeCommentIfNotWrapOneLines() {
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
getJavaSettings().JD_DO_NOT_WRAP_ONE_LINE_COMMENTS = true;
|
||||
String test = "/** foo\n" +
|
||||
@@ -494,7 +494,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
}
|
||||
|
||||
|
||||
public void testReturnTagAlignment() throws Exception {
|
||||
public void testReturnTagAlignment() {
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
getSettings().RIGHT_MARGIN = 80;
|
||||
getJavaSettings().JD_LEADING_ASTERISKS_ARE_ENABLED = true;
|
||||
@@ -522,7 +522,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
}
|
||||
|
||||
|
||||
public void testReturnTagAlignmentWithPreTagOnFirstLine() throws Exception {
|
||||
public void testReturnTagAlignmentWithPreTagOnFirstLine() {
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
getSettings().RIGHT_MARGIN = 80;
|
||||
getJavaSettings().JD_LEADING_ASTERISKS_ARE_ENABLED = true;
|
||||
@@ -574,7 +574,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
);
|
||||
}
|
||||
|
||||
public void testSeeTagAlignment() throws Exception {
|
||||
public void testSeeTagAlignment() {
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
getSettings().RIGHT_MARGIN = 80;
|
||||
getJavaSettings().JD_LEADING_ASTERISKS_ARE_ENABLED = true;
|
||||
@@ -601,7 +601,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
doClassTest(before, after);
|
||||
}
|
||||
|
||||
public void testDummySinceTagAlignment() throws Exception {
|
||||
public void testDummySinceTagAlignment() {
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
getSettings().RIGHT_MARGIN = 80;
|
||||
getJavaSettings().JD_LEADING_ASTERISKS_ARE_ENABLED = true;
|
||||
@@ -628,7 +628,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
doClassTest(before, after);
|
||||
}
|
||||
|
||||
public void testDummyDeprecatedTagAlignment() throws Exception {
|
||||
public void testDummyDeprecatedTagAlignment() {
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
getSettings().RIGHT_MARGIN = 80;
|
||||
getJavaSettings().JD_LEADING_ASTERISKS_ARE_ENABLED = true;
|
||||
@@ -818,7 +818,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
doTextTest(before, after);
|
||||
}
|
||||
|
||||
public void testDoNotWrapLongLineCommentWithSpaceInStart() throws Exception {
|
||||
public void testDoNotWrapLongLineCommentWithSpaceInStart() {
|
||||
getSettings().KEEP_FIRST_COLUMN_COMMENT = true;
|
||||
getSettings().WRAP_LONG_LINES = true;
|
||||
getSettings().RIGHT_MARGIN = 200;
|
||||
@@ -832,7 +832,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
}
|
||||
|
||||
|
||||
public void testNotGenerateSelfClosingPTagIfLanguageLevelJava8() throws Exception {
|
||||
public void testNotGenerateSelfClosingPTagIfLanguageLevelJava8() {
|
||||
getJavaSettings().JD_P_AT_EMPTY_LINES = true;
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
String before = "/**\n" +
|
||||
@@ -852,7 +852,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
|
||||
doClassTest(before, after);
|
||||
}
|
||||
|
||||
public void testPTagIfLanguageLevelNotJava8() throws Exception {
|
||||
public void testPTagIfLanguageLevelNotJava8() {
|
||||
getJavaSettings().JD_P_AT_EMPTY_LINES = true;
|
||||
getJavaSettings().ENABLE_JAVADOC_FORMATTING = true;
|
||||
LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.JDK_1_7);
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public class InplaceIntroduceVariableTest extends AbstractJavaInplaceIntroduceTe
|
||||
});
|
||||
}
|
||||
|
||||
public void testConflictingInnerClassName() throws Exception {
|
||||
public void testConflictingInnerClassName() {
|
||||
final JavaCodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject()).getCustomSettings(JavaCodeStyleSettings.class);
|
||||
final boolean oldOption = settings.INSERT_INNER_CLASS_IMPORTS;
|
||||
try {
|
||||
|
||||
@@ -63,7 +63,7 @@ public class MakeClassStaticTest extends LightRefactoringTestCase {
|
||||
perform();
|
||||
}
|
||||
|
||||
public void testFieldWithMyPrefix() throws Exception {
|
||||
public void testFieldWithMyPrefix() {
|
||||
final JavaCodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject()).getCustomSettings(JavaCodeStyleSettings.class);
|
||||
String oldPrefix = settings.FIELD_NAME_PREFIX;
|
||||
settings.FIELD_NAME_PREFIX = "my";
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ConvertToAtomicIntentionTest extends LightQuickFixParameterizedTest
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
public void test() throws Exception {
|
||||
public void test() {
|
||||
doAllTests();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class ConvertToLongAdderIntentionTest extends LightQuickFixParameterizedT
|
||||
return PlatformTestUtil.getCommunityPath() + "/java/typeMigration/testData";
|
||||
}
|
||||
|
||||
public void test() throws Exception {
|
||||
public void test() {
|
||||
doAllTests();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public class ConvertToThreadLocalIntention6Test extends LightQuickFixParameteriz
|
||||
return PlatformTestUtil.getCommunityPath() + "/java/typeMigration/testData";
|
||||
}
|
||||
|
||||
public void test() throws Exception {
|
||||
public void test() {
|
||||
doAllTests();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ public class ConvertToThreadLocalIntentionTest extends LightQuickFixParameterize
|
||||
return PlatformTestUtil.getCommunityPath() + "/java/typeMigration/testData";
|
||||
}
|
||||
|
||||
public void test() throws Exception {
|
||||
public void test() {
|
||||
doAllTests();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -54,7 +54,7 @@ public class GuavaInspectionTest extends JavaCodeInsightFixtureTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) throws Exception {
|
||||
protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) {
|
||||
moduleBuilder.setLanguageLevel(LanguageLevel.JDK_1_8);
|
||||
moduleBuilder.addLibraryJars("guava", getTestDataPath() + "/", "guava-stubs.jar");
|
||||
moduleBuilder.addLibraryJars("jsr305", PathManager.getHomePathFor(Assert.class) + "/lib/", "jsr305.jar");
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ public class MigrateAssertToMatcherAssertTest extends JavaCodeInsightFixtureTest
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) throws Exception {
|
||||
protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) {
|
||||
moduleBuilder.addLibraryJars("test-env", PathManager.getHomePathFor(Assert.class) + "/lib", "junit-4.12.jar", "hamcrest-core-1.3.jar");
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ChangeTypeSignatureTest extends LightCodeInsightTestCase {
|
||||
return PlatformTestUtil.getCommunityPath() + "/java/typeMigration/testData";
|
||||
}
|
||||
|
||||
private void doTest(boolean success, String migrationTypeText) throws Exception {
|
||||
private void doTest(boolean success, String migrationTypeText) {
|
||||
String dataPath = "/refactoring/changeTypeSignature/";
|
||||
configureByFile(dataPath + getTestName(false) + ".java");
|
||||
final PsiFile file = getFile();
|
||||
@@ -68,91 +68,91 @@ public class ChangeTypeSignatureTest extends LightCodeInsightTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
private void doTest(boolean success) throws Exception {
|
||||
private void doTest(boolean success) {
|
||||
doTest(success, CommonClassNames.JAVA_LANG_OBJECT);
|
||||
}
|
||||
|
||||
public void testListTypeArguments() throws Exception {
|
||||
public void testListTypeArguments() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testFieldUsage() throws Exception {
|
||||
public void testFieldUsage() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testFieldUsage1() throws Exception {
|
||||
public void testFieldUsage1() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testReturnType() throws Exception {
|
||||
public void testReturnType() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testReturnType1() throws Exception {
|
||||
public void testReturnType1() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testReturnType2() throws Exception {
|
||||
public void testReturnType2() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testPassedParameter() throws Exception {
|
||||
public void testPassedParameter() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testPassedParameter1() throws Exception {
|
||||
public void testPassedParameter1() {
|
||||
doTest(true, "java.lang.Integer");
|
||||
}
|
||||
|
||||
public void testPassedParameter2() throws Exception {
|
||||
public void testPassedParameter2() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testUsedInSuper() throws Exception {
|
||||
public void testUsedInSuper() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testCompositeReturnType() throws Exception {
|
||||
public void testCompositeReturnType() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testTypeHierarchy() throws Exception {
|
||||
public void testTypeHierarchy() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testTypeHierarchy1() throws Exception {
|
||||
public void testTypeHierarchy1() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testTypeHierarchy2() throws Exception {
|
||||
public void testTypeHierarchy2() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testTypeHierarchyFieldUsage() throws Exception {
|
||||
public void testTypeHierarchyFieldUsage() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testTypeHierarchyFieldUsageConflict() throws Exception {
|
||||
public void testTypeHierarchyFieldUsageConflict() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testParameterMigration() throws Exception {
|
||||
public void testParameterMigration() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testParameterMigration1() throws Exception {
|
||||
public void testParameterMigration1() {
|
||||
doTest(true, "java.lang.Integer");
|
||||
}
|
||||
|
||||
public void testParameterMigration2() throws Exception {
|
||||
public void testParameterMigration2() {
|
||||
doTest(true, "java.lang.Integer");
|
||||
}
|
||||
|
||||
public void testFieldTypeMigration() throws Exception {
|
||||
public void testFieldTypeMigration() {
|
||||
doTest(true, "java.lang.String");
|
||||
}
|
||||
|
||||
public void testMethodReturnTypeMigration() throws Exception {
|
||||
public void testMethodReturnTypeMigration() {
|
||||
doTest(true, "java.lang.Integer");
|
||||
}
|
||||
}
|
||||
@@ -12,494 +12,494 @@ public class MigrateTypeSignatureTest extends TypeMigrationTestBase {
|
||||
return "/refactoring/migrateTypeSignature/";
|
||||
}
|
||||
|
||||
public void testExprAccess2Lvalue() throws Exception {
|
||||
public void testExprAccess2Lvalue() {
|
||||
doTestFieldType("myForAccess", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("ClassParent", null));
|
||||
}
|
||||
|
||||
public void testExprAccess2Rvalue() throws Exception {
|
||||
public void testExprAccess2Rvalue() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("ClassGrandChild", null));
|
||||
}
|
||||
|
||||
public void testExprAccessParent2Lvalue() throws Exception {
|
||||
public void testExprAccessParent2Lvalue() {
|
||||
doTestFieldType("myForSuperAccess", "Ession",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("ClassParent", null));
|
||||
}
|
||||
|
||||
public void testExprAccessParent2Rvalue() throws Exception {
|
||||
public void testExprAccessParent2Rvalue() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("ClassGrandChild", null));
|
||||
}
|
||||
|
||||
public void testExprArrayAccessNegative() throws Exception {
|
||||
public void testExprArrayAccessNegative() {
|
||||
doTestFirstParamType("meth", "Expr", PsiType.DOUBLE);
|
||||
}
|
||||
|
||||
public void testExprArrayAccessPositive() throws Exception {
|
||||
public void testExprArrayAccessPositive() {
|
||||
doTestFirstParamType("meth", "Expr", PsiType.CHAR);
|
||||
}
|
||||
|
||||
public void testExprCalcBooleanBoolean() throws Exception {
|
||||
public void testExprCalcBooleanBoolean() {
|
||||
doTestFirstParamType("meth", "Expr", PsiType.INT);
|
||||
}
|
||||
|
||||
public void testExprCalcBooleanNumeric() throws Exception {
|
||||
public void testExprCalcBooleanNumeric() {
|
||||
doTestFirstParamType("meth", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_LANG_OBJECT, null));
|
||||
}
|
||||
|
||||
public void testExprCalcBooleanReference() throws Exception {
|
||||
public void testExprCalcBooleanReference() {
|
||||
doTestFirstParamType("meth", "Expr",
|
||||
PsiType.DOUBLE);
|
||||
}
|
||||
|
||||
public void testExprCalcNumeric2Boolean() throws Exception {
|
||||
public void testExprCalcNumeric2Boolean() {
|
||||
doTestFirstParamType("meth", "Expr", PsiType.BOOLEAN);
|
||||
}
|
||||
|
||||
public void testExprCalcNumeric2Floating() throws Exception {
|
||||
public void testExprCalcNumeric2Floating() {
|
||||
doTestFirstParamType("meth", "Expr", PsiType.FLOAT);
|
||||
}
|
||||
|
||||
public void testExprCalcNumeric2Int() throws Exception {
|
||||
public void testExprCalcNumeric2Int() {
|
||||
doTestFirstParamType("meth", "Expr", PsiType.LONG);
|
||||
}
|
||||
|
||||
public void testExprCalcNumeric2String() throws Exception {
|
||||
public void testExprCalcNumeric2String() {
|
||||
doTestFirstParamType("meth", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null));
|
||||
}
|
||||
|
||||
public void testExprCast2LvalueNeg() throws Exception {
|
||||
public void testExprCast2LvalueNeg() {
|
||||
doTestFirstParamType("meth", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null));
|
||||
}
|
||||
|
||||
public void testExprCast2LvaluePos() throws Exception {
|
||||
public void testExprCast2LvaluePos() {
|
||||
doTestFirstParamType("meth", "Expr", PsiType.INT);
|
||||
}
|
||||
|
||||
public void testExprConcatNumeric2Reference() throws Exception {
|
||||
public void testExprConcatNumeric2Reference() {
|
||||
doTestFirstParamType("meth", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_LANG_OBJECT, null));
|
||||
}
|
||||
|
||||
public void testExprConcatNumeric2String() throws Exception {
|
||||
public void testExprConcatNumeric2String() {
|
||||
doTestFirstParamType("meth", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null));
|
||||
}
|
||||
|
||||
public void testExprConcatString2Numeric() throws Exception {
|
||||
public void testExprConcatString2Numeric() {
|
||||
doTestFirstParamType("meth", "Expr",
|
||||
PsiType.INT);
|
||||
}
|
||||
|
||||
public void testExprConcatString2Reference() throws Exception {
|
||||
public void testExprConcatString2Reference() {
|
||||
doTestFirstParamType("meth", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_LANG_OBJECT, null));
|
||||
}
|
||||
|
||||
public void testExprInstanceofNeg() throws Exception {
|
||||
public void testExprInstanceofNeg() {
|
||||
doTestFirstParamType("meth", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_UTIL_LIST, null));
|
||||
}
|
||||
|
||||
public void testExprInstanceofPos() throws Exception {
|
||||
public void testExprInstanceofPos() {
|
||||
doTestFirstParamType("meth", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.AbstractMap", null));
|
||||
}
|
||||
|
||||
public void testExprLiteralBoolean() throws Exception {
|
||||
public void testExprLiteralBoolean() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
PsiType.BOOLEAN);
|
||||
}
|
||||
|
||||
public void testExprLiteralByte() throws Exception {
|
||||
public void testExprLiteralByte() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
PsiType.BYTE);
|
||||
}
|
||||
|
||||
public void testExprLiteralChar() throws Exception {
|
||||
public void testExprLiteralChar() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
PsiType.CHAR);
|
||||
}
|
||||
|
||||
public void testExprLiteralClassExtends() throws Exception {
|
||||
public void testExprLiteralClassExtends() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Class<? extends java.util.Collection[]>", null));
|
||||
}
|
||||
|
||||
public void testExprLiteralClassPrimitive() throws Exception {
|
||||
public void testExprLiteralClassPrimitive() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Class<Integer>", null));
|
||||
}
|
||||
|
||||
public void testExprLiteralClassPrimitiveArray() throws Exception {
|
||||
public void testExprLiteralClassPrimitiveArray() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Class<int[]>", null));
|
||||
}
|
||||
|
||||
public void testExprLiteralClassRaw() throws Exception {
|
||||
public void testExprLiteralClassRaw() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Class", null));
|
||||
}
|
||||
|
||||
public void testExprLiteralClassReference() throws Exception {
|
||||
public void testExprLiteralClassReference() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Class<java.util.Set>", null));
|
||||
}
|
||||
|
||||
public void testExprLiteralClassReferenceArray() throws Exception {
|
||||
public void testExprLiteralClassReferenceArray() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Class<java.util.Set[]>", null));
|
||||
}
|
||||
|
||||
public void testExprLiteralClassSuper() throws Exception {
|
||||
public void testExprLiteralClassSuper() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Class<? super java.util.AbstractSet[]>", null));
|
||||
}
|
||||
|
||||
public void testExprLiteralDouble() throws Exception {
|
||||
public void testExprLiteralDouble() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
PsiType.DOUBLE);
|
||||
}
|
||||
|
||||
public void testExprLiteralFloat() throws Exception {
|
||||
public void testExprLiteralFloat() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
PsiType.FLOAT);
|
||||
}
|
||||
|
||||
public void testExprLiteralInt() throws Exception {
|
||||
public void testExprLiteralInt() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
PsiType.INT);
|
||||
}
|
||||
|
||||
public void testExprLiteralLong() throws Exception {
|
||||
public void testExprLiteralLong() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
PsiType.LONG);
|
||||
}
|
||||
|
||||
public void testExprLiteralShort() throws Exception {
|
||||
public void testExprLiteralShort() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
PsiType.SHORT);
|
||||
}
|
||||
|
||||
public void testExprLiteralString() throws Exception {
|
||||
public void testExprLiteralString() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null));
|
||||
}
|
||||
|
||||
public void testExprNewArrayArray2Lvalue() throws Exception {
|
||||
public void testExprNewArrayArray2Lvalue() {
|
||||
doTestFirstParamType("meth", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("FaceParent", null).createArrayType());
|
||||
}
|
||||
|
||||
public void testExprNewArrayArray2Rvalue() throws Exception {
|
||||
public void testExprNewArrayArray2Rvalue() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("ClassParent", null).createArrayType().createArrayType().createArrayType());
|
||||
}
|
||||
|
||||
public void testExprNewArrayGen2Rvalue() throws Exception {
|
||||
public void testExprNewArrayGen2Rvalue() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.Set<java.lang.Integer>", null).createArrayType());
|
||||
}
|
||||
|
||||
public void testExprNewArrayPrimitive2Lvalue() throws Exception {
|
||||
public void testExprNewArrayPrimitive2Lvalue() {
|
||||
doTestFirstParamType("meth", "Expr", PsiType.INT);
|
||||
}
|
||||
|
||||
public void testExprNewArrayPrimitive2Rvalue() throws Exception {
|
||||
public void testExprNewArrayPrimitive2Rvalue() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
PsiType.INT.createArrayType().createArrayType());
|
||||
}
|
||||
|
||||
public void testExprNewArrayReftype2Lvalue() throws Exception {
|
||||
public void testExprNewArrayReftype2Lvalue() {
|
||||
doTestFirstParamType("meth", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("FaceParent", null));
|
||||
}
|
||||
|
||||
public void testExprNewArrayReftype2Rvalue() throws Exception {
|
||||
public void testExprNewArrayReftype2Rvalue() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("ClassParent", null).createArrayType().createArrayType());
|
||||
}
|
||||
|
||||
public void testExprNewGen() throws Exception {
|
||||
public void testExprNewGen() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.Set<Subject>", null));
|
||||
}
|
||||
|
||||
public void testExprNewGenExtends() throws Exception {
|
||||
public void testExprNewGenExtends() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.Set<? extends Subject>", null));
|
||||
}
|
||||
|
||||
public void testExprNewGenSuper() throws Exception {
|
||||
public void testExprNewGenSuper() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.Set<? super Subject>", null));
|
||||
}
|
||||
|
||||
public void testExprNewReference() throws Exception {
|
||||
public void testExprNewReference() {
|
||||
doTestFieldType("myField", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("Expr.Subject", null));
|
||||
}
|
||||
|
||||
public void testExprReturn2Lvalue() throws Exception {
|
||||
public void testExprReturn2Lvalue() {
|
||||
doTestFirstParamType("meth", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null));
|
||||
}
|
||||
|
||||
public void testExprReturn2Rvalue() throws Exception {
|
||||
public void testExprReturn2Rvalue() {
|
||||
doTestMethodType("meth", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null));
|
||||
}
|
||||
|
||||
public void testExprTernary() throws Exception {
|
||||
public void testExprTernary() {
|
||||
doTestFirstParamType("meth", "Expr",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null));
|
||||
}
|
||||
|
||||
public void testOverridingDown() throws Exception {
|
||||
public void testOverridingDown() {
|
||||
doTestMethodType("getInt", "Parent", PsiType.BYTE);
|
||||
}
|
||||
|
||||
public void testOverridingUp() throws Exception {
|
||||
public void testOverridingUp() {
|
||||
doTestMethodType("getInt", "Child", PsiType.BYTE);
|
||||
}
|
||||
|
||||
public void testSpecJavadoc() throws Exception {
|
||||
public void testSpecJavadoc() {
|
||||
JavaCodeStyleSettings settings = getCurrentCodeStyleSettings().getCustomSettings(JavaCodeStyleSettings.class);
|
||||
settings.CLASS_NAMES_IN_JAVADOC = JavaCodeStyleSettings.FULLY_QUALIFY_NAMES_ALWAYS;
|
||||
doTestFirstParamType("meth", "Spec",
|
||||
myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_UTIL_SET, null));
|
||||
}
|
||||
|
||||
public void testSpecNotUsed() throws Exception {
|
||||
public void testSpecNotUsed() {
|
||||
doTestFieldType("myField", "Spec", PsiType.BOOLEAN);
|
||||
}
|
||||
|
||||
public void testTypeArrayReftype2Lvalue() throws Exception {
|
||||
public void testTypeArrayReftype2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("Subject", null).createArrayType());
|
||||
}
|
||||
|
||||
public void testTypeArrayReftype2Rvalue() throws Exception {
|
||||
public void testTypeArrayReftype2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("Subject", null).createArrayType().createArrayType());
|
||||
}
|
||||
|
||||
public void testTypeArrayRoots2Lvalue() throws Exception {
|
||||
public void testTypeArrayRoots2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("Holder", null).createArrayType());
|
||||
}
|
||||
|
||||
public void testTypeArrayVararg2Lvalue() throws Exception {
|
||||
public void testTypeArrayVararg2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
new PsiEllipsisType(myJavaFacade.getElementFactory().createTypeFromText("Subject", null)));
|
||||
}
|
||||
|
||||
public void testTypeArrayVararg2RvalueNeg() throws Exception {
|
||||
public void testTypeArrayVararg2RvalueNeg() {
|
||||
doTestFieldType("myField", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("Descendant", null).createArrayType());
|
||||
}
|
||||
|
||||
public void testTypeArrayVararg2RvaluePos() throws Exception {
|
||||
public void testTypeArrayVararg2RvaluePos() {
|
||||
doTestFieldType("myField", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("Subject", null).createArrayType());
|
||||
}
|
||||
|
||||
public void testTypeAutoboxBoolean2Lvalue() throws Exception {
|
||||
public void testTypeAutoboxBoolean2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Boolean", null));
|
||||
}
|
||||
|
||||
public void testTypeAutoboxBoolean2Rvalue() throws Exception {
|
||||
public void testTypeAutoboxBoolean2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
PsiType.BOOLEAN);
|
||||
}
|
||||
|
||||
public void testTypeAutoboxByte2Lvalue() throws Exception {
|
||||
public void testTypeAutoboxByte2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Byte", null));
|
||||
}
|
||||
|
||||
public void testTypeAutoboxByte2Rvalue() throws Exception {
|
||||
public void testTypeAutoboxByte2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
PsiType.BYTE);
|
||||
}
|
||||
|
||||
public void testTypeAutoboxChar2Lvalue() throws Exception {
|
||||
public void testTypeAutoboxChar2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Character", null));
|
||||
}
|
||||
|
||||
public void testTypeAutoboxChar2Rvalue() throws Exception {
|
||||
public void testTypeAutoboxChar2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
PsiType.CHAR);
|
||||
}
|
||||
|
||||
public void testTypeAutoboxDouble2Lvalue() throws Exception {
|
||||
public void testTypeAutoboxDouble2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Double", null));
|
||||
}
|
||||
|
||||
public void testTypeAutoboxDouble2Rvalue() throws Exception {
|
||||
public void testTypeAutoboxDouble2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
PsiType.DOUBLE);
|
||||
}
|
||||
|
||||
public void testTypeAutoboxFloat2Lvalue() throws Exception {
|
||||
public void testTypeAutoboxFloat2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Float", null));
|
||||
}
|
||||
|
||||
public void testTypeAutoboxFloat2Rvalue() throws Exception {
|
||||
public void testTypeAutoboxFloat2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
PsiType.FLOAT);
|
||||
}
|
||||
|
||||
public void testTypeAutoboxInt2Lvalue() throws Exception {
|
||||
public void testTypeAutoboxInt2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Integer", null));
|
||||
}
|
||||
|
||||
public void testTypeAutoboxInt2Rvalue() throws Exception {
|
||||
public void testTypeAutoboxInt2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
PsiType.INT);
|
||||
}
|
||||
|
||||
public void testTypeAutoboxLong2Lvalue() throws Exception {
|
||||
public void testTypeAutoboxLong2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Long", null));
|
||||
}
|
||||
|
||||
public void testTypeAutoboxLong2Rvalue() throws Exception {
|
||||
public void testTypeAutoboxLong2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
PsiType.LONG);
|
||||
}
|
||||
|
||||
public void testTypeAutoboxShort2Lvalue() throws Exception {
|
||||
public void testTypeAutoboxShort2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Short", null));
|
||||
}
|
||||
|
||||
public void testTypeAutoboxShort2Rvalue() throws Exception {
|
||||
public void testTypeAutoboxShort2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
PsiType.SHORT);
|
||||
}
|
||||
|
||||
public void testTypeGenAncestor2Lvalue() throws Exception {
|
||||
public void testTypeGenAncestor2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.Set<Subject>", null));
|
||||
}
|
||||
|
||||
public void testTypeGenAncestorWildcard2Lvalue() throws Exception {
|
||||
public void testTypeGenAncestorWildcard2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.Set<? extends Subject>", null));
|
||||
}
|
||||
|
||||
public void testTypeGenDescendant2Rvalue() throws Exception {
|
||||
public void testTypeGenDescendant2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.Set<Subject>", null));
|
||||
}
|
||||
|
||||
public void testTypeGenDescendantWildcard2Rvalue() throws Exception {
|
||||
public void testTypeGenDescendantWildcard2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.Set<? super Subject>", null));
|
||||
}
|
||||
|
||||
public void testTypeGenRaw2Lvalue() throws Exception {
|
||||
public void testTypeGenRaw2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_UTIL_SET, null));
|
||||
}
|
||||
|
||||
public void testTypeGenRaw2Rvalue() throws Exception {
|
||||
public void testTypeGenRaw2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_UTIL_SET, null));
|
||||
}
|
||||
|
||||
public void testTypePrimsubBoolean2Lvalue() throws Exception {
|
||||
public void testTypePrimsubBoolean2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type", PsiType.BOOLEAN);
|
||||
}
|
||||
|
||||
public void testTypePrimsubBoolean2Rvalue() throws Exception {
|
||||
public void testTypePrimsubBoolean2Rvalue() {
|
||||
doTestFieldType("myField", "Type", PsiType.BOOLEAN);
|
||||
}
|
||||
|
||||
public void testTypePrimsubByte2Rvalue() throws Exception {
|
||||
public void testTypePrimsubByte2Rvalue() {
|
||||
doTestFieldType("myField", "Type", PsiType.BYTE);
|
||||
}
|
||||
|
||||
public void testTypePrimsubChar2Lvalue() throws Exception {
|
||||
public void testTypePrimsubChar2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type", PsiType.CHAR);
|
||||
}
|
||||
|
||||
public void testTypePrimsubChar2Rvalue() throws Exception {
|
||||
public void testTypePrimsubChar2Rvalue() {
|
||||
doTestFieldType("myField", "Type", PsiType.CHAR);
|
||||
}
|
||||
|
||||
public void testTypePrimsubDouble2Lvalue() throws Exception {
|
||||
public void testTypePrimsubDouble2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type", PsiType.DOUBLE);
|
||||
}
|
||||
|
||||
public void testTypePrimsubFloat2Lvalue() throws Exception {
|
||||
public void testTypePrimsubFloat2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type", PsiType.FLOAT);
|
||||
}
|
||||
|
||||
public void testTypePrimsubFloat2Rvalue() throws Exception {
|
||||
public void testTypePrimsubFloat2Rvalue() {
|
||||
doTestFieldType("myField", "Type", PsiType.FLOAT);
|
||||
}
|
||||
|
||||
public void testTypePrimsubInt2Lvalue() throws Exception {
|
||||
public void testTypePrimsubInt2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type", PsiType.INT);
|
||||
}
|
||||
|
||||
public void testTypePrimsubInt2Rvalue() throws Exception {
|
||||
public void testTypePrimsubInt2Rvalue() {
|
||||
doTestFieldType("myField", "Type", PsiType.INT);
|
||||
}
|
||||
|
||||
public void testTypePrimsubLong2Lvalue() throws Exception {
|
||||
public void testTypePrimsubLong2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type", PsiType.LONG);
|
||||
}
|
||||
|
||||
public void testTypePrimsubLong2Rvalue() throws Exception {
|
||||
public void testTypePrimsubLong2Rvalue() {
|
||||
doTestFieldType("myField", "Type", PsiType.LONG);
|
||||
}
|
||||
|
||||
public void testTypePrimsubShort2Lvalue() throws Exception {
|
||||
public void testTypePrimsubShort2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type", PsiType.SHORT);
|
||||
}
|
||||
|
||||
public void testTypePrimsubShort2Rvalue() throws Exception {
|
||||
public void testTypePrimsubShort2Rvalue() {
|
||||
doTestFieldType("myField", "Type", PsiType.SHORT);
|
||||
}
|
||||
|
||||
public void testTypeRefClassChild2Rvalue() throws Exception {
|
||||
public void testTypeRefClassChild2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("ClassChild", null));
|
||||
}
|
||||
|
||||
public void testTypeRefClassParent2Lvalue() throws Exception {
|
||||
public void testTypeRefClassParent2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("ClassParent", null));
|
||||
}
|
||||
|
||||
public void testTypeRefClassParent2Rvalue() throws Exception {
|
||||
public void testTypeRefClassParent2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("ClassParent", null));
|
||||
}
|
||||
|
||||
public void testTypeRefFaceChild2Lvalue() throws Exception {
|
||||
public void testTypeRefFaceChild2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("FaceChild", null));
|
||||
}
|
||||
|
||||
public void testTypeRefFaceChild2Rvalue() throws Exception {
|
||||
public void testTypeRefFaceChild2Rvalue() {
|
||||
doTestFieldType("myField", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("FaceChild", null));
|
||||
}
|
||||
|
||||
public void testTypeRefFaceParent2Lvalue() throws Exception {
|
||||
public void testTypeRefFaceParent2Lvalue() {
|
||||
doTestFirstParamType("meth", "Type",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("FaceParent", null));
|
||||
}
|
||||
@@ -518,7 +518,7 @@ public class MigrateTypeSignatureTest extends TypeMigrationTestBase {
|
||||
final PsiType toType) {
|
||||
final RulesProvider provider = new RulesProvider() {
|
||||
@Override
|
||||
public PsiType migrationType(PsiElement context) throws Exception {
|
||||
public PsiType migrationType(PsiElement context) {
|
||||
return toType;
|
||||
}
|
||||
|
||||
|
||||
+19
-19
@@ -3,8 +3,8 @@ package com.intellij.refactoring;
|
||||
import com.intellij.psi.PsiType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
import java.util.concurrent.atomic.AtomicIntegerArray;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
|
||||
public class TypeMigrationByAtomicRuleTest extends TypeMigrationTestBase{
|
||||
@NotNull
|
||||
@@ -13,86 +13,86 @@ public class TypeMigrationByAtomicRuleTest extends TypeMigrationTestBase{
|
||||
return "/refactoring/typeMigrationByAtomic/";
|
||||
}
|
||||
|
||||
private void doTestDirectMigration() throws Exception {
|
||||
private void doTestDirectMigration() {
|
||||
doTestFieldType("i", myJavaFacade.getElementFactory().createTypeFromText("java.util.concurrent.atomic.AtomicInteger", null));
|
||||
}
|
||||
|
||||
|
||||
public void testDirectIncrementDecrement() throws Exception {
|
||||
public void testDirectIncrementDecrement() {
|
||||
doTestDirectMigration();
|
||||
}
|
||||
|
||||
public void testDirectAssignments() throws Exception {
|
||||
public void testDirectAssignments() {
|
||||
doTestDirectMigration();
|
||||
}
|
||||
|
||||
public void testDirectConditions() throws Exception {
|
||||
public void testDirectConditions() {
|
||||
doTestFieldType("b", myJavaFacade.getElementFactory().createTypeFromText("java.util.concurrent.atomic.AtomicBoolean", null));
|
||||
}
|
||||
|
||||
public void testDirectConditionalExpression() throws Exception {
|
||||
public void testDirectConditionalExpression() {
|
||||
doTestFieldType("s",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.concurrent.atomic.AtomicReference<java.lang.String>", null));
|
||||
}
|
||||
|
||||
|
||||
public void testDirectByte() throws Exception {
|
||||
public void testDirectByte() {
|
||||
doTestFieldType("b",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.concurrent.atomic.AtomicReference<java.lang.Byte>", null));
|
||||
}
|
||||
|
||||
public void testDirectString() throws Exception {
|
||||
public void testDirectString() {
|
||||
doTestFieldType("s",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.concurrent.atomic.AtomicReference<java.lang.String>", null));
|
||||
}
|
||||
|
||||
public void testDirectForeach() throws Exception {
|
||||
public void testDirectForeach() {
|
||||
doTestFieldType("lst",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.concurrent.atomic.AtomicReference<java.util.List<java.lang.String>>", null));
|
||||
}
|
||||
|
||||
public void testDirectStringArray() throws Exception {
|
||||
public void testDirectStringArray() {
|
||||
doTestFieldType("s",
|
||||
myJavaFacade.getElementFactory().createTypeFromText(AtomicReferenceArray.class.getName() + "<java.lang.String>", null));
|
||||
}
|
||||
|
||||
public void testDirectIntArray() throws Exception {
|
||||
public void testDirectIntArray() {
|
||||
doTestFieldType("a",
|
||||
myJavaFacade.getElementFactory().createTypeFromText(AtomicIntegerArray.class.getName(), null));
|
||||
}
|
||||
|
||||
private void doTestReverseMigration() throws Exception {
|
||||
private void doTestReverseMigration() {
|
||||
doTestFieldType("i", PsiType.INT);
|
||||
}
|
||||
|
||||
|
||||
public void testReverseIncrementDecrement() throws Exception {
|
||||
public void testReverseIncrementDecrement() {
|
||||
doTestReverseMigration();
|
||||
}
|
||||
|
||||
public void testReverseAssignments() throws Exception {
|
||||
public void testReverseAssignments() {
|
||||
doTestReverseMigration();
|
||||
}
|
||||
|
||||
public void testReverseConditions() throws Exception {
|
||||
public void testReverseConditions() {
|
||||
doTestFieldType("b", PsiType.BOOLEAN);
|
||||
}
|
||||
|
||||
public void testReverseByte() throws Exception {
|
||||
public void testReverseByte() {
|
||||
doTestFieldType("b", PsiType.BYTE);
|
||||
}
|
||||
|
||||
public void testReverseString() throws Exception {
|
||||
public void testReverseString() {
|
||||
doTestFieldType("s",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null));
|
||||
}
|
||||
|
||||
public void testReverseStringArray() throws Exception {
|
||||
public void testReverseStringArray() {
|
||||
doTestFieldType("s",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null).createArrayType());
|
||||
}
|
||||
|
||||
public void testReverseIntArray() throws Exception {
|
||||
public void testReverseIntArray() {
|
||||
doTestFieldType("a",
|
||||
PsiType.INT.createArrayType());
|
||||
}
|
||||
|
||||
+4
-4
@@ -12,19 +12,19 @@ public class TypeMigrationByThreadLocalRuleTest extends TypeMigrationTestBase{
|
||||
}
|
||||
|
||||
|
||||
public void testDirectInt() throws Exception {
|
||||
public void testDirectInt() {
|
||||
doTestFieldType("i", myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal<java.lang.Integer>", null));
|
||||
}
|
||||
|
||||
public void testDirectByte() throws Exception {
|
||||
public void testDirectByte() {
|
||||
doTestFieldType("i", myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal<java.lang.Byte>", null));
|
||||
}
|
||||
|
||||
public void testDirectString() throws Exception {
|
||||
public void testDirectString() {
|
||||
doTestFieldType("myS", myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal<java.lang.String>", null));
|
||||
}
|
||||
|
||||
public void testLanguageLevel() throws Exception {
|
||||
public void testLanguageLevel() {
|
||||
final LanguageLevelProjectExtension extension = LanguageLevelProjectExtension.getInstance(getProject());
|
||||
final LanguageLevel languageLevel = extension.getLanguageLevel();
|
||||
try {
|
||||
|
||||
@@ -877,7 +877,7 @@ public class TypeMigrationTest extends TypeMigrationTestBase {
|
||||
private void doTestReturnType(final String methodName, final String migrationType) {
|
||||
start(new RulesProvider() {
|
||||
@Override
|
||||
public PsiType migrationType(PsiElement context) throws Exception {
|
||||
public PsiType migrationType(PsiElement context) {
|
||||
return myFactory.createTypeFromText(migrationType, context);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public abstract class TypeMigrationTestBase extends MultiFileTestCase {
|
||||
final PsiType toType) {
|
||||
final RulesProvider provider = new RulesProvider() {
|
||||
@Override
|
||||
public PsiType migrationType(PsiElement context) throws Exception {
|
||||
public PsiType migrationType(PsiElement context) {
|
||||
return toType;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public abstract class TypeMigrationTestBase extends MultiFileTestCase {
|
||||
protected void doTestFieldsType(@NotNull String className, @NotNull final PsiType migrationType, final String... fieldNames) {
|
||||
final RulesProvider provider = new RulesProvider() {
|
||||
@Override
|
||||
public PsiType migrationType(PsiElement context) throws Exception {
|
||||
public PsiType migrationType(PsiElement context) {
|
||||
return migrationType;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public abstract class TypeMigrationTestBase extends MultiFileTestCase {
|
||||
final PsiType migrationType) {
|
||||
final RulesProvider provider = new RulesProvider() {
|
||||
@Override
|
||||
public PsiType migrationType(PsiElement context) throws Exception {
|
||||
public PsiType migrationType(PsiElement context) {
|
||||
return migrationType;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public abstract class TypeMigrationTestBase extends MultiFileTestCase {
|
||||
protected void doTestFirstParamType(@NonNls final String methodName, String className, final PsiType migrationType) {
|
||||
final RulesProvider provider = new RulesProvider() {
|
||||
@Override
|
||||
public PsiType migrationType(PsiElement context) throws Exception {
|
||||
public PsiType migrationType(PsiElement context) {
|
||||
return migrationType;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ public abstract class TypeMigrationTestBase extends MultiFileTestCase {
|
||||
}
|
||||
|
||||
interface RulesProvider {
|
||||
PsiType migrationType(PsiElement context) throws Exception;
|
||||
PsiType migrationType(PsiElement context);
|
||||
|
||||
default PsiElement victim(PsiClass aClass) {
|
||||
fail("You need to override one of victim(PsiClass) or victims(PsiClass) methods");
|
||||
|
||||
@@ -10,134 +10,134 @@ public class WildcardTypeMigrationTest extends TypeMigrationTestBase{
|
||||
return "/refactoring/wildcard/";
|
||||
}
|
||||
|
||||
public void testProducerExtends() throws Exception {
|
||||
public void testProducerExtends() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList<? extends java.lang.Number>", null));
|
||||
}
|
||||
|
||||
public void testProducerSuper() throws Exception {
|
||||
public void testProducerSuper() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList<? super java.lang.Integer>", null));
|
||||
}
|
||||
|
||||
public void testProducerUnbounded() throws Exception {
|
||||
public void testProducerUnbounded() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList<?>", null));
|
||||
}
|
||||
|
||||
public void testProducerCollectionChanged() throws Exception {
|
||||
public void testProducerCollectionChanged() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.Set<? super java.lang.Integer>", null));
|
||||
}
|
||||
|
||||
public void testProducerExtendsCollectionChanged() throws Exception {
|
||||
public void testProducerExtendsCollectionChanged() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.Set<? extends java.lang.Object>", null));
|
||||
}
|
||||
|
||||
public void testProducerStopAtWildcard() throws Exception {
|
||||
public void testProducerStopAtWildcard() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.List<? super java.lang.Number>", null));
|
||||
}
|
||||
|
||||
public void testProducerFailToStopAtWildcard() throws Exception {
|
||||
public void testProducerFailToStopAtWildcard() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.List<? super java.lang.Integer>", null));
|
||||
}
|
||||
|
||||
public void testProducerExtendsFailToStopAtWildcard() throws Exception {
|
||||
public void testProducerExtendsFailToStopAtWildcard() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.List<? extends java.lang.Number>", null));
|
||||
}
|
||||
|
||||
|
||||
public void testConsumerExtends() throws Exception {
|
||||
public void testConsumerExtends() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList<? extends java.lang.Number>", null));
|
||||
}
|
||||
|
||||
public void testConsumerSuper() throws Exception {
|
||||
public void testConsumerSuper() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList<? super java.lang.Number>", null));
|
||||
}
|
||||
|
||||
public void testConsumerUnbounded() throws Exception {
|
||||
public void testConsumerUnbounded() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList<?>", null));
|
||||
}
|
||||
|
||||
// array -> list
|
||||
public void testAssignmentExtends() throws Exception {
|
||||
public void testAssignmentExtends() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList<? extends java.lang.Integer>", null));
|
||||
}
|
||||
|
||||
public void testAssignmentSuper() throws Exception {
|
||||
public void testAssignmentSuper() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList<? super java.lang.Integer>", null));
|
||||
}
|
||||
|
||||
public void testAssignmentUnbounded() throws Exception {
|
||||
public void testAssignmentUnbounded() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList<?>", null));
|
||||
}
|
||||
|
||||
public void testGetExtends() throws Exception {
|
||||
public void testGetExtends() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList<? extends java.lang.Integer>", null));
|
||||
}
|
||||
|
||||
public void testGetSuper() throws Exception {
|
||||
public void testGetSuper() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList<? super java.lang.Integer>", null));
|
||||
}
|
||||
|
||||
public void testGetUnbounded() throws Exception {
|
||||
public void testGetUnbounded() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList<?>", null));
|
||||
|
||||
}
|
||||
|
||||
public void testLengthSize() throws Exception {
|
||||
public void testLengthSize() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList<?>", null));
|
||||
|
||||
}
|
||||
|
||||
//list -> array
|
||||
public void testGetAssignmentExtendsToType() throws Exception {
|
||||
public void testGetAssignmentExtendsToType() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Number", null).createArrayType());
|
||||
}
|
||||
|
||||
public void testGetAssignmentExtendsToSuperType() throws Exception {
|
||||
public void testGetAssignmentExtendsToSuperType() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_LANG_OBJECT, null).createArrayType());
|
||||
}
|
||||
|
||||
public void testGetAssignmentExtendsToChildType() throws Exception {
|
||||
public void testGetAssignmentExtendsToChildType() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.Integer", null).createArrayType());
|
||||
}
|
||||
|
||||
// -> threadlocal with wildcard
|
||||
public void testThreadLocalProducerExtends() throws Exception {
|
||||
public void testThreadLocalProducerExtends() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal<java.util.List<? extends String>>", null));
|
||||
}
|
||||
|
||||
//List<? super String> is not assignable to List<String> though it is possible to pass string where ? super String was
|
||||
public void _testThreadLocalProducerSuper() throws Exception {
|
||||
public void _testThreadLocalProducerSuper() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal<java.util.List<? super String>>", null));
|
||||
}
|
||||
|
||||
public void testThreadLocalConsumerSuper() throws Exception {
|
||||
public void testThreadLocalConsumerSuper() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal<? super String>", null));
|
||||
}
|
||||
|
||||
public void testThreadLocalConsumerExtends() throws Exception {
|
||||
public void testThreadLocalConsumerExtends() {
|
||||
doTestFirstParamType("method",
|
||||
myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal<? extends String>", null));
|
||||
}
|
||||
|
||||
@@ -20,63 +20,63 @@ package org.jetbrains.ether;
|
||||
* Date: 26.07.11
|
||||
*/
|
||||
public class AnnotationTest extends IncrementalTestCase {
|
||||
public AnnotationTest() throws Exception {
|
||||
public AnnotationTest() {
|
||||
super("annotations");
|
||||
}
|
||||
|
||||
public void testAddAnnotationTarget() throws Exception {
|
||||
public void testAddAnnotationTarget() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAddAnnotationTypeMemberWithDefaultValue() throws Exception {
|
||||
public void testAddAnnotationTypeMemberWithDefaultValue() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAddAnnotationTypeMemberWithDefaultValue2() throws Exception {
|
||||
public void testAddAnnotationTypeMemberWithDefaultValue2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAddAnnotationTypeMemberWithoutDefaultValue() throws Exception {
|
||||
public void testAddAnnotationTypeMemberWithoutDefaultValue() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAddDefaultToAnnotationMember() throws Exception {
|
||||
public void testAddDefaultToAnnotationMember() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeAnnotationRetentionPolicy() throws Exception {
|
||||
public void testChangeAnnotationRetentionPolicy() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeAnnotationRetentionPolicy1() throws Exception {
|
||||
public void testChangeAnnotationRetentionPolicy1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeAnnotationRetentionPolicy2() throws Exception {
|
||||
public void testChangeAnnotationRetentionPolicy2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeAnnotationRetentionPolicy3() throws Exception {
|
||||
public void testChangeAnnotationRetentionPolicy3() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeAnnotationRetentionPolicy4() throws Exception {
|
||||
public void testChangeAnnotationRetentionPolicy4() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeAnnotationTypeMemberType() throws Exception {
|
||||
public void testChangeAnnotationTypeMemberType() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeAnnotationTypeMemberTypeArray() throws Exception {
|
||||
public void testChangeAnnotationTypeMemberTypeArray() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeAnnotationTypeMemberTypeEnumArray() throws Exception {
|
||||
public void testChangeAnnotationTypeMemberTypeEnumArray() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testClassAsArgument() throws Exception {
|
||||
public void testClassAsArgument() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
@@ -93,31 +93,31 @@ public class AnnotationTest extends IncrementalTestCase {
|
||||
doTest();
|
||||
} */
|
||||
|
||||
public void testRemoveAnnotationTarget() throws Exception {
|
||||
public void testRemoveAnnotationTarget() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRemoveAnnotationTypeMember() throws Exception {
|
||||
public void testRemoveAnnotationTypeMember() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRemoveAnnotationTypeMember1() throws Exception {
|
||||
public void testRemoveAnnotationTypeMember1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRemoveDefaultFromAnnotationMember() throws Exception {
|
||||
public void testRemoveDefaultFromAnnotationMember() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testConservativeNonIncremental() throws Exception {
|
||||
public void testConservativeNonIncremental() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testConservativeNonIncremental1() throws Exception {
|
||||
public void testConservativeNonIncremental1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAnnotationsTracker() throws Exception {
|
||||
public void testAnnotationsTracker() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,35 +20,35 @@ package org.jetbrains.ether;
|
||||
* Date: 09.08.11
|
||||
*/
|
||||
public class ClassModifierTest extends IncrementalTestCase {
|
||||
public ClassModifierTest() throws Exception {
|
||||
public ClassModifierTest() {
|
||||
super("classModifiers");
|
||||
}
|
||||
|
||||
public void testAddStatic() throws Exception {
|
||||
public void testAddStatic() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRemoveStatic() throws Exception {
|
||||
public void testRemoveStatic() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDecAccess() throws Exception {
|
||||
public void testDecAccess() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSetAbstract() throws Exception {
|
||||
public void testSetAbstract() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDropAbstract() throws Exception {
|
||||
public void testDropAbstract() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSetFinal() throws Exception {
|
||||
public void testSetFinal() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSetFinal1() throws Exception {
|
||||
public void testSetFinal1() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,47 +20,47 @@ package org.jetbrains.ether;
|
||||
* Date: 09.08.11
|
||||
*/
|
||||
public class ClassPropertyTest extends IncrementalTestCase {
|
||||
public ClassPropertyTest() throws Exception {
|
||||
public ClassPropertyTest() {
|
||||
super("classProperties");
|
||||
}
|
||||
|
||||
public void testAddExtends() throws Exception {
|
||||
public void testAddExtends() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAddImplements() throws Exception {
|
||||
public void testAddImplements() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeExtends() throws Exception {
|
||||
public void testChangeExtends() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRemoveExtends() throws Exception {
|
||||
public void testRemoveExtends() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRemoveExtendsAffectsFieldAccess() throws Exception {
|
||||
public void testRemoveExtendsAffectsFieldAccess() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRemoveExtendsAffectsMethodAccess() throws Exception {
|
||||
public void testRemoveExtendsAffectsMethodAccess() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRemoveImplements() throws Exception {
|
||||
public void testRemoveImplements() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRemoveImplements2() throws Exception {
|
||||
public void testRemoveImplements2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRemoveImplements3() throws Exception {
|
||||
public void testRemoveImplements3() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeExtends2() throws Exception {
|
||||
public void testChangeExtends2() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ package org.jetbrains.ether;
|
||||
* Date: 09.08.11
|
||||
*/
|
||||
public class ClassRenameTest extends IncrementalTestCase {
|
||||
public ClassRenameTest() throws Exception {
|
||||
public ClassRenameTest() {
|
||||
super("changeName");
|
||||
}
|
||||
|
||||
|
||||
@@ -25,122 +25,122 @@ import org.jetbrains.jps.model.module.JpsModule;
|
||||
* Date: 22.09.11
|
||||
*/
|
||||
public class CommonTest extends IncrementalTestCase {
|
||||
public CommonTest() throws Exception {
|
||||
public CommonTest() {
|
||||
super("common");
|
||||
}
|
||||
|
||||
public void testAnonymous() throws Exception {
|
||||
public void testAnonymous() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeDefinitionToClass() throws Exception {
|
||||
public void testChangeDefinitionToClass() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeDefinitionToClass2() throws Exception {
|
||||
public void testChangeDefinitionToClass2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDeleteClass() throws Exception {
|
||||
public void testDeleteClass() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDeleteClass1() throws Exception {
|
||||
public void testDeleteClass1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDeleteClass2() throws Exception {
|
||||
public void testDeleteClass2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDeleteClassAfterCompileErrors() throws Exception {
|
||||
public void testDeleteClassAfterCompileErrors() {
|
||||
setupInitialProject();
|
||||
|
||||
doTestBuild(2);
|
||||
}
|
||||
|
||||
public void testDontMarkDependentsAfterCompileErrors() throws Exception {
|
||||
public void testDontMarkDependentsAfterCompileErrors() {
|
||||
setupInitialProject();
|
||||
|
||||
doTestBuild(2);
|
||||
}
|
||||
|
||||
public void testDeleteClassPackageDoesntMatchRoot() throws Exception {
|
||||
public void testDeleteClassPackageDoesntMatchRoot() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInner() throws Exception {
|
||||
public void testInner() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNoResourceDelete() throws Exception {
|
||||
public void testNoResourceDelete() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNoSecondFileCompile() throws Exception {
|
||||
public void testNoSecondFileCompile() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNoSecondFileCompile1() throws Exception {
|
||||
public void testNoSecondFileCompile1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDependencyUpdate() throws Exception {
|
||||
public void testDependencyUpdate() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testClass2Interface1() throws Exception {
|
||||
public void testClass2Interface1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testClass2Interface2() throws Exception {
|
||||
public void testClass2Interface2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testClass2Interface3() throws Exception {
|
||||
public void testClass2Interface3() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDeleteClass3() throws Exception {
|
||||
public void testDeleteClass3() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDeleteClass4() throws Exception {
|
||||
public void testDeleteClass4() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDeleteInnerClass() throws Exception {
|
||||
public void testDeleteInnerClass() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDeleteInnerClass1() throws Exception {
|
||||
public void testDeleteInnerClass1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAddClass() throws Exception {
|
||||
public void testAddClass() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAddDuplicateClass() throws Exception {
|
||||
public void testAddDuplicateClass() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAddClassHidingImportedClass() throws Exception {
|
||||
public void testAddClassHidingImportedClass() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAddClassHidingImportedClass2() throws Exception {
|
||||
public void testAddClassHidingImportedClass2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMoveClassToDependentModule() throws Exception {
|
||||
public void testMoveClassToDependentModule() {
|
||||
JpsModule moduleA = addModule("moduleA", "moduleA/src");
|
||||
JpsModule moduleB = addModule("moduleB", "moduleB/src");
|
||||
JpsModuleRootModificationUtil.addDependency(moduleB, moduleA);
|
||||
doTestBuild(1).assertSuccessful();
|
||||
}
|
||||
|
||||
public void testMoveClassToDependentModuleWithSameOutput() throws Exception {
|
||||
public void testMoveClassToDependentModuleWithSameOutput() {
|
||||
final JpsSdk<JpsDummyElement> sdk = getOrCreateJdk();
|
||||
final String commonOutput = getAbsolutePath("out");
|
||||
JpsModule moduleA = addModule("moduleA", new String[]{getAbsolutePath("moduleA/src")}, commonOutput, commonOutput, sdk);
|
||||
@@ -149,32 +149,32 @@ public class CommonTest extends IncrementalTestCase {
|
||||
doTestBuild(1).assertSuccessful();
|
||||
}
|
||||
|
||||
public void testMoveClassFromJavaFileToDependentModule() throws Exception {
|
||||
public void testMoveClassFromJavaFileToDependentModule() {
|
||||
JpsModule moduleA = addModule("moduleA", "moduleA/src");
|
||||
JpsModule moduleB = addModule("moduleB", "moduleB/src");
|
||||
JpsModuleRootModificationUtil.addDependency(moduleB, moduleA);
|
||||
doTestBuild(1).assertSuccessful();
|
||||
}
|
||||
|
||||
public void testCompileDependenciesOnMovedClassesInFirstRound() throws Exception {
|
||||
public void testCompileDependenciesOnMovedClassesInFirstRound() {
|
||||
doTest().assertSuccessful();
|
||||
}
|
||||
|
||||
public void testIntegrateOnSuperclassRemovedAndRestored() throws Exception {
|
||||
public void testIntegrateOnSuperclassRemovedAndRestored() {
|
||||
setupInitialProject();
|
||||
|
||||
doTestBuild(2);
|
||||
}
|
||||
|
||||
public void testMoveToplevelClassToAnotherFile() throws Exception {
|
||||
public void testMoveToplevelClassToAnotherFile() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMoveClassToAnotherRoot() throws Exception {
|
||||
public void testMoveClassToAnotherRoot() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIntegrateOnNonIncrementalMake() throws Exception {
|
||||
public void testIntegrateOnNonIncrementalMake() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
@@ -20,35 +20,35 @@ package org.jetbrains.ether;
|
||||
* Date: 23.09.11
|
||||
*/
|
||||
public class FieldModifierTest extends IncrementalTestCase {
|
||||
public FieldModifierTest() throws Exception {
|
||||
public FieldModifierTest() {
|
||||
super("fieldModifiers");
|
||||
}
|
||||
|
||||
public void testSetFinal() throws Exception {
|
||||
public void testSetFinal() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSetPrivate() throws Exception {
|
||||
public void testSetPrivate() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSetPrivateToConstantField() throws Exception {
|
||||
public void testSetPrivateToConstantField() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSetProtected() throws Exception {
|
||||
public void testSetProtected() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSetStatic() throws Exception {
|
||||
public void testSetStatic() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUnsetStatic() throws Exception {
|
||||
public void testUnsetStatic() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUnsetStaticFinal() throws Exception {
|
||||
public void testUnsetStaticFinal() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,23 +23,23 @@ import org.jetbrains.jps.model.module.JpsModule;
|
||||
* Date: 23.09.11
|
||||
*/
|
||||
public class FieldPropertyTest extends IncrementalTestCase {
|
||||
public FieldPropertyTest() throws Exception {
|
||||
public FieldPropertyTest() {
|
||||
super("fieldProperties");
|
||||
}
|
||||
|
||||
public void testConstantChain() throws Exception {
|
||||
public void testConstantChain() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testConstantChain1() throws Exception {
|
||||
public void testConstantChain1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testConstantChain2() throws Exception {
|
||||
public void testConstantChain2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testConstantChainMultiModule() throws Exception {
|
||||
public void testConstantChainMultiModule() {
|
||||
JpsModule moduleA = addModule("moduleA", "moduleA/src");
|
||||
JpsModule moduleB = addModule("moduleB", "moduleB/src");
|
||||
JpsModule moduleC = addModule("moduleC", "moduleC/src");
|
||||
@@ -48,78 +48,78 @@ public class FieldPropertyTest extends IncrementalTestCase {
|
||||
doTestBuild(1).assertSuccessful();
|
||||
}
|
||||
|
||||
public void testConstantRemove() throws Exception {
|
||||
public void testConstantRemove() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testConstantRemove1() throws Exception {
|
||||
public void testConstantRemove1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDoubleConstantChange() throws Exception {
|
||||
public void testDoubleConstantChange() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testFloatConstantChange() throws Exception {
|
||||
public void testFloatConstantChange() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInnerConstantChange() throws Exception {
|
||||
public void testInnerConstantChange() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIntConstantChange() throws Exception {
|
||||
public void testIntConstantChange() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIntNonStaticConstantChange() throws Exception {
|
||||
public void testIntNonStaticConstantChange() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testLongConstantChange() throws Exception {
|
||||
public void testLongConstantChange() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNonCompileTimeConstant() throws Exception {
|
||||
public void testNonCompileTimeConstant() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testStringConstantChange() throws Exception {
|
||||
public void testStringConstantChange() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testStringConstantLessAccessible() throws Exception {
|
||||
public void testStringConstantLessAccessible() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTypeChange() throws Exception {
|
||||
public void testTypeChange() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTypeChange1() throws Exception {
|
||||
public void testTypeChange1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTypeChange2() throws Exception {
|
||||
public void testTypeChange2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNonIncremental1() throws Exception {
|
||||
public void testNonIncremental1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNonIncremental2() throws Exception {
|
||||
public void testNonIncremental2() {
|
||||
doTest();
|
||||
}
|
||||
//public void testNonIncremental3() throws Exception {
|
||||
// doTest();
|
||||
// }
|
||||
|
||||
public void testNonIncremental4() throws Exception {
|
||||
public void testNonIncremental4() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMutualConstants() throws Exception {
|
||||
public void testMutualConstants() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,63 +20,63 @@ package org.jetbrains.ether;
|
||||
* Date: 26.09.11
|
||||
*/
|
||||
public class GenericTest extends IncrementalTestCase {
|
||||
public GenericTest() throws Exception {
|
||||
public GenericTest() {
|
||||
super("generics");
|
||||
}
|
||||
|
||||
public void testAddMethodToBase() throws Exception {
|
||||
public void testAddMethodToBase() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAddParameterizedMethodToBase() throws Exception {
|
||||
public void testAddParameterizedMethodToBase() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeBound() throws Exception {
|
||||
public void testChangeBound() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeBound1() throws Exception {
|
||||
public void testChangeBound1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeBoundClass1() throws Exception {
|
||||
public void testChangeBoundClass1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeBoundedClass() throws Exception {
|
||||
public void testChangeBoundedClass() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeBoundInterface1() throws Exception {
|
||||
public void testChangeBoundInterface1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeExtends() throws Exception {
|
||||
public void testChangeExtends() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeExtends1() throws Exception {
|
||||
public void testChangeExtends1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeExtends2() throws Exception {
|
||||
public void testChangeExtends2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeImplements() throws Exception {
|
||||
public void testChangeImplements() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeInterfaceTypeParameter() throws Exception {
|
||||
public void testChangeInterfaceTypeParameter() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeToCovariantMethodInBase() throws Exception {
|
||||
public void testChangeToCovariantMethodInBase() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeToCovariantMethodInBase2() throws Exception {
|
||||
public void testChangeToCovariantMethodInBase2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
@@ -85,72 +85,72 @@ public class GenericTest extends IncrementalTestCase {
|
||||
doTest();
|
||||
}
|
||||
*/
|
||||
public void testChangeVarargSignature() throws Exception {
|
||||
public void testChangeVarargSignature() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeVarargSignature1() throws Exception {
|
||||
public void testChangeVarargSignature1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCovariance() throws Exception {
|
||||
public void testCovariance() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCovariance1() throws Exception {
|
||||
public void testCovariance1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCovariance2() throws Exception {
|
||||
public void testCovariance2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCovarianceNoChanges() throws Exception {
|
||||
public void testCovarianceNoChanges() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDegenerify() throws Exception {
|
||||
public void testDegenerify() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDegenerify1() throws Exception {
|
||||
public void testDegenerify1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testFieldTypeChange() throws Exception {
|
||||
public void testFieldTypeChange() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testOverrideAnnotatedAnonymous() throws Exception {
|
||||
public void testOverrideAnnotatedAnonymous() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
/* Not working yet */
|
||||
public void testOverrideAnnotatedAnonymousNotRecompile() throws Exception {
|
||||
public void testOverrideAnnotatedAnonymousNotRecompile() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testOverrideAnnotatedInner() throws Exception {
|
||||
public void testOverrideAnnotatedInner() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testParamTypes() throws Exception {
|
||||
public void testParamTypes() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testReturnType() throws Exception {
|
||||
public void testReturnType() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testArgumentContainment() throws Exception {
|
||||
public void testArgumentContainment() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testArgumentContainment2() throws Exception {
|
||||
public void testArgumentContainment2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testArgumentContainment3() throws Exception {
|
||||
public void testArgumentContainment3() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ package org.jetbrains.ether;
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class ImportTest { //extends IncrementalTestCase {
|
||||
public ImportTest() throws Exception {
|
||||
public ImportTest() {
|
||||
//super("imports");
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public abstract class IncrementalTestCase extends JpsBuildTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected File doGetProjectDir() throws IOException {
|
||||
protected File doGetProjectDir() {
|
||||
return workDir;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.jetbrains.jps.model.module.JpsModule;
|
||||
* Date: 04.10.11
|
||||
*/
|
||||
public class MarkDirtyTest extends IncrementalTestCase {
|
||||
public MarkDirtyTest() throws Exception {
|
||||
public MarkDirtyTest() {
|
||||
super("markDirty");
|
||||
}
|
||||
|
||||
|
||||
@@ -20,44 +20,44 @@ package org.jetbrains.ether;
|
||||
* Date: 04.10.11
|
||||
*/
|
||||
public class MethodModifierTest extends IncrementalTestCase {
|
||||
public MethodModifierTest() throws Exception {
|
||||
public MethodModifierTest() {
|
||||
super("methodModifiers");
|
||||
}
|
||||
|
||||
public void testDecConstructorAccess() throws Exception {
|
||||
public void testDecConstructorAccess() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIncAccess() throws Exception {
|
||||
public void testIncAccess() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSetAbstract() throws Exception {
|
||||
public void testSetAbstract() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSetFinal() throws Exception {
|
||||
public void testSetFinal() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSetPrivate() throws Exception {
|
||||
public void testSetPrivate() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSetProtected() throws Exception {
|
||||
public void testSetProtected() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
|
||||
public void testUnsetFinal() throws Exception {
|
||||
public void testUnsetFinal() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUnsetStatic() throws Exception {
|
||||
public void testUnsetStatic() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSetStatic() throws Exception {
|
||||
public void testSetStatic() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,19 +22,19 @@ import com.intellij.openapi.util.SystemInfo;
|
||||
* Date: 05.10.11
|
||||
*/
|
||||
public class MethodPropertyTest extends IncrementalTestCase {
|
||||
public MethodPropertyTest() throws Exception {
|
||||
public MethodPropertyTest() {
|
||||
super("methodProperties");
|
||||
}
|
||||
|
||||
public void testAddThrows() throws Exception {
|
||||
public void testAddThrows() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeReturnType() throws Exception {
|
||||
public void testChangeReturnType() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeMethodRefReturnType() throws Exception {
|
||||
public void testChangeMethodRefReturnType() {
|
||||
if (SystemInfo.isJavaVersionAtLeast("1.8")) {
|
||||
doTest();
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class MethodPropertyTest extends IncrementalTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testChangeLambdaTargetReturnType() throws Exception {
|
||||
public void testChangeLambdaTargetReturnType() {
|
||||
if (SystemInfo.isJavaVersionAtLeast("1.8")) {
|
||||
doTest();
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class MethodPropertyTest extends IncrementalTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testChangeSAMMethodSignature() throws Exception {
|
||||
public void testChangeSAMMethodSignature() {
|
||||
if (SystemInfo.isJavaVersionAtLeast("1.8")) {
|
||||
doTest();
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class MethodPropertyTest extends IncrementalTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testChangeLambdaSAMMethodSignature() throws Exception {
|
||||
public void testChangeLambdaSAMMethodSignature() {
|
||||
if (SystemInfo.isJavaVersionAtLeast("1.8")) {
|
||||
doTest();
|
||||
}
|
||||
@@ -70,15 +70,15 @@ public class MethodPropertyTest extends IncrementalTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testChangeReturnType1() throws Exception {
|
||||
public void testChangeReturnType1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeSignature() throws Exception {
|
||||
public void testChangeSignature() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testChangeSignature1() throws Exception {
|
||||
public void testChangeSignature1() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,19 +20,19 @@ package org.jetbrains.ether;
|
||||
* Date: 04.10.11
|
||||
*/
|
||||
public class PackageInfoTest extends IncrementalTestCase {
|
||||
public PackageInfoTest() throws Exception {
|
||||
public PackageInfoTest() {
|
||||
super("packageInfo");
|
||||
}
|
||||
|
||||
public void testPackageInfoNoRecompile() throws Exception {
|
||||
public void testPackageInfoNoRecompile() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPackageInfoNoRecompile2() throws Exception {
|
||||
public void testPackageInfoNoRecompile2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPackageInfoRecompileOnConstantChange() throws Exception {
|
||||
public void testPackageInfoRecompileOnConstantChange() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -359,7 +359,7 @@ public class ArtifactBuilderTest extends ArtifactBuilderTestCase {
|
||||
assertOutput(artifact, fs().file("A.class"));
|
||||
}
|
||||
|
||||
public void testClearOutputOnRebuild() throws IOException {
|
||||
public void testClearOutputOnRebuild() {
|
||||
String file = createFile("d/a.txt");
|
||||
JpsArtifact a = addArtifact(root().parentDirCopy(file));
|
||||
buildAll();
|
||||
@@ -371,7 +371,7 @@ public class ArtifactBuilderTest extends ArtifactBuilderTestCase {
|
||||
assertOutput(a, fs().file("a.txt").file("b.txt"));
|
||||
}
|
||||
|
||||
public void testDeleteOnlyOutputFileOnRebuildForArchiveArtifact() throws IOException {
|
||||
public void testDeleteOnlyOutputFileOnRebuildForArchiveArtifact() {
|
||||
String file = createFile("a.txt");
|
||||
JpsArtifact a = addArtifact(archive("a.jar").fileCopy(file));
|
||||
buildAll();
|
||||
|
||||
+6
-6
@@ -120,7 +120,7 @@ public class IncrementalArtifactBuildingTest extends ArtifactBuilderTestCase {
|
||||
buildAllAndAssertUpToDate();
|
||||
}
|
||||
|
||||
public void testNonExistentFileRoot() throws IOException {
|
||||
public void testNonExistentFileRoot() {
|
||||
String file = getAbsolutePath("a.txt");
|
||||
JpsArtifact a = addArtifact(root().fileCopy(file));
|
||||
buildArtifacts(a);
|
||||
@@ -138,7 +138,7 @@ public class IncrementalArtifactBuildingTest extends ArtifactBuilderTestCase {
|
||||
buildAllAndAssertUpToDate();
|
||||
}
|
||||
|
||||
public void testNonExistentDirectoryRoot() throws IOException {
|
||||
public void testNonExistentDirectoryRoot() {
|
||||
String dir = getAbsolutePath("d");
|
||||
JpsArtifact a = addArtifact(root().dirCopy(dir));
|
||||
buildArtifacts(a);
|
||||
@@ -267,7 +267,7 @@ public class IncrementalArtifactBuildingTest extends ArtifactBuilderTestCase {
|
||||
assertDeletedAndCopied("out/artifacts/a/x.jar", "a/a.txt");
|
||||
}
|
||||
|
||||
public void testRenameFile() throws Exception {
|
||||
public void testRenameFile() {
|
||||
final String file = createFile("a/a.txt");
|
||||
final JpsArtifact a = addArtifact(root().parentDirCopy(file));
|
||||
buildAll();
|
||||
@@ -279,7 +279,7 @@ public class IncrementalArtifactBuildingTest extends ArtifactBuilderTestCase {
|
||||
}
|
||||
|
||||
//IDEADEV-25840
|
||||
public void testUpdateFileIfCaseOfLetterInNameChanged() throws Exception {
|
||||
public void testUpdateFileIfCaseOfLetterInNameChanged() {
|
||||
final String file = createFile("a/a.txt");
|
||||
final JpsArtifact a = addArtifact("a", root().parentDirCopy(file));
|
||||
buildAll();
|
||||
@@ -291,7 +291,7 @@ public class IncrementalArtifactBuildingTest extends ArtifactBuilderTestCase {
|
||||
}
|
||||
|
||||
//IDEADEV-41556
|
||||
public void testDeleteFilesFromSelectedArtifactsOnly() throws Exception {
|
||||
public void testDeleteFilesFromSelectedArtifactsOnly() {
|
||||
final String file = createFile("a/a.txt");
|
||||
final JpsArtifact a1 = addArtifact("a1", root().parentDirCopy(file));
|
||||
final JpsArtifact a2 = addArtifact("a2", root().parentDirCopy(file));
|
||||
@@ -311,7 +311,7 @@ public class IncrementalArtifactBuildingTest extends ArtifactBuilderTestCase {
|
||||
}
|
||||
|
||||
//IDEA-51910
|
||||
public void testTwoArtifactsWithSameOutput() throws Exception {
|
||||
public void testTwoArtifactsWithSameOutput() {
|
||||
final String res1 = PathUtil.getParentPath(createFile("res1/a.txt", "1"));
|
||||
final String res2 = PathUtil.getParentPath(createFile("res2/a.txt", "2"));
|
||||
final JpsArtifact a1 = addArtifact("a1", root().dirCopy(res1));
|
||||
|
||||
@@ -25,7 +25,6 @@ import org.jetbrains.jps.model.module.JpsModule;
|
||||
import org.jetbrains.jps.util.JpsPathUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
@@ -40,7 +39,7 @@ public class ModuleExcludeIndexTest extends JpsJavaModelTestCase {
|
||||
myRoot = FileUtil.createTempDirectory("excludes", null);
|
||||
}
|
||||
|
||||
public void testProjectOutput() throws IOException {
|
||||
public void testProjectOutput() {
|
||||
File out = new File(myRoot, "out");
|
||||
getJavaService().getOrCreateProjectExtension(myProject).setOutputUrl(JpsPathUtil.pathToUrl(out.getAbsolutePath()));
|
||||
JpsModule module1 = addModule();
|
||||
|
||||
@@ -58,7 +58,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase {
|
||||
return jdk;
|
||||
}
|
||||
|
||||
public void testLibrary() throws Exception {
|
||||
public void testLibrary() {
|
||||
JpsModuleRootModificationUtil.addDependency(myModule, createJDomLibrary());
|
||||
|
||||
assertClassRoots(dependencies(myModule), getRtJarJdk17(), getJDomJar());
|
||||
@@ -109,7 +109,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase {
|
||||
return library;
|
||||
}
|
||||
|
||||
public void testModuleSources() throws Exception {
|
||||
public void testModuleSources() {
|
||||
final String srcRoot = addSourceRoot(myModule, false);
|
||||
final String testRoot = addSourceRoot(myModule, true);
|
||||
final String output = setModuleOutput(myModule, false);
|
||||
@@ -124,7 +124,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase {
|
||||
assertEnumeratorRoots(dependencies(myModule).withoutSdk().productionOnly().classes().withoutSelfModuleOutput());
|
||||
}
|
||||
|
||||
public void testLibraryScope() throws Exception {
|
||||
public void testLibraryScope() {
|
||||
JpsLibraryDependency dependency = myModule.getDependenciesList().addLibraryDependency(createJDomLibrary());
|
||||
getJavaService().getOrCreateDependencyExtension(dependency).setScope(JpsJavaDependencyScope.RUNTIME);
|
||||
JpsModuleRootModificationUtil.addDependency(myModule, createJDomLibrary(), JpsJavaDependencyScope.RUNTIME, false);
|
||||
@@ -134,7 +134,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase {
|
||||
assertClassRoots(dependencies(myModule).withoutSdk().compileOnly());
|
||||
}
|
||||
|
||||
public void testModuleDependency() throws Exception {
|
||||
public void testModuleDependency() {
|
||||
final JpsModule dep = addModule("dep");
|
||||
final String depSrcRoot = addSourceRoot(dep, false);
|
||||
final String depTestRoot = addSourceRoot(dep, true);
|
||||
@@ -171,7 +171,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase {
|
||||
assertEnumeratorRoots(dependencies(myModule).productionOnly().withoutModuleSourceEntries().withoutSdk().withoutDepModules().classes());
|
||||
}
|
||||
|
||||
public void testModuleJpsJavaDependencyScope() throws Exception {
|
||||
public void testModuleJpsJavaDependencyScope() {
|
||||
final JpsModule dep = addModule("dep");
|
||||
JpsModuleRootModificationUtil.addDependency(dep, createJDomLibrary(), JpsJavaDependencyScope.COMPILE, true);
|
||||
JpsModuleRootModificationUtil.addDependency(myModule, dep, JpsJavaDependencyScope.TEST, true);
|
||||
@@ -185,7 +185,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase {
|
||||
assertClassRoots(dependencies(myProject).withoutSdk().productionOnly(), getJDomJar());
|
||||
}
|
||||
|
||||
public void testNotExportedLibrary() throws Exception {
|
||||
public void testNotExportedLibrary() {
|
||||
final JpsModule dep = addModule("dep");
|
||||
JpsModuleRootModificationUtil.addDependency(dep, createJDomLibrary(), JpsJavaDependencyScope.COMPILE, false);
|
||||
JpsModuleRootModificationUtil.addDependency(myModule, createAsmLibrary(), JpsJavaDependencyScope.COMPILE, false);
|
||||
@@ -209,7 +209,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase {
|
||||
assertEnumeratorRoots(dependencies(myModule).annotations(), moduleUrl, libraryUrl);
|
||||
}
|
||||
|
||||
public void testJdkIsNotExported() throws Exception {
|
||||
public void testJdkIsNotExported() {
|
||||
assertClassRoots(dependencies(myModule).exportedOnly());
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase {
|
||||
assertClassRoots(dependencies(dep).recursively(), getRtJarJdk18());
|
||||
}
|
||||
|
||||
public void testProject() throws Exception {
|
||||
public void testProject() {
|
||||
JpsModuleRootModificationUtil.addDependency(myModule, createJDomLibrary());
|
||||
|
||||
final String srcRoot = addSourceRoot(myModule, false);
|
||||
@@ -234,7 +234,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase {
|
||||
assertSourceRoots(dependencies(myProject).withoutSdk(), srcRoot, testRoot, getJDomSources());
|
||||
}
|
||||
|
||||
public void testModules() throws Exception {
|
||||
public void testModules() {
|
||||
JpsModuleRootModificationUtil.addDependency(myModule, createJDomLibrary());
|
||||
|
||||
final String srcRoot = addSourceRoot(myModule, false);
|
||||
|
||||
@@ -21,31 +21,31 @@ public class JsonCompletionTest extends JsonTestCase {
|
||||
myFixture.checkResultByFile("completion/" + getTestName(false) + "_after.json" );
|
||||
}
|
||||
|
||||
public void testInsideArrayElement1() throws Exception {
|
||||
public void testInsideArrayElement1() {
|
||||
doTest(ALL_KEYWORDS);
|
||||
}
|
||||
|
||||
public void testInsideArrayElement2() throws Exception {
|
||||
public void testInsideArrayElement2() {
|
||||
doTest(ALL_KEYWORDS);
|
||||
}
|
||||
|
||||
public void testInsidePropertyKey1() throws Exception {
|
||||
public void testInsidePropertyKey1() {
|
||||
doTest(NOTHING);
|
||||
}
|
||||
|
||||
public void testInsidePropertyKey2() throws Exception {
|
||||
public void testInsidePropertyKey2() {
|
||||
doTest(NOTHING);
|
||||
}
|
||||
|
||||
public void testInsideStringLiteral1() throws Exception {
|
||||
public void testInsideStringLiteral1() {
|
||||
doTest(NOTHING);
|
||||
}
|
||||
|
||||
public void testInsideStringLiteral2() throws Exception {
|
||||
public void testInsideStringLiteral2() {
|
||||
doTest(NOTHING);
|
||||
}
|
||||
|
||||
public void testInsidePropertyValue() throws Exception {
|
||||
public void testInsidePropertyValue() {
|
||||
doTest(ALL_KEYWORDS);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,17 +55,17 @@ public class JsonHighlightingTest extends JsonTestCase {
|
||||
|
||||
// Moved from JavaScript
|
||||
|
||||
public void testJSON_with_comment() throws Exception {
|
||||
public void testJSON_with_comment() {
|
||||
enableStandardComplianceInspection(false, true);
|
||||
doTestHighlighting(false, true, true);
|
||||
}
|
||||
|
||||
public void testJSON() throws Exception {
|
||||
public void testJSON() {
|
||||
enableStandardComplianceInspection(true, true);
|
||||
doTestHighlighting(false, true, true);
|
||||
}
|
||||
|
||||
public void testSemanticHighlighting() throws Exception {
|
||||
public void testSemanticHighlighting() {
|
||||
// WEB-11239
|
||||
doTest();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class JsonLexerTest extends LexerTestCase {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void testEscapeSlash() throws Exception {
|
||||
public void testEscapeSlash() {
|
||||
// WEB-2803
|
||||
doTest("[\"\\/\",-1,\"\\n\", 1]",
|
||||
"[ ('[')\n" +
|
||||
|
||||
@@ -22,7 +22,7 @@ public class JsonParsingTest extends ParsingTestCase {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testKeywords() throws Exception {
|
||||
public void testKeywords() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class JsonPsiUtilTest extends JsonTestCase {
|
||||
myFixture.checkResult(after);
|
||||
}
|
||||
|
||||
public void testGetOtherSiblingPropertyNames() throws Exception {
|
||||
public void testGetOtherSiblingPropertyNames() {
|
||||
myFixture.configureByText(JsonFileType.INSTANCE, "{\"firs<caret>t\" : 1, \"second\" : 2}");
|
||||
PsiElement atCaret = myFixture.getFile().findElementAt(myFixture.getCaretOffset());
|
||||
JsonProperty property = PsiTreeUtil.getParentOfType(atCaret, JsonProperty.class);
|
||||
|
||||
@@ -18,7 +18,7 @@ public class JsonSmartEnterTest extends JsonTestCase {
|
||||
final List<SmartEnterProcessor> processors = SmartEnterProcessors.INSTANCE.forKey(JsonLanguage.INSTANCE);
|
||||
new WriteCommandAction(myFixture.getProject()) {
|
||||
@Override
|
||||
protected void run(@NotNull Result result) throws Throwable {
|
||||
protected void run(@NotNull Result result) {
|
||||
final Editor editor = myFixture.getEditor();
|
||||
for (SmartEnterProcessor processor : processors) {
|
||||
processor.process(myFixture.getProject(), editor, myFixture.getFile());
|
||||
|
||||
@@ -48,7 +48,7 @@ public abstract class JsonBySchemaDocumentationBaseTest extends JsonSchemaHeavyA
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "/" + getTestName(true) + "." + extension, "/" + getTestName(true) + "Schema.json");
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "/completion.json", "/baseSchema.json", "/inheritedSchema.json");
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "/baseCompletion.json", "/basePropertiesSchema.json");
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "/completion.json", "/baseSchema.json", "/inheritedSchema.json");
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "/referencingSchema.json", "/localRefSchema.json");
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "/referencingGlobalSchema.json");
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "/testFileForBaseProperties.json", "/basePropertiesSchema.json");
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "/refToDefinitionInFileSchema.json", "/definitionsSchema.json");
|
||||
}
|
||||
|
||||
@@ -351,7 +351,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "/refToOtherFileSchema.json", "/definitionsSchema.json");
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "/package.json", "/packageJsonSchema.json");
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "/testNestedDefinitionsNavigation.json", "/nestedDefinitionsSchema.json");
|
||||
}
|
||||
|
||||
@@ -438,7 +438,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "/testNestedAllOfOneOfDefinitions.json", "/nestedAllOfOneOfDefinitionsSchema.json");
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, prefix + "testNavigation.json", prefix + "baseSchema.json", prefix + "referentSchema.json");
|
||||
}
|
||||
|
||||
@@ -498,7 +498,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, prefix + "testCompletion.json", prefix + "baseSchema.json", prefix + "referentSchema.json");
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, prefix + "testHighlighting.json", prefix + "baseSchema.json", prefix + "referentSchema.json");
|
||||
}
|
||||
|
||||
@@ -544,7 +544,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "withReferenceToDefinitionSchema.json");
|
||||
}
|
||||
|
||||
@@ -578,7 +578,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "completionInsideSchemaDefinition.json");
|
||||
}
|
||||
|
||||
@@ -603,7 +603,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "navigateFromSchemaDefinitionToMainSchema.json");
|
||||
}
|
||||
|
||||
@@ -622,7 +622,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
});
|
||||
}
|
||||
|
||||
public void testNavigateToRefInsideMainSchema() throws Exception {
|
||||
public void testNavigateToRefInsideMainSchema() {
|
||||
final JsonSchemaService service = JsonSchemaService.Impl.get(myProject);
|
||||
final List<JsonSchemaFileProvider> providers = new JsonSchemaProjectSelfProviderFactory().getProviders(myProject);
|
||||
Assert.assertEquals(1, providers.size());
|
||||
@@ -667,7 +667,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "withIncorrectReferenceSchema.json");
|
||||
}
|
||||
|
||||
@@ -710,7 +710,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "insideCycledSchemaNavigationSchema.json");
|
||||
}
|
||||
|
||||
@@ -732,7 +732,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "testNavigationIntoCycled.json", "cycledSchema.json");
|
||||
}
|
||||
|
||||
@@ -754,7 +754,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "navigationWithCompositeDefinitionsObjectSchema.json");
|
||||
}
|
||||
|
||||
@@ -780,7 +780,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "navigationIntoWithCompositeDefinitionsObjectSchema.json",
|
||||
"navigationWithCompositeDefinitionsObjectSchema.json");
|
||||
}
|
||||
@@ -803,7 +803,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "completionWithRootRef.json", "cycledWithRootRefSchema.json");
|
||||
complete();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.junit.Assert;
|
||||
* @author Irina.Chernushina on 2/17/2016.
|
||||
*/
|
||||
public class JsonSchemaPatternComparatorTest extends LightPlatformCodeInsightFixtureTestCase {
|
||||
public void testPatterns() throws Exception {
|
||||
public void testPatterns() {
|
||||
final JsonSchemaPatternComparator comparator = new JsonSchemaPatternComparator(getProject());
|
||||
Assert.assertEquals(ThreeState.YES, comparator.isSimilar(p("test"), p("test")));
|
||||
Assert.assertEquals(ThreeState.YES, comparator.isSimilar(p("test"), p("tes*")));
|
||||
@@ -37,7 +37,7 @@ public class JsonSchemaPatternComparatorTest extends LightPlatformCodeInsightFix
|
||||
Assert.assertEquals(ThreeState.UNSURE, comparator.isSimilar(p("two*words"), p("circus")));
|
||||
}
|
||||
|
||||
public void test2Files() throws Exception {
|
||||
public void test2Files() {
|
||||
final JsonSchemaPatternComparator comparator = new JsonSchemaPatternComparator(getProject());
|
||||
Assert.assertEquals(ThreeState.YES, comparator.isSimilar(f("test"), f("test")));
|
||||
Assert.assertEquals(ThreeState.YES, comparator.isSimilar(f("./test"), f("test")));
|
||||
@@ -46,7 +46,7 @@ public class JsonSchemaPatternComparatorTest extends LightPlatformCodeInsightFix
|
||||
Assert.assertEquals(ThreeState.YES, comparator.isSimilar(f("one/../one/two"), f("one/two")));
|
||||
}
|
||||
|
||||
public void test2Dirs() throws Exception {
|
||||
public void test2Dirs() {
|
||||
final JsonSchemaPatternComparator comparator = new JsonSchemaPatternComparator(getProject());
|
||||
Assert.assertEquals(ThreeState.YES, comparator.isSimilar(d("test"), d("test")));
|
||||
Assert.assertEquals(ThreeState.YES, comparator.isSimilar(d("./test"), d("test")));
|
||||
@@ -57,7 +57,7 @@ public class JsonSchemaPatternComparatorTest extends LightPlatformCodeInsightFix
|
||||
Assert.assertEquals(ThreeState.YES, comparator.isSimilar(d("test/child"), d("test")));
|
||||
}
|
||||
|
||||
public void testDirAndFile() throws Exception {
|
||||
public void testDirAndFile() {
|
||||
final JsonSchemaPatternComparator comparator = new JsonSchemaPatternComparator(getProject());
|
||||
Assert.assertEquals(ThreeState.NO, comparator.isSimilar(d("test"), f("test")));
|
||||
Assert.assertEquals(ThreeState.YES, comparator.isSimilar(d("test"), f("test/lower")));
|
||||
|
||||
@@ -44,7 +44,7 @@ public class JsonSchemaSelfHighligthingTest extends JsonSchemaHeavyAbstractTest
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "/patternSchema.json");
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ public class JsonBySchemaHeavyCompletionTest extends JsonSchemaHeavyAbstractTest
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureFiles() throws Exception {
|
||||
public void configureFiles() {
|
||||
configureByFiles(null, "/" + folder + "/" + testFile + ".json", "/" + folder + "/Schema.json");
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class JsonSchemaReadTest extends CompletionTestCase {
|
||||
Assert.assertEquals("#/definitions/positiveIntegerDefault0", minLength.getRef());
|
||||
}
|
||||
|
||||
public void testMainSchemaHighlighting() throws Exception {
|
||||
public void testMainSchemaHighlighting() {
|
||||
final JsonSchemaService service = JsonSchemaService.Impl.get(myProject);
|
||||
final List<JsonSchemaFileProvider> providers = new JsonSchemaProjectSelfProviderFactory().getProviders(myProject);
|
||||
Assert.assertEquals(1, providers.size());
|
||||
|
||||
+4
-4
@@ -11,20 +11,20 @@ import static com.intellij.testFramework.assertions.Assertions.assertThat;
|
||||
|
||||
@SuppressWarnings({"deprecation"})
|
||||
public class XmlSerializerWithDefaultJDOMExternalizerCompatibilityTest extends TestCase {
|
||||
public void testCompatibility() throws Exception {
|
||||
public void testCompatibility() {
|
||||
assertCompatibleSerialization(new MyBean());
|
||||
}
|
||||
|
||||
private static void assertCompatibleSerialization(final Object data) throws Exception {
|
||||
private static void assertCompatibleSerialization(final Object data) {
|
||||
assertThat(serializeWithJDom(data)).isEqualTo(serializeWithXmlSerializer(data));
|
||||
}
|
||||
|
||||
private static String serializeWithXmlSerializer(final Object data) throws Exception {
|
||||
private static String serializeWithXmlSerializer(final Object data) {
|
||||
Element element = serialize(data);
|
||||
return StringUtil.trimStart(JDOMUtil.writeElement(element), "<?xml version=\"1.0\" encoding=\"UTF-8\"?>").trim();
|
||||
}
|
||||
|
||||
private static String serializeWithJDom(final Object data) throws Exception {
|
||||
private static String serializeWithJDom(final Object data) {
|
||||
final Element jDomRoot = new Element("MyBean");
|
||||
|
||||
if (data instanceof com.intellij.openapi.util.JDOMExternalizable) {
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public class ExtensionPointImplTest {
|
||||
private static final TestLogProvider ourTestLog = new TestLogProvider();
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
public void tearDown() {
|
||||
ourTestLog.errors();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import static org.junit.Assert.assertEquals;
|
||||
*/
|
||||
public class ExtensionsAreaTest {
|
||||
@Test
|
||||
public void testGetComponentAdapterDoesntDuplicateAdapters() throws Exception {
|
||||
public void testGetComponentAdapterDoesntDuplicateAdapters() {
|
||||
MutablePicoContainer picoContainer =
|
||||
new ExtensionsAreaImpl("foo", null, new DefaultPicoContainer(), new Extensions.SimpleLogProvider()).getPicoContainer();
|
||||
picoContainer.registerComponentImplementation("runnable", ExtensionsAreaTest.class);
|
||||
|
||||
+3
-3
@@ -39,14 +39,14 @@ public class ExtensionsComplexTest {
|
||||
private List<MyAreaInstance> myAreasToDispose;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
myAreasToDispose = new ArrayList<>();
|
||||
Extensions.registerAreaClass("area", null);
|
||||
Extensions.registerAreaClass("child_area", "area");
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
public void tearDown() {
|
||||
for (MyAreaInstance instance : myAreasToDispose) {
|
||||
Extensions.disposeArea(instance);
|
||||
}
|
||||
@@ -59,7 +59,7 @@ public class ExtensionsComplexTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPluginInit() throws Exception {
|
||||
public void testPluginInit() {
|
||||
initExtensionPoints(
|
||||
PLUGIN_NAME, "<extensionPoints>\n" +
|
||||
" <extensionPoint name=\"extensionPoint\" beanClass=\"com.intellij.openapi.extensions.impl.XMLTestBean\" />\n" +
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public class MessageCounterTest {
|
||||
private static final ProjectSystemId OTHER_BUILD_SYSTEM = new ProjectSystemId("SomeOtherBuildSystem");
|
||||
|
||||
@Test
|
||||
public void testIncrement() throws Exception {
|
||||
public void testIncrement() {
|
||||
MessageCounter counter = new MessageCounter();
|
||||
counter.increment(GROUP1, NotificationSource.PROJECT_SYNC, NotificationCategory.ERROR, OTHER_BUILD_SYSTEM);
|
||||
assertEquals(counter.toString(), 1, counter.getCount(GROUP1, NotificationSource.PROJECT_SYNC, NotificationCategory.ERROR, OTHER_BUILD_SYSTEM));
|
||||
|
||||
+7
-7
@@ -120,7 +120,7 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase {
|
||||
CompilerTestUtil.enableExternalCompiler();
|
||||
}
|
||||
|
||||
protected void collectAllowedRoots(List<String> roots) throws IOException {
|
||||
protected void collectAllowedRoots(List<String> roots) {
|
||||
}
|
||||
|
||||
public static Collection<String> collectRootsInside(String root) {
|
||||
@@ -253,7 +253,7 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void invokeTestRunnable(@NotNull Runnable runnable) throws Exception {
|
||||
protected void invokeTestRunnable(@NotNull Runnable runnable) {
|
||||
runnable.run();
|
||||
}
|
||||
|
||||
@@ -288,11 +288,11 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase {
|
||||
return FileUtil.toSystemIndependentName(root.getPath() + "/" + relPath);
|
||||
}
|
||||
|
||||
protected Module createModule(String name) throws IOException {
|
||||
protected Module createModule(String name) {
|
||||
return createModule(name, StdModuleTypes.JAVA);
|
||||
}
|
||||
|
||||
protected Module createModule(final String name, final ModuleType type) throws IOException {
|
||||
protected Module createModule(final String name, final ModuleType type) {
|
||||
return new WriteCommandAction<Module>(myProject) {
|
||||
@Override
|
||||
protected void run(@NotNull Result<Module> moduleResult) throws Throwable {
|
||||
@@ -304,11 +304,11 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase {
|
||||
}.execute().getResultObject();
|
||||
}
|
||||
|
||||
protected VirtualFile createProjectConfig(@NonNls String config) throws IOException {
|
||||
protected VirtualFile createProjectConfig(@NonNls String config) {
|
||||
return myProjectConfig = createConfigFile(myProjectRoot, config);
|
||||
}
|
||||
|
||||
protected VirtualFile createConfigFile(final VirtualFile dir, String config) throws IOException {
|
||||
protected VirtualFile createConfigFile(final VirtualFile dir, String config) {
|
||||
final String configFileName = getExternalSystemConfigFileName();
|
||||
VirtualFile f = dir.findChild(configFileName);
|
||||
if (f == null) {
|
||||
@@ -502,7 +502,7 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase {
|
||||
fs.assertFileEqual(file);
|
||||
}
|
||||
|
||||
private static void setFileContent(final VirtualFile file, final String content, final boolean advanceStamps) throws IOException {
|
||||
private static void setFileContent(final VirtualFile file, final String content, final boolean advanceStamps) {
|
||||
new WriteAction<VirtualFile>() {
|
||||
@Override
|
||||
protected void run(@NotNull Result<VirtualFile> result) throws Throwable {
|
||||
|
||||
+2
-2
@@ -176,7 +176,7 @@ public class ArrangementSettingsSerializationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyGroupings() throws Exception {
|
||||
public void testEmptyGroupings() {
|
||||
final StdArrangementSettings settings = new StdArrangementSettings();
|
||||
final ArrangementAtomMatchCondition condition = new ArrangementAtomMatchCondition(FIELD);
|
||||
settings.addRule(new StdArrangementMatchRule(new StdArrangementEntryMatcher(condition), BY_NAME));
|
||||
@@ -192,7 +192,7 @@ public class ArrangementSettingsSerializationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyRules() throws Exception {
|
||||
public void testEmptyRules() {
|
||||
final StdArrangementSettings settings = new StdArrangementSettings();
|
||||
settings.addGrouping(new ArrangementGroupingRule(OVERRIDDEN_METHODS, BY_NAME));
|
||||
|
||||
|
||||
+2
-4
@@ -17,10 +17,8 @@ package com.intellij.codeInsight.editorActions;
|
||||
|
||||
import com.intellij.testFramework.LightPlatformCodeInsightTestCase;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class IndentingBackspaceHandlerUncommittedDocumentTest extends LightPlatformCodeInsightTestCase {
|
||||
public void testSequentialBackspaceInvocation() throws IOException {
|
||||
public void testSequentialBackspaceInvocation() {
|
||||
configureFromFileText(getTestName(false) + ".java",
|
||||
"class Foo {\n" +
|
||||
"\n" +
|
||||
@@ -32,7 +30,7 @@ public class IndentingBackspaceHandlerUncommittedDocumentTest extends LightPlatf
|
||||
"<caret>}");
|
||||
}
|
||||
|
||||
public void testMulticaretSequentialBackspaceInvocation() throws IOException {
|
||||
public void testMulticaretSequentialBackspaceInvocation() {
|
||||
configureFromFileText(getTestName(false) + ".java",
|
||||
"class Foo {\n" +
|
||||
" void m1() {\n" +
|
||||
|
||||
+9
-11
@@ -18,10 +18,8 @@ package com.intellij.codeInsight.editorActions;
|
||||
import com.intellij.openapi.editor.LogicalPosition;
|
||||
import com.intellij.testFramework.LightPlatformCodeInsightTestCase;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCodeInsightTestCase {
|
||||
public void testAfterLargeIndent() throws IOException {
|
||||
public void testAfterLargeIndent() {
|
||||
doTest("class Foo {\n" +
|
||||
" \n" +
|
||||
"}",
|
||||
@@ -32,7 +30,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode
|
||||
new LogicalPosition(1, 4));
|
||||
}
|
||||
|
||||
public void testAfterProperIndent() throws IOException {
|
||||
public void testAfterProperIndent() {
|
||||
doTest("class Foo {\n" +
|
||||
" \n" +
|
||||
"}",
|
||||
@@ -43,7 +41,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode
|
||||
new LogicalPosition(1, 4));
|
||||
}
|
||||
|
||||
public void testAfterSmallIndent() throws IOException {
|
||||
public void testAfterSmallIndent() {
|
||||
doTest("class Foo {\n" +
|
||||
" \n" +
|
||||
"}",
|
||||
@@ -54,7 +52,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode
|
||||
new LogicalPosition(1, 4));
|
||||
}
|
||||
|
||||
public void testAfterEmptyIndent() throws IOException {
|
||||
public void testAfterEmptyIndent() {
|
||||
doTest("class Foo {\n" +
|
||||
"\n" +
|
||||
"}",
|
||||
@@ -65,7 +63,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode
|
||||
new LogicalPosition(1, 4));
|
||||
}
|
||||
|
||||
public void testAtIndent() throws IOException {
|
||||
public void testAtIndent() {
|
||||
doTest("class Foo {\n" +
|
||||
" \n" +
|
||||
"}",
|
||||
@@ -75,7 +73,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode
|
||||
new LogicalPosition(0, 11));
|
||||
}
|
||||
|
||||
public void testAtIndentOnEmptyLine() throws IOException {
|
||||
public void testAtIndentOnEmptyLine() {
|
||||
doTest("class Foo {\n" +
|
||||
"\n" +
|
||||
"}",
|
||||
@@ -85,7 +83,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode
|
||||
new LogicalPosition(0, 11));
|
||||
}
|
||||
|
||||
public void testBeforeIndent() throws IOException {
|
||||
public void testBeforeIndent() {
|
||||
doTest("class Foo {\n" +
|
||||
" \n" +
|
||||
"}",
|
||||
@@ -95,7 +93,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode
|
||||
new LogicalPosition(0, 11));
|
||||
}
|
||||
|
||||
public void testDeleteLine() throws IOException {
|
||||
public void testDeleteLine() {
|
||||
doTest("class Foo {\n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
@@ -107,7 +105,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode
|
||||
new LogicalPosition(1, 4));
|
||||
}
|
||||
|
||||
private void doTest(String textBefore, LogicalPosition caretBefore, String textAfter, LogicalPosition caretAfter) throws IOException {
|
||||
private void doTest(String textBefore, LogicalPosition caretBefore, String textAfter, LogicalPosition caretAfter) {
|
||||
configureFromFileText(getTestName(false) + ".java", textBefore);
|
||||
myEditor.getSettings().setVirtualSpace(true);
|
||||
myEditor.getCaretModel().moveToLogicalPosition(caretBefore);
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class ExecutionManagerTest extends LightPlatformTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testRerunSingleton() throws Exception {
|
||||
public void testRerunSingleton() {
|
||||
Project project = getProject();
|
||||
ExecutionManagerImpl executionManager = ExecutionManagerImpl.getInstance(project);
|
||||
|
||||
|
||||
+2
-3
@@ -16,7 +16,6 @@
|
||||
package com.intellij.execution.impl;
|
||||
|
||||
import com.intellij.execution.DefaultExecutionResult;
|
||||
import com.intellij.execution.ExecutionException;
|
||||
import com.intellij.execution.ExecutionResult;
|
||||
import com.intellij.execution.Executor;
|
||||
import com.intellij.execution.configurations.LocatableConfigurationBase;
|
||||
@@ -54,14 +53,14 @@ public class FakeRunConfiguration extends LocatableConfigurationBase {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment environment) throws ExecutionException {
|
||||
public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment environment) {
|
||||
return new FakeRunProfileState();
|
||||
}
|
||||
|
||||
public class FakeRunProfileState implements RunProfileState {
|
||||
@Nullable
|
||||
@Override
|
||||
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
|
||||
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) {
|
||||
return new DefaultExecutionResult(null, new FakeProcessHandler(mySurviveSoftKill));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-3
@@ -24,8 +24,6 @@ import com.intellij.psi.PsiFile;
|
||||
import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
@@ -61,7 +59,7 @@ public class GeneratedSourceFileChangeTrackerTest extends CodeInsightFixtureTest
|
||||
assertTrue(isEditedGeneratedFile(file));
|
||||
}
|
||||
|
||||
public void testChangeGeneratedExternally() throws IOException {
|
||||
public void testChangeGeneratedExternally() {
|
||||
PsiFile file = myFixture.configureByText("Gen.txt", "");
|
||||
myFixture.saveText(file.getVirtualFile(), "abc");
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import com.intellij.openapi.wm.ToolWindowId;
|
||||
*/
|
||||
public class ProjectToolWindowTest extends ToolWindowManagerTestCase {
|
||||
|
||||
public void testProjectViewActivate() throws Exception {
|
||||
public void testProjectViewActivate() {
|
||||
|
||||
ToolWindowEP[] extensions = Extensions.getExtensions(ToolWindowEP.EP_NAME);
|
||||
for (ToolWindowEP extension : extensions) {
|
||||
|
||||
@@ -35,7 +35,7 @@ import java.util.List;
|
||||
public class BadPluginTest extends PlatformTestCase {
|
||||
private static final String COM_YOUR_COMPANY_UNIQUE_PLUGIN_ID = "com.your.company.unique.plugin.id";
|
||||
|
||||
public void testBadPlugin() throws Exception {
|
||||
public void testBadPlugin() {
|
||||
IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId(COM_YOUR_COMPANY_UNIQUE_PLUGIN_ID));
|
||||
if (plugin == null) return;
|
||||
List<String> disabledPlugins = new ArrayList<>();
|
||||
|
||||
+9
-9
@@ -18,12 +18,12 @@ public class ReplacePathToMacroMapTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSubstitute_NoSubstitute() throws Exception {
|
||||
public void testSubstitute_NoSubstitute() {
|
||||
assertEquals("/foo/bar", substitute("/foo/bar"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSubstitute_CompleteMatch() throws Exception {
|
||||
public void testSubstitute_CompleteMatch() {
|
||||
assertEquals("$MODULE_DIR$", substitute("/tmp/foo"));
|
||||
assertEquals("jar:$MODULE_DIR$", substitute("jar:/tmp/foo"));
|
||||
assertEquals("jar:/$MODULE_DIR$", substitute("jar://tmp/foo"));
|
||||
@@ -34,7 +34,7 @@ public class ReplacePathToMacroMapTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSubstitute_PrefixMatch() throws Exception {
|
||||
public void testSubstitute_PrefixMatch() {
|
||||
assertEquals("$MODULE_DIR$/bar", substitute("/tmp/foo/bar"));
|
||||
assertEquals("jar:$MODULE_DIR$/bar", substitute("jar:/tmp/foo/bar"));
|
||||
assertEquals("jar:/$MODULE_DIR$/bar", substitute("jar://tmp/foo/bar"));
|
||||
@@ -45,7 +45,7 @@ public class ReplacePathToMacroMapTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSubstitute_JarPrefixMatch() throws Exception {
|
||||
public void testSubstitute_JarPrefixMatch() {
|
||||
assertEquals("$MODULE_DIR$!/bar", substitute("/tmp/foo!/bar"));
|
||||
assertEquals("jar:$MODULE_DIR$!/bar", substitute("jar:/tmp/foo!/bar"));
|
||||
assertEquals("jar:/$MODULE_DIR$!/bar", substitute("jar://tmp/foo!/bar"));
|
||||
@@ -56,7 +56,7 @@ public class ReplacePathToMacroMapTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSubstitute_WindowsRootSubstitution() throws Exception {
|
||||
public void testSubstitute_WindowsRootSubstitution() {
|
||||
myMap.put("C:/", "../$MODULE_DIR$/");
|
||||
|
||||
assertEquals("../$MODULE_DIR$/", substitute("C:/"));
|
||||
@@ -64,22 +64,22 @@ public class ReplacePathToMacroMapTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSubstitute_NoSubstituteInTheMiddleOccurs() throws Exception {
|
||||
public void testSubstitute_NoSubstituteInTheMiddleOccurs() {
|
||||
assertEquals("/bar/tmp/foo/bar", substitute("/bar/tmp/foo/bar"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSubstitute_NoDoubleSubstitution() throws Exception {
|
||||
public void testSubstitute_NoDoubleSubstitution() {
|
||||
assertEquals("$MODULE_DIR$/bar/tmp/foo", substitute("/tmp/foo/bar/tmp/foo"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSubstitute_NoPartialSubstituteIsPerformed() throws Exception {
|
||||
public void testSubstitute_NoPartialSubstituteIsPerformed() {
|
||||
assertEquals("/tmp/foobar", substitute("/tmp/foobar"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSubstitute_ProperSubstitutionPriorityApplied() throws Exception {
|
||||
public void testSubstitute_ProperSubstitutionPriorityApplied() {
|
||||
myMap.put("/root/project/module", "$MODULE_DIR$");
|
||||
myMap.put("/root/project", "../$MODULE_DIR$");
|
||||
myMap.put("/root", "$APPLICATION_HOME_DIR$");
|
||||
|
||||
+2
-4
@@ -21,11 +21,9 @@ import com.intellij.openapi.editor.SelectionModel;
|
||||
import com.intellij.openapi.editor.impl.AbstractEditorTest;
|
||||
import com.intellij.testFramework.TestFileType;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class BlockSelectionEditingTest extends AbstractEditorTest {
|
||||
|
||||
public void testBlockRemovalAndCollapsedFoldRegionsBefore() throws IOException {
|
||||
public void testBlockRemovalAndCollapsedFoldRegionsBefore() {
|
||||
// Inspired by IDEA-69371
|
||||
String initialText =
|
||||
"fold line #1\n" +
|
||||
@@ -59,7 +57,7 @@ public class BlockSelectionEditingTest extends AbstractEditorTest {
|
||||
assertEquals(foldEndOffset, foldRegion.getEndOffset());
|
||||
}
|
||||
|
||||
public void testBlockSelectionAndCollapsedFolding() throws IOException {
|
||||
public void testBlockSelectionAndCollapsedFolding() {
|
||||
String text =
|
||||
"class Test {\n" +
|
||||
" private class Inner1 {\n" +
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@ public class CommentInCustomFileTypesTest extends LightPlatformCodeInsightTestCa
|
||||
return PlatformTestUtil.getPlatformTestDataPath();
|
||||
}
|
||||
|
||||
public void testBlockComment() throws Exception {
|
||||
public void testBlockComment() {
|
||||
configureByFile("/codeInsight/commentInCustomFileType/block1.cs");
|
||||
performBlockCommentAction();
|
||||
checkResultByFile("/codeInsight/commentInCustomFileType/block1_after.cs");
|
||||
@@ -38,7 +38,7 @@ public class CommentInCustomFileTypesTest extends LightPlatformCodeInsightTestCa
|
||||
checkResultByFile("/codeInsight/commentInCustomFileType/block1_after2.cs");
|
||||
}
|
||||
|
||||
public void testLineComment() throws Exception {
|
||||
public void testLineComment() {
|
||||
configureByFile("/codeInsight/commentInCustomFileType/line1.cs");
|
||||
performLineCommentAction();
|
||||
checkResultByFile("/codeInsight/commentInCustomFileType/line1_after.cs");
|
||||
|
||||
+6
-7
@@ -27,7 +27,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.picocontainer.MutablePicoContainer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.intellij.psi.search.GlobalSearchScopesCore.directoryScope;
|
||||
@@ -74,7 +73,7 @@ public class ReformatFilesWithFiltersTest extends LightPlatformTestCase {
|
||||
container.registerComponentInstance(componentKey, manager);
|
||||
}
|
||||
|
||||
public void testReformatWithoutMask() throws IOException {
|
||||
public void testReformatWithoutMask() {
|
||||
TestFileStructure fileTree = new TestFileStructure(getModule(), myWorkingDirectory);
|
||||
|
||||
PsiFile java1 = fileTree.addTestFile("Test.java", "empty content");
|
||||
@@ -88,7 +87,7 @@ public class ReformatFilesWithFiltersTest extends LightPlatformTestCase {
|
||||
assertWasFormatted(java1, java2, java3, php, js);
|
||||
}
|
||||
|
||||
public void testFormatByOnlyOneMask() throws IOException {
|
||||
public void testFormatByOnlyOneMask() {
|
||||
TestFileStructure fileTree = new TestFileStructure(getModule(), myWorkingDirectory);
|
||||
|
||||
PsiFile java1 = fileTree.addTestFile("Test.java", "empty content");
|
||||
@@ -108,7 +107,7 @@ public class ReformatFilesWithFiltersTest extends LightPlatformTestCase {
|
||||
|
||||
}
|
||||
|
||||
public void testFormatByMultiMask() throws IOException {
|
||||
public void testFormatByMultiMask() {
|
||||
TestFileStructure fileTree = new TestFileStructure(getModule(), myWorkingDirectory);
|
||||
|
||||
PsiFile java1 = fileTree.addTestFile("Test.java", "empty content");
|
||||
@@ -145,7 +144,7 @@ public class ReformatFilesWithFiltersTest extends LightPlatformTestCase {
|
||||
assertWasNotFormatted(js1, js2, js3, php1, php2, java1, java2, java3, py1, py2, py3);
|
||||
}
|
||||
|
||||
public void testDirectoryScope() throws IOException {
|
||||
public void testDirectoryScope() {
|
||||
TestFileStructure fileTree = new TestFileStructure(getModule(), myWorkingDirectory);
|
||||
PsiFile java1 = fileTree.addTestFile("Test1.java", "empty content");
|
||||
PsiFile php1 = fileTree.addTestFile("Pair1.php", "empty content");
|
||||
@@ -181,7 +180,7 @@ public class ReformatFilesWithFiltersTest extends LightPlatformTestCase {
|
||||
assertWasNotFormatted(java2, php2, js2);
|
||||
}
|
||||
|
||||
public void testDirectoryScopeWithMask() throws IOException {
|
||||
public void testDirectoryScopeWithMask() {
|
||||
TestFileStructure fileTree = new TestFileStructure(getModule(), myWorkingDirectory);
|
||||
PsiFile java1 = fileTree.addTestFile("Test1.java", "empty content");
|
||||
PsiFile php1 = fileTree.addTestFile("Pair1.php", "empty content");
|
||||
@@ -211,7 +210,7 @@ public class ReformatFilesWithFiltersTest extends LightPlatformTestCase {
|
||||
assertWasNotFormatted(java2, php2, js1, js2, js3);
|
||||
}
|
||||
|
||||
public void testIDEA126830() throws IOException {
|
||||
public void testIDEA126830() {
|
||||
TestFileStructure fileTree = new TestFileStructure(getModule(), myWorkingDirectory);
|
||||
|
||||
fileTree.createDirectoryAndMakeItCurrent("src");
|
||||
|
||||
+8
-8
@@ -17,7 +17,8 @@ package com.intellij.codeInsight.actions;
|
||||
|
||||
import com.intellij.lang.LanguageFormatting;
|
||||
import com.intellij.lang.LanguageImportStatements;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.LangDataKeys;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.components.impl.ComponentManagerImpl;
|
||||
@@ -245,7 +246,7 @@ public class ReformatOnlyVcsChangedTextTest extends LightPlatformTestCase {
|
||||
assertFormattedLines(NO_CHANGED_LINES, u1, u2);
|
||||
}
|
||||
|
||||
public void testNoChangesNoFormatting() throws IOException {
|
||||
public void testNoChangesNoFormatting() {
|
||||
ChangedFilesStructure fs = new ChangedFilesStructure(myWorkingDirectory);
|
||||
|
||||
PsiFile u1 = fs.createFile("Test1.java", COMMITTED, COMMITTED);
|
||||
@@ -257,7 +258,7 @@ public class ReformatOnlyVcsChangedTextTest extends LightPlatformTestCase {
|
||||
}
|
||||
|
||||
|
||||
public void testReformatOnlyChanged() throws IOException {
|
||||
public void testReformatOnlyChanged() {
|
||||
ChangedFilesStructure fs = new ChangedFilesStructure(myWorkingDirectory);
|
||||
|
||||
PsiFile untouched1 = fs.createFile("Test1.java", COMMITTED, COMMITTED);
|
||||
@@ -294,7 +295,7 @@ public class ReformatOnlyVcsChangedTextTest extends LightPlatformTestCase {
|
||||
assertFormattedLines(NO_CHANGED_LINES, modified11, modified12);
|
||||
}
|
||||
|
||||
public void testOptimizeImportsInModule() throws IOException {
|
||||
public void testOptimizeImportsInModule() {
|
||||
ChangedFilesStructure fs = new ChangedFilesStructure(myWorkingDirectory);
|
||||
|
||||
String initialFile = "initial file";
|
||||
@@ -348,7 +349,7 @@ public class ReformatOnlyVcsChangedTextTest extends LightPlatformTestCase {
|
||||
container.registerComponentInstance(key, factory);
|
||||
}
|
||||
|
||||
private void doTest(@NotNull String committed, @NotNull String modified, @NotNull ChangedLines... lines) throws IOException {
|
||||
private void doTest(@NotNull String committed, @NotNull String modified, @NotNull ChangedLines... lines) {
|
||||
ChangedFilesStructure fs = new ChangedFilesStructure(myWorkingDirectory);
|
||||
PsiFile file = fs.createFile("Test.java", committed, modified);
|
||||
reformatDirectory(myWorkingDirectory);
|
||||
@@ -391,15 +392,14 @@ public class ReformatOnlyVcsChangedTextTest extends LightPlatformTestCase {
|
||||
myFileStructure = new TestFileStructure(getModule(), directory);
|
||||
}
|
||||
|
||||
public void createDirectoryAndMakeItCurrent() throws IOException {
|
||||
public void createDirectoryAndMakeItCurrent() {
|
||||
myFileStructure.createDirectoryAndMakeItCurrent("inner");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PsiFile createFile(@NotNull String fileName,
|
||||
@NotNull String committedContent,
|
||||
@NotNull String actualContent) throws IOException
|
||||
{
|
||||
@NotNull String actualContent) {
|
||||
PsiFile file = myFileStructure.addTestFile(fileName, actualContent);
|
||||
if (committedContent != actualContent) {
|
||||
registerCommittedRevision(committedContent, file);
|
||||
|
||||
+3
-3
@@ -51,7 +51,7 @@ public class TestFileStructure {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PsiFile addTestFile(@NotNull String name, @NotNull String content) throws IOException {
|
||||
public PsiFile addTestFile(@NotNull String name, @NotNull String content) {
|
||||
PsiFile createdFile = createFile(myModule, myCurrentLevelDirectory.getVirtualFile(), name, content);
|
||||
getCurrentDirectoryFiles().add(createdFile);
|
||||
return createdFile;
|
||||
@@ -68,7 +68,7 @@ public class TestFileStructure {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PsiDirectory createDirectoryAndMakeItCurrent(String name) throws IOException {
|
||||
public PsiDirectory createDirectoryAndMakeItCurrent(String name) {
|
||||
myLevel++;
|
||||
myFilesForLevel.add(new ArrayList<>());
|
||||
myCurrentLevelDirectory = createDirectory(myProject, myCurrentLevelDirectory.getVirtualFile(), name);
|
||||
@@ -98,7 +98,7 @@ public class TestFileStructure {
|
||||
}.execute().getResultObject();
|
||||
}
|
||||
|
||||
public static PsiDirectory createDirectory(@NotNull Project project, @NotNull final VirtualFile parent, @NotNull final String name) throws IOException {
|
||||
public static PsiDirectory createDirectory(@NotNull Project project, @NotNull final VirtualFile parent, @NotNull final String name) {
|
||||
final VirtualFile[] dir = new VirtualFile[1];
|
||||
ApplicationManager.getApplication().runWriteAction(() -> {
|
||||
try {
|
||||
|
||||
+2
-2
@@ -45,11 +45,11 @@ public abstract class AbstractMoveElementLeftRightTest extends AbstractEditorTes
|
||||
doTestSingle(!moveLeft, current, before);
|
||||
}
|
||||
|
||||
private void doTestSingle(boolean moveLeft, String before, String after) throws Exception {
|
||||
private void doTestSingle(boolean moveLeft, String before, String after) {
|
||||
configureEditor(before);
|
||||
executeAction(moveLeft ? IdeActions.MOVE_ELEMENT_LEFT : IdeActions.MOVE_ELEMENT_RIGHT);
|
||||
checkResultByText(after);
|
||||
}
|
||||
|
||||
protected abstract void configureEditor(String contents) throws Exception;
|
||||
protected abstract void configureEditor(String contents);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ public class JobUtilTest extends PlatformTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testJobUtilRecursiveStress() throws Exception {
|
||||
public void testJobUtilRecursiveStress() {
|
||||
final List<String> list = Collections.nCopies(100, null);
|
||||
for (int i=0; i<10; i++) {
|
||||
COUNT.set(0);
|
||||
@@ -187,7 +187,7 @@ public class JobUtilTest extends PlatformTestCase {
|
||||
}
|
||||
|
||||
private static class MyException extends RuntimeException {}
|
||||
public void testExceptionalCompletion() throws Throwable {
|
||||
public void testExceptionalCompletion() {
|
||||
COUNT.set(0);
|
||||
try {
|
||||
final List<Object> objects = Collections.nCopies(100000000, null);
|
||||
@@ -204,7 +204,7 @@ public class JobUtilTest extends PlatformTestCase {
|
||||
// caught OK
|
||||
}
|
||||
}
|
||||
public void testNotNormalCompletion() throws Throwable {
|
||||
public void testNotNormalCompletion() {
|
||||
COUNT.set(0);
|
||||
final List<Object> objects = Collections.nCopies(100000000, null);
|
||||
boolean success = JobLauncher.getInstance().invokeConcurrentlyUnderProgress(objects, null, true, o -> {
|
||||
@@ -217,7 +217,7 @@ public class JobUtilTest extends PlatformTestCase {
|
||||
assertFalse(success);
|
||||
}
|
||||
|
||||
public void testJobUtilCompletesEvenIfCannotGrabReadAction() throws Throwable {
|
||||
public void testJobUtilCompletesEvenIfCannotGrabReadAction() {
|
||||
COUNT.set(0);
|
||||
final List<Object> objects = Collections.nCopies(1000000, null);
|
||||
ApplicationManager.getApplication().runWriteAction(() -> {
|
||||
@@ -230,7 +230,7 @@ public class JobUtilTest extends PlatformTestCase {
|
||||
});
|
||||
}
|
||||
|
||||
public void testJobUtilRecursiveCancel() throws Exception {
|
||||
public void testJobUtilRecursiveCancel() {
|
||||
final List<String> list = Collections.nCopies(100, "");
|
||||
final List<Integer> ilist = Collections.nCopies(100, 0);
|
||||
for (int i=0; i<10; i++) {
|
||||
@@ -325,7 +325,7 @@ public class JobUtilTest extends PlatformTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testAfterCancelInTheMiddleOfTheExecutionTaskIsDoneReturnsFalseUntilFinished() throws ExecutionException, InterruptedException {
|
||||
public void testAfterCancelInTheMiddleOfTheExecutionTaskIsDoneReturnsFalseUntilFinished() {
|
||||
Random random = new Random();
|
||||
for (int i=0; i<100; i++) {
|
||||
final AtomicBoolean finished = new AtomicBoolean();
|
||||
|
||||
+3
-3
@@ -28,13 +28,13 @@ public class CompositeFilterTest {
|
||||
protected CompositeFilter myCompositeFilter;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
myCompositeFilter = new CompositeFilter(new MockDumbService(null));
|
||||
myCompositeFilter.setForceUseAllFilters(false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyNextFilter() throws Exception {
|
||||
public void testApplyNextFilter() {
|
||||
Assert.assertNull(applyFilter());
|
||||
|
||||
myCompositeFilter.addFilter(returnNullFilter());
|
||||
@@ -62,7 +62,7 @@ public class CompositeFilterTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyBadFilter() throws Exception {
|
||||
public void testApplyBadFilter() {
|
||||
myCompositeFilter.addFilter(throwSOEFilter());
|
||||
try {
|
||||
Assert.assertNull(applyFilter());
|
||||
|
||||
+12
-12
@@ -75,7 +75,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testTypeText() throws Exception {
|
||||
public void testTypeText() {
|
||||
ConsoleViewImpl console = myConsole;
|
||||
console.print("Initial", ConsoleViewContentType.NORMAL_OUTPUT);
|
||||
console.flushDeferredText();
|
||||
@@ -104,7 +104,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase {
|
||||
assertEquals("Test", console.getText());
|
||||
}
|
||||
|
||||
public void testConsolePrintsSomethingAfterClearPrintScroll() throws Exception {
|
||||
public void testConsolePrintsSomethingAfterClearPrintScroll() {
|
||||
ConsoleViewImpl console = myConsole;
|
||||
Alarm alarm = new Alarm(getTestRootDisposable());
|
||||
for (int i=0; i<1000/*000*/; i++) {
|
||||
@@ -149,7 +149,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testTypeInEmptyConsole() throws Exception {
|
||||
public void testTypeInEmptyConsole() {
|
||||
ConsoleViewImpl console = myConsole;
|
||||
console.clear();
|
||||
EditorActionManager actionManager = EditorActionManager.getInstance();
|
||||
@@ -159,7 +159,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase {
|
||||
assertEquals(1, console.getContentSize());
|
||||
}
|
||||
|
||||
public void testTypingAfterMultipleCR() throws Exception {
|
||||
public void testTypingAfterMultipleCR() {
|
||||
final EditorActionManager actionManager = EditorActionManager.getInstance();
|
||||
final TypedAction typedAction = actionManager.getTypedAction();
|
||||
final TestDataProvider dataContext = new TestDataProvider(getProject());
|
||||
@@ -176,7 +176,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase {
|
||||
assertEquals("System output\n12", editor.getDocument().getText());
|
||||
}
|
||||
|
||||
public void testCRLF() throws Exception {
|
||||
public void testCRLF() {
|
||||
ConsoleViewImpl console = myConsole;
|
||||
console.clear();
|
||||
console.print("Hello\r", ConsoleViewContentType.NORMAL_OUTPUT);
|
||||
@@ -185,20 +185,20 @@ public class ConsoleViewImplTest extends LightPlatformTestCase {
|
||||
assertEquals("Hello\nWorld", console.getText());
|
||||
}
|
||||
|
||||
public void testCRTypeCR() throws Exception {
|
||||
public void testCRTypeCR() {
|
||||
myConsole.print("\rHi\rMr\rSmith", ConsoleViewContentType.NORMAL_OUTPUT);
|
||||
myConsole.flushDeferredText();
|
||||
assertEquals("Smith", myConsole.getText());
|
||||
}
|
||||
|
||||
public void testCRTypeTearCR() throws Exception {
|
||||
public void testCRTypeTearCR() {
|
||||
myConsole.print("Hi", ConsoleViewContentType.NORMAL_OUTPUT);
|
||||
|
||||
myConsole.print("\rMr\rSmith", ConsoleViewContentType.NORMAL_OUTPUT);
|
||||
myConsole.flushDeferredText();
|
||||
assertEquals("Smith", myConsole.getText());
|
||||
}
|
||||
public void testCRTypeFlushCR() throws Exception {
|
||||
public void testCRTypeFlushCR() {
|
||||
myConsole.print("Hi", ConsoleViewContentType.NORMAL_OUTPUT);
|
||||
myConsole.flushDeferredText();
|
||||
assertEquals("Hi", myConsole.getText());
|
||||
@@ -226,7 +226,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase {
|
||||
return console;
|
||||
}
|
||||
|
||||
public void testPerformance() throws Exception {
|
||||
public void testPerformance() {
|
||||
withCycleConsole(100, console ->
|
||||
PlatformTestUtil.startPerformanceTest("console print", 15000, () -> {
|
||||
console.clear();
|
||||
@@ -240,7 +240,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase {
|
||||
}).assertTiming());
|
||||
}
|
||||
|
||||
public void testLargeConsolePerformance() throws Exception {
|
||||
public void testLargeConsolePerformance() {
|
||||
withCycleConsole(UISettings.getInstance().getConsoleCycleBufferSizeKb(), console ->
|
||||
PlatformTestUtil.startPerformanceTest("console print", 9000, () -> {
|
||||
console.clear();
|
||||
@@ -252,7 +252,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase {
|
||||
}).assertTiming());
|
||||
}
|
||||
|
||||
public void testPerformanceOfMergeableTokens() throws Exception {
|
||||
public void testPerformanceOfMergeableTokens() {
|
||||
withCycleConsole(1000, console ->
|
||||
PlatformTestUtil.startPerformanceTest("console print with mergeable tokens", 3500, () -> {
|
||||
console.clear();
|
||||
@@ -354,7 +354,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase {
|
||||
action.actionPerformed(editor, c, dataContext);
|
||||
}
|
||||
|
||||
public void testBackspaceDoesDeleteTheLastTypedChar() throws Exception {
|
||||
public void testBackspaceDoesDeleteTheLastTypedChar() {
|
||||
final ConsoleViewImpl console = myConsole;
|
||||
final Editor editor = console.getEditor();
|
||||
console.print("xxxx", ConsoleViewContentType.NORMAL_OUTPUT);
|
||||
|
||||
+11
-8
@@ -9,7 +9,10 @@ import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.junit.Assert;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -19,26 +22,26 @@ public class AnsiEscapeDecoderTest extends PlatformTestCase {
|
||||
private static final String STDOUT_KEY = ProcessOutputTypes.STDOUT.toString();
|
||||
private static final String STDERR_KEY = ProcessOutputTypes.STDERR.toString();
|
||||
|
||||
public void testTextWithoutColors() throws Exception {
|
||||
public void testTextWithoutColors() {
|
||||
check(new ColoredText(""));
|
||||
check(new ColoredText("simple text").addExpected("simple text", STDOUT_KEY));
|
||||
}
|
||||
|
||||
public void testSingleColoredChunk() throws Exception {
|
||||
public void testSingleColoredChunk() {
|
||||
check(new ColoredText("Chrome 35.0.1916 (Linux): Executed 0 of 1\u001B[32m SUCCESS\u001B[39m (0 secs / 0 secs)\n")
|
||||
.addExpected("Chrome 35.0.1916 (Linux): Executed 0 of 1", STDOUT_KEY)
|
||||
.addExpected(" SUCCESS", "\u001B[32m")
|
||||
.addExpected(" (0 secs / 0 secs)\n", "\u001B[39m"));
|
||||
}
|
||||
|
||||
public void testCompoundEscSeq() throws Exception {
|
||||
public void testCompoundEscSeq() {
|
||||
check(new ColoredText("E\u001B[41m\u001B[37mE\u001B[0mE")
|
||||
.addExpected("E", STDOUT_KEY)
|
||||
.addExpected("E", "\u001B[41;37m")
|
||||
.addExpected("E", STDOUT_KEY));
|
||||
}
|
||||
|
||||
public void testOtherEscSeq() throws Exception {
|
||||
public void testOtherEscSeq() {
|
||||
check(new ColoredText("Plain\u001B[32mGreen\u001B[39mNormal\u001B[1A\u001B[2K\u001B[31mRed\u001B[39m")
|
||||
.addExpected("Plain", STDOUT_KEY)
|
||||
.addExpected("Green", "\u001B[32m")
|
||||
@@ -46,7 +49,7 @@ public class AnsiEscapeDecoderTest extends PlatformTestCase {
|
||||
.addExpected("Red", "\u001B[31m"));
|
||||
}
|
||||
|
||||
public void testBackspaceControlSequence() throws Exception {
|
||||
public void testBackspaceControlSequence() {
|
||||
check(false, ContainerUtil.newArrayList(
|
||||
new ColoredText(" 10% 0/1 build modules\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 70% 1/1 build modules")
|
||||
.addExpected(" 70% 1/1 build modules", STDOUT_KEY),
|
||||
@@ -56,7 +59,7 @@ public class AnsiEscapeDecoderTest extends PlatformTestCase {
|
||||
));
|
||||
}
|
||||
|
||||
public void testIncompleteEscapeSequences() throws Exception {
|
||||
public void testIncompleteEscapeSequences() {
|
||||
check(true, ContainerUtil.newArrayList(
|
||||
new ColoredText("\u001B"),
|
||||
new ColoredText("[33m Hello\u001B[3").addExpected(" Hello", "\u001B[33m"),
|
||||
@@ -175,7 +178,7 @@ public class AnsiEscapeDecoderTest extends PlatformTestCase {
|
||||
};
|
||||
}
|
||||
|
||||
public void testPerformance() throws IOException {
|
||||
public void testPerformance() {
|
||||
Process testProcess = createTestProcess();
|
||||
|
||||
//noinspection CodeBlock2Expr
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ public class BinaryOSProcessHandlerTest {
|
||||
private static final int SEND_TIMEOUT = 500;
|
||||
|
||||
@SuppressWarnings("BusyWait")
|
||||
public static void main(String[] args) throws IOException, InterruptedException {
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
System.err.print(TEXT);
|
||||
|
||||
for (int offset = 0; offset < BYTES.length; offset += PACKET_SIZE) {
|
||||
|
||||
@@ -137,7 +137,7 @@ public class LocalVcsLabelsTest extends LocalHistoryTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGettingByteContent() throws Exception {
|
||||
public void testGettingByteContent() {
|
||||
LabelImpl l1 = myVcs.putSystemLabel("label", "project", -1);
|
||||
add(myVcs, createFile(myRoot, "f", "one"));
|
||||
|
||||
@@ -158,7 +158,7 @@ public class LocalVcsLabelsTest extends LocalHistoryTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGettingByteContentInsideChangeSet() throws Exception {
|
||||
public void testGettingByteContentInsideChangeSet() {
|
||||
myVcs.beginChangeSet();
|
||||
add(myVcs, createFile(myRoot, "f", "one"));
|
||||
LabelImpl l1 = myVcs.putSystemLabel("label", "project", -1);
|
||||
@@ -171,7 +171,7 @@ public class LocalVcsLabelsTest extends LocalHistoryTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGettingByteContentAfterRename() throws Exception {
|
||||
public void testGettingByteContentAfterRename() {
|
||||
add(myVcs, createFile(myRoot, "f", "one"));
|
||||
LabelImpl l1 = myVcs.putSystemLabel("label", "project", -1);
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ public class PathsTest extends LocalHistoryTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsParentOf() throws Exception {
|
||||
public void testIsParentOf() {
|
||||
assertTrue(Paths.isParent("foo", "foo"));
|
||||
assertTrue(Paths.isParent("foo", "foo/bar"));
|
||||
assertTrue(Paths.isParent("foo/bar", "foo/bar"));
|
||||
@@ -86,7 +86,7 @@ public class PathsTest extends LocalHistoryTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsParentOrChildOf() throws Exception {
|
||||
public void testIsParentOrChildOf() {
|
||||
assertTrue(Paths.isParentOrChild("foo/bar", "foo/bar"));
|
||||
assertTrue(Paths.isParentOrChild("foo/bar", "foo/bar/baz"));
|
||||
assertTrue(Paths.isParentOrChild("foo/bar/baz", "foo/bar"));
|
||||
@@ -96,7 +96,7 @@ public class PathsTest extends LocalHistoryTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSplitting() throws Exception {
|
||||
public void testSplitting() {
|
||||
assertEquals(array("/", "foo", "bar"), ContainerUtil.collect(Paths.split("/foo/bar").iterator()));
|
||||
assertEquals(array("/", "foo", "bar"), ContainerUtil.collect(Paths.split("/foo/bar/").iterator()));
|
||||
assertEquals(array("foo", "bar"), ContainerUtil.collect(Paths.split("foo/bar/").iterator()));
|
||||
|
||||
+2
-2
@@ -324,7 +324,7 @@ public class ChangeListCollectingChangesTest extends ChangeListTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFilteredChanges() throws Exception {
|
||||
public void testFilteredChanges() {
|
||||
ChangeSet cs1 = addChangeSet(facade, createDirectory(r, "dir"));
|
||||
ChangeSet cs2 = addChangeSet(facade, createFile(r, "dir/FooBar"));
|
||||
ChangeSet cs3 = addChangeSet(facade, createFile(r, "dir/BarBaz"));
|
||||
@@ -338,7 +338,7 @@ public class ChangeListCollectingChangesTest extends ChangeListTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFilteredChangesDoesnTIncludeChanges() throws Exception {
|
||||
public void testFilteredChangesDoesnTIncludeChanges() {
|
||||
ChangeSet cs1 = addChangeSet(facade, createDirectory(r, "dir"));
|
||||
ChangeSet cs2 = addChangeSet(facade, createFile(r, "dir/FooBar"));
|
||||
ChangeSet cs3 = addChangeSet(facade, createFile(r, "dir/BarBaz"));
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ public class ChangeListTest extends ChangeListTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testForcesBegin() throws Exception {
|
||||
public void testForcesBegin() {
|
||||
facade.beginChangeSet();
|
||||
add(facade, createFile(r, "f1"));
|
||||
facade.beginChangeSet();
|
||||
|
||||
@@ -24,7 +24,6 @@ import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public class ActionsTest extends IntegrationTestCase {
|
||||
@@ -79,7 +78,7 @@ public class ActionsTest extends IntegrationTestCase {
|
||||
|
||||
CommandProcessor.getInstance().executeCommand(myProject, new RunnableAdapter() {
|
||||
@Override
|
||||
public void doRun() throws IOException {
|
||||
public void doRun() {
|
||||
setContent(f, "file");
|
||||
setDocumentTextFor(f, "doc1");
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarOutputStream;
|
||||
|
||||
public class BasicsTest extends IntegrationTestCase {
|
||||
public void testProcessingCommands() throws Exception {
|
||||
public void testProcessingCommands() {
|
||||
final VirtualFile[] f = new VirtualFile[1];
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(() -> CommandProcessor.getInstance().executeCommand(myProject, new RunnableAdapter() {
|
||||
@@ -51,7 +51,7 @@ public class BasicsTest extends IntegrationTestCase {
|
||||
assertEquals(2, getRevisionsFor(f[0]).size());
|
||||
}
|
||||
|
||||
public void testPuttingUserLabel() throws Exception {
|
||||
public void testPuttingUserLabel() {
|
||||
VirtualFile f = createChildData(myRoot, "f.txt");
|
||||
|
||||
LocalHistory.getInstance().putUserLabel(myProject, "global");
|
||||
@@ -69,7 +69,7 @@ public class BasicsTest extends IntegrationTestCase {
|
||||
assertEquals(-1, rr.get(2).getLabelColor());
|
||||
}
|
||||
|
||||
public void testPuttingSystemLabel() throws IOException {
|
||||
public void testPuttingSystemLabel() {
|
||||
VirtualFile f = createChildData(myRoot, "file.txt");
|
||||
|
||||
assertEquals(2, getRevisionsFor(f).size());
|
||||
@@ -86,7 +86,7 @@ public class BasicsTest extends IntegrationTestCase {
|
||||
assertEquals("label", rr.get(1).getLabel());
|
||||
}
|
||||
|
||||
public void testPuttingLabelWithUnsavedDocuments() throws Exception {
|
||||
public void testPuttingLabelWithUnsavedDocuments() {
|
||||
VirtualFile f = createChildData(myRoot, "f.txt");
|
||||
setContent(f, "1");
|
||||
|
||||
@@ -111,7 +111,7 @@ public class BasicsTest extends IntegrationTestCase {
|
||||
assertEquals("", new String(rr.get(7).findEntry().getContent().getBytes()));
|
||||
}
|
||||
|
||||
public void testDoNotRegisterSameUnsavedDocumentContentTwice() throws Exception {
|
||||
public void testDoNotRegisterSameUnsavedDocumentContentTwice() {
|
||||
VirtualFile f = createChildData(myRoot, "f.txt");
|
||||
setContent(f, "1");
|
||||
|
||||
@@ -128,7 +128,7 @@ public class BasicsTest extends IntegrationTestCase {
|
||||
assertEquals("", new String(rr.get(4).findEntry().getContent().getBytes()));
|
||||
}
|
||||
|
||||
public void testIsUnderControl() throws Exception {
|
||||
public void testIsUnderControl() {
|
||||
VirtualFile f1 = createChildData(myRoot, "file.txt");
|
||||
VirtualFile f2 = createChildData(myRoot, "file.hprof");
|
||||
|
||||
|
||||
+1
-1
@@ -144,7 +144,7 @@ public class ExternalChangesAndRefreshingTest extends IntegrationTestCase {
|
||||
assertEquals("content", content[0]);
|
||||
}
|
||||
|
||||
public void testDeletionOfFilteredDirectoryExternallyDoesNotThrowExceptionDuringRefresh() throws Exception {
|
||||
public void testDeletionOfFilteredDirectoryExternallyDoesNotThrowExceptionDuringRefresh() {
|
||||
int before = getRevisionsFor(myRoot).size();
|
||||
|
||||
createChildDirectory(myRoot, FILTERED_DIR_NAME);
|
||||
|
||||
+6
-6
@@ -51,7 +51,7 @@ public class FileListeningTest extends IntegrationTestCase {
|
||||
assertEquals(2, getRevisionsFor(f).size());
|
||||
}
|
||||
|
||||
public void testCreatingDirectories() throws Exception {
|
||||
public void testCreatingDirectories() {
|
||||
VirtualFile f = createDirectory("dir");
|
||||
assertEquals(2, getRevisionsFor(f).size());
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class FileListeningTest extends IntegrationTestCase {
|
||||
assertEquals(before, getRevisionsFor(myRoot).size());
|
||||
}
|
||||
|
||||
public void testIgnoringFilteredDirectories() throws Exception {
|
||||
public void testIgnoringFilteredDirectories() {
|
||||
int before = getRevisionsFor(myRoot).size();
|
||||
|
||||
createDirectory(FILTERED_DIR_NAME);
|
||||
@@ -152,7 +152,7 @@ public class FileListeningTest extends IntegrationTestCase {
|
||||
|
||||
addFileListenerDuring(l, new RunnableAdapter() {
|
||||
@Override
|
||||
public void doRun() throws IOException {
|
||||
public void doRun() {
|
||||
rename(f, "new.txt");
|
||||
}
|
||||
});
|
||||
@@ -195,7 +195,7 @@ public class FileListeningTest extends IntegrationTestCase {
|
||||
assertEquals(3, getRevisionsFor(f).size());
|
||||
}
|
||||
|
||||
public void testRenamingNonFilteredDirectoriesToFiltered() throws Exception {
|
||||
public void testRenamingNonFilteredDirectoriesToFiltered() {
|
||||
int before = getRevisionsFor(myRoot).size();
|
||||
|
||||
VirtualFile f = createDirectory("not_filtered");
|
||||
@@ -235,7 +235,7 @@ public class FileListeningTest extends IntegrationTestCase {
|
||||
});
|
||||
}
|
||||
|
||||
public void testDeletion() throws Exception {
|
||||
public void testDeletion() {
|
||||
VirtualFile f = createDirectory("f.txt");
|
||||
|
||||
int before = getRevisionsFor(myRoot).size();
|
||||
@@ -244,7 +244,7 @@ public class FileListeningTest extends IntegrationTestCase {
|
||||
assertEquals(before + 1, getRevisionsFor(myRoot).size());
|
||||
}
|
||||
|
||||
public void testDeletionOfFilteredDirectoryDoesNotThrowsException() throws Exception {
|
||||
public void testDeletionOfFilteredDirectoryDoesNotThrowsException() {
|
||||
int before = getRevisionsFor(myRoot).size();
|
||||
|
||||
VirtualFile f = createDirectory(FILTERED_DIR_NAME);
|
||||
|
||||
+5
-5
@@ -33,7 +33,7 @@ public class GettingContentAtDateTest extends IntegrationTestCase {
|
||||
f = createChildData(myRoot, "f.txt");
|
||||
}
|
||||
|
||||
public void testContentAtDate() throws Exception {
|
||||
public void testContentAtDate() {
|
||||
setContent(f, "1", TIMESTAMP_INCREMENT);
|
||||
setContent(f, "2", TIMESTAMP_INCREMENT * 2);
|
||||
|
||||
@@ -44,14 +44,14 @@ public class GettingContentAtDateTest extends IntegrationTestCase {
|
||||
assertContentAt(TIMESTAMP_INCREMENT * 3, null);
|
||||
}
|
||||
|
||||
public void testContentAtDateForFilteredFilesIsNull() throws Exception {
|
||||
public void testContentAtDateForFilteredFilesIsNull() {
|
||||
VirtualFile f = createChildData(myRoot, "f.class");
|
||||
setContent(f, "1", 1111);
|
||||
|
||||
assertContentAt(1111, null);
|
||||
}
|
||||
|
||||
public void testGettingFirstAvailableContentAfterPurge() throws Exception {
|
||||
public void testGettingFirstAvailableContentAfterPurge() {
|
||||
Clock.setTime(1);
|
||||
setContent(f, "1", TIMESTAMP_INCREMENT);
|
||||
Clock.setTime(2);
|
||||
@@ -66,7 +66,7 @@ public class GettingContentAtDateTest extends IntegrationTestCase {
|
||||
assertContentAt(TIMESTAMP_INCREMENT * 3, "3");
|
||||
}
|
||||
|
||||
public void testGettingMostRecentRevisionContent() throws Exception {
|
||||
public void testGettingMostRecentRevisionContent() {
|
||||
setContent(f, "1", TIMESTAMP_INCREMENT);
|
||||
setContent(f, "2", TIMESTAMP_INCREMENT * 2);
|
||||
|
||||
@@ -79,7 +79,7 @@ public class GettingContentAtDateTest extends IntegrationTestCase {
|
||||
assertContentAt(c, "2");
|
||||
}
|
||||
|
||||
public void testWithUnsavedDocuments() throws Exception {
|
||||
public void testWithUnsavedDocuments() {
|
||||
setContent(f, "FILE1", TIMESTAMP_INCREMENT);
|
||||
|
||||
Clock.setTime(TIMESTAMP_INCREMENT * 2);
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class IdeaGatewayTest extends IntegrationTestCase {
|
||||
public void testFindingFile() throws Exception {
|
||||
public void testFindingFile() {
|
||||
assertEquals(myRoot, myGateway.findVirtualFile(myRoot.getPath()));
|
||||
assertNull(myGateway.findVirtualFile(myRoot.getPath() + "/nonexistent"));
|
||||
}
|
||||
|
||||
+5
-5
@@ -106,17 +106,17 @@ public abstract class IntegrationTestCase extends PlatformTestCase {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected VirtualFile createDirectory(String name) throws IOException {
|
||||
protected VirtualFile createDirectory(String name) {
|
||||
VirtualFile file = LocalFileSystem.getInstance().refreshAndFindFileByPath(createDirectoryExternally(name));
|
||||
assertNotNull(name, file);
|
||||
return file;
|
||||
}
|
||||
|
||||
protected void setContent(VirtualFile f, String content) throws IOException {
|
||||
protected void setContent(VirtualFile f, String content) {
|
||||
setContent(f, content, f.getTimeStamp() + TIMESTAMP_INCREMENT);
|
||||
}
|
||||
|
||||
protected void setContent(VirtualFile f, String content, long timestamp) throws IOException {
|
||||
protected void setContent(VirtualFile f, String content, long timestamp) {
|
||||
setBinaryContent(f, content.getBytes(CharsetToolkit.UTF8_CHARSET), -1, timestamp,this);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ public abstract class IntegrationTestCase extends PlatformTestCase {
|
||||
return FileUtil.toSystemIndependentName(f.getPath());
|
||||
}
|
||||
|
||||
protected String createDirectoryExternally(String name) throws IOException {
|
||||
protected String createDirectoryExternally(String name) {
|
||||
File f = new File(myRoot.getPath(), name);
|
||||
assertTrue(f.getPath(), f.mkdirs() || f.isDirectory());
|
||||
return FileUtil.toSystemIndependentName(f.getPath());
|
||||
@@ -187,7 +187,7 @@ public abstract class IntegrationTestCase extends PlatformTestCase {
|
||||
});
|
||||
}
|
||||
|
||||
protected static void addFileListenerDuring(VirtualFileListener l, Runnable r) throws Exception {
|
||||
protected static void addFileListenerDuring(VirtualFileListener l, Runnable r) {
|
||||
VirtualFileManager.getInstance().addVirtualFileListener(l);
|
||||
try {
|
||||
r.run();
|
||||
|
||||
+2
-3
@@ -26,7 +26,6 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -40,7 +39,7 @@ public abstract class PatchingTestCase extends IntegrationTestCase {
|
||||
patchFilePath = new File(dir, "patch").getPath();
|
||||
}
|
||||
|
||||
protected void clearRoot() throws IOException {
|
||||
protected void clearRoot() {
|
||||
for (VirtualFile f : myRoot.getChildren()) {
|
||||
delete(f);
|
||||
}
|
||||
@@ -54,7 +53,7 @@ public abstract class PatchingTestCase extends IntegrationTestCase {
|
||||
new PatchApplier<BinaryFilePatch>(myProject, myRoot, patches, null, null, null).execute();
|
||||
}
|
||||
|
||||
protected static void createChildDataWithContent(@NotNull VirtualFile dir, @NotNull String name) throws IOException {
|
||||
protected static void createChildDataWithContent(@NotNull VirtualFile dir, @NotNull String name) {
|
||||
createChildData(dir, name);
|
||||
VirtualFile file = dir.findChild(name);
|
||||
setFileText(file, "some content");
|
||||
|
||||
+2
-2
@@ -72,7 +72,7 @@ public class RevisionsAndDiffsTest extends IntegrationTestCase {
|
||||
assertContent("content", e);
|
||||
}
|
||||
|
||||
public void testCurrentRevisionForDirectoryAfterPurge() throws Exception {
|
||||
public void testCurrentRevisionForDirectoryAfterPurge() {
|
||||
Clock.setTime(10);
|
||||
VirtualFile f = createDirectory("dir");
|
||||
getVcs().getChangeListInTests().purgeObsolete(0);
|
||||
@@ -182,7 +182,7 @@ public class RevisionsAndDiffsTest extends IntegrationTestCase {
|
||||
assertNull(rr.get(3).findEntry());
|
||||
}
|
||||
|
||||
public void testRevisionForDirectoryWithTheSameNameAsDeletedOne() throws IOException {
|
||||
public void testRevisionForDirectoryWithTheSameNameAsDeletedOne() {
|
||||
VirtualFile dir = createDirectory("dir");
|
||||
delete(dir);
|
||||
dir = createDirectory("dir");
|
||||
|
||||
+3
-4
@@ -25,7 +25,6 @@ import com.intellij.util.ArrayUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
@@ -105,7 +104,7 @@ public class TestVirtualFile extends VirtualFile {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public byte[] contentsToByteArray() throws IOException {
|
||||
public byte[] contentsToByteArray() {
|
||||
return myContent == null ? ArrayUtil.EMPTY_BYTE_ARRAY : myContent.getBytes();
|
||||
}
|
||||
|
||||
@@ -138,7 +137,7 @@ public class TestVirtualFile extends VirtualFile {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public OutputStream getOutputStream(Object requestor, long newModificationStamp, long newTimeStamp) throws IOException {
|
||||
public OutputStream getOutputStream(Object requestor, long newModificationStamp, long newTimeStamp) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@@ -148,7 +147,7 @@ public class TestVirtualFile extends VirtualFile {
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getInputStream() throws IOException {
|
||||
public InputStream getInputStream() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public class VisitingTest extends IntegrationTestCase {
|
||||
assertVisitorLog("begin create end finished ", visitor);
|
||||
}
|
||||
|
||||
private void assertVisitorLog(final String expected) throws Exception {
|
||||
private void assertVisitorLog(final String expected) {
|
||||
TestVisitor visitor = new TestVisitor();
|
||||
assertVisitorLog(expected, visitor);
|
||||
}
|
||||
@@ -159,7 +159,7 @@ public class VisitingTest extends IntegrationTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void end(ChangeSet c) throws StopVisitingException {
|
||||
public void end(ChangeSet c) {
|
||||
log += "end ";
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ public class VisitingTest extends IntegrationTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(RenameChange c) throws StopVisitingException {
|
||||
public void visit(RenameChange c) {
|
||||
log += "rename ";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import java.util.List;
|
||||
|
||||
|
||||
public class DirectoryChangeModelTest extends IntegrationTestCase {
|
||||
public void testNames() throws IOException {
|
||||
public void testNames() {
|
||||
VirtualFile f = createDirectory("foo");
|
||||
rename(f, "bar");
|
||||
|
||||
|
||||
+2
-2
@@ -28,13 +28,13 @@ import java.util.List;
|
||||
public class DirectoryHistoryDialogModelTest extends LocalHistoryUITestCase {
|
||||
private DirectoryHistoryDialogModel m;
|
||||
|
||||
public void testTitle() throws IOException {
|
||||
public void testTitle() {
|
||||
VirtualFile dir = createDirectory("dir");
|
||||
initModelFor(dir);
|
||||
assertEquals(FileUtil.toSystemDependentName(dir.getPath()), m.getTitle());
|
||||
}
|
||||
|
||||
public void testNoDifference() throws IOException {
|
||||
public void testNoDifference() {
|
||||
VirtualFile dir = createDirectory("dir");
|
||||
|
||||
getVcs().getChangeListInTests().purgeObsolete(0);
|
||||
|
||||
+1
-2
@@ -22,11 +22,10 @@ import com.intellij.history.integration.ui.views.DirectoryChange;
|
||||
import com.intellij.history.integration.ui.views.DirectoryHistoryDialog;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
|
||||
public class DirectoryHistoryDialogTest extends LocalHistoryUITestCase {
|
||||
public void testDialogWorks() throws IOException {
|
||||
public void testDialogWorks() {
|
||||
DirectoryHistoryDialog d = new DirectoryHistoryDialog(myProject, myGateway, myRoot);
|
||||
Disposer.dispose(d);
|
||||
}
|
||||
|
||||
+6
-7
@@ -28,18 +28,17 @@ import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.text.DateFormatUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
|
||||
public class FileHistoryDialogTest extends LocalHistoryUITestCase {
|
||||
public void testDialogWorks() throws IOException {
|
||||
public void testDialogWorks() {
|
||||
VirtualFile file = createChildData(myRoot, "f.txt");
|
||||
|
||||
FileHistoryDialog d = new FileHistoryDialog(myProject, myGateway, file);
|
||||
Disposer.dispose(d);
|
||||
}
|
||||
|
||||
public void testTitles() throws IOException {
|
||||
public void testTitles() {
|
||||
long leftTime = new Date(2001 - 1900, 1, 3, 12, 0).getTime();
|
||||
long rightTime = new Date(2002 - 1900, 2, 4, 14, 0).getTime();
|
||||
|
||||
@@ -61,7 +60,7 @@ public class FileHistoryDialogTest extends LocalHistoryUITestCase {
|
||||
m.getDifferenceModel().getRightTitle(new NullRevisionsProgress()));
|
||||
}
|
||||
|
||||
public void testContent() throws IOException {
|
||||
public void testContent() {
|
||||
VirtualFile f = createChildData(myRoot, "f.txt");
|
||||
setBinaryContent(f, "old".getBytes());
|
||||
setBinaryContent(f, "new".getBytes());
|
||||
@@ -72,7 +71,7 @@ public class FileHistoryDialogTest extends LocalHistoryUITestCase {
|
||||
assertDiffContents("old", "new", m);
|
||||
}
|
||||
|
||||
public void testContentWhenOnlyOneRevisionSelected() throws IOException {
|
||||
public void testContentWhenOnlyOneRevisionSelected() {
|
||||
VirtualFile f = createChildData(myRoot, "f.txt");
|
||||
setBinaryContent(f, "old".getBytes());
|
||||
setBinaryContent(f, "new".getBytes());
|
||||
@@ -82,7 +81,7 @@ public class FileHistoryDialogTest extends LocalHistoryUITestCase {
|
||||
assertDiffContents("old", "new", m);
|
||||
}
|
||||
|
||||
public void testContentForCurrentRevision() throws IOException {
|
||||
public void testContentForCurrentRevision() {
|
||||
VirtualFile f = createChildData(myRoot, "f.txt");
|
||||
setBinaryContent(f, "old".getBytes());
|
||||
setBinaryContent(f, "current".getBytes());
|
||||
@@ -107,7 +106,7 @@ public class FileHistoryDialogTest extends LocalHistoryUITestCase {
|
||||
assertEquals("newDir", dir.getName());
|
||||
}
|
||||
|
||||
private void assertDiffContents(String leftContent, String rightContent, FileHistoryDialogModel m) throws IOException {
|
||||
private void assertDiffContents(String leftContent, String rightContent, FileHistoryDialogModel m) {
|
||||
DiffContent left = getLeftDiffContent(m);
|
||||
DiffContent right = getRightDiffContent(m);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user