Basic test for method extract: IDEA-CR-53127

GitOrigin-RevId: 3c41530c54d0d26076f65bc38f23993b82e7f56f
This commit is contained in:
Roman.Ivanov
2019-10-02 21:20:28 +07:00
committed by intellij-monorepo-bot
parent 368eaa7581
commit eac8432bb6
2 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
// "Extract method" "false"
class Main {
static boolean test() {
throw new RuntimeException();
}
private void notExtractable() {
while (true) {
<selection>if (test()) {
System.out.println("ads");
break;
} else {
System.out.println("Asd");
if (test()) {
return;
}
System.out.println("ASdasd");
</selection>
}
somethingElse();
}
}
private static void somethingElse() {
}
}

View File

@@ -0,0 +1,26 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.java.codeInsight.intention;
import com.intellij.codeInsight.daemon.LightIntentionActionTestCase;
import com.intellij.pom.java.LanguageLevel;
public class ExtractMethodIntentionActionTest extends LightIntentionActionTestCase {
@Override
protected String getBasePath() {
return "/codeInsight/daemonCodeAnalyzer/quickFix/extractMethod";
}
}