Rename methods (prefix -> prefixes)
This commit is contained in:
@@ -167,7 +167,7 @@ public class ExpectedCompletionUtils {
|
||||
|
||||
public static CompletionProposal[] processProposalAssertions(String fileText, String... prefixes) {
|
||||
Collection<CompletionProposal> proposals = new ArrayList<CompletionProposal>();
|
||||
for (String proposalStr : InTextDirectivesUtils.findListWithPrefix(fileText, prefixes)) {
|
||||
for (String proposalStr : InTextDirectivesUtils.findListWithPrefixes(fileText, prefixes)) {
|
||||
Matcher matcher = CompletionProposal.PATTERN.matcher(proposalStr);
|
||||
matcher.find();
|
||||
proposals.add(new CompletionProposal(matcher.group(CompletionProposal.LOOKUP_STRING_GROUP_INDEX),
|
||||
|
||||
@@ -79,7 +79,7 @@ public class JetConfidenceTest extends LightCompletionTestCase {
|
||||
protected static String getTypeTextFromFile() {
|
||||
String text = getEditor().getDocument().getText();
|
||||
|
||||
String[] directives = InTextDirectivesUtils.findArrayWithPrefix(text, TYPE_DIRECTIVE_PREFIX);
|
||||
String[] directives = InTextDirectivesUtils.findArrayWithPrefixes(text, TYPE_DIRECTIVE_PREFIX);
|
||||
assertEquals("One directive with \"" + TYPE_DIRECTIVE_PREFIX +"\" expected", 1, directives.length);
|
||||
|
||||
return StringUtil.unquoteString(directives[0]);
|
||||
|
||||
@@ -30,8 +30,8 @@ public class FormattingSettingsConfigurator {
|
||||
private final String[] settingsToFalse;
|
||||
|
||||
public FormattingSettingsConfigurator(String fileText) {
|
||||
settingsToTrue = InTextDirectivesUtils.findArrayWithPrefix(fileText, "// SET_TRUE:");
|
||||
settingsToFalse = InTextDirectivesUtils.findArrayWithPrefix(fileText, "// SET_FALSE:");
|
||||
settingsToTrue = InTextDirectivesUtils.findArrayWithPrefixes(fileText, "// SET_TRUE:");
|
||||
settingsToFalse = InTextDirectivesUtils.findArrayWithPrefixes(fileText, "// SET_FALSE:");
|
||||
}
|
||||
|
||||
public void configureSettings(CodeStyleSettings settings) {
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public abstract class AbstractCodeTransformationTest extends LightCodeInsightTes
|
||||
configureByFile(path);
|
||||
|
||||
String fileText = FileUtil.loadFile(new File(path));
|
||||
String isApplicableString = InTextDirectivesUtils.findStringWithPrefix(fileText, "// IS_APPLICABLE: ");
|
||||
String isApplicableString = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// IS_APPLICABLE: ");
|
||||
boolean isApplicableExpected = isApplicableString == null || isApplicableString.equals("true");
|
||||
|
||||
assert isApplicableExpected == intentionAction.isAvailable(getProject(), getEditor(), getFile())
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ public abstract class AbstractSurroundWithTest extends LightCodeInsightTestCase
|
||||
configureByFile(path);
|
||||
|
||||
String fileText = FileUtil.loadFile(new File(path));
|
||||
String isApplicableString = InTextDirectivesUtils.findStringWithPrefix(fileText, "// IS_APPLICABLE: ");
|
||||
String isApplicableString = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// IS_APPLICABLE: ");
|
||||
|
||||
if (isApplicableString != null) {
|
||||
boolean isApplicableExpected = toString().equals("true");
|
||||
|
||||
@@ -49,7 +49,7 @@ public final class NavigationTestUtils {
|
||||
|
||||
public static void assertGotoImplementations(Editor editor, GotoTargetHandler.GotoData gotoData) {
|
||||
// Get expected references from the tested document
|
||||
List<String> expectedReferences = InTextDirectivesUtils.findListWithPrefix(editor.getDocument().getText(), "// REF:");
|
||||
List<String> expectedReferences = InTextDirectivesUtils.findListWithPrefixes(editor.getDocument().getText(), "// REF:");
|
||||
Collections.sort(expectedReferences);
|
||||
|
||||
if (gotoData != null) {
|
||||
@@ -72,11 +72,11 @@ public final class NavigationTestUtils {
|
||||
|
||||
public static void assertGotoSymbol(@NotNull Project project, @NotNull Editor editor) {
|
||||
|
||||
List<String> searchTextList = InTextDirectivesUtils.findListWithPrefix(editor.getDocument().getText(), "// SEARCH_TEXT:");
|
||||
List<String> searchTextList = InTextDirectivesUtils.findListWithPrefixes(editor.getDocument().getText(), "// SEARCH_TEXT:");
|
||||
Assert.assertFalse("There's no search text in test data file given. Use '// SEARCH_TEXT:' directive",
|
||||
searchTextList.isEmpty());
|
||||
|
||||
List<String> expectedReferences = InTextDirectivesUtils.findListWithPrefix(editor.getDocument().getText(), "// REF:");
|
||||
List<String> expectedReferences = InTextDirectivesUtils.findListWithPrefixes(editor.getDocument().getText(), "// REF:");
|
||||
|
||||
String searchText = searchTextList.get(0);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class QuickFixActionsUtils {
|
||||
}
|
||||
});
|
||||
|
||||
List<String> expectedErrorStrings = InTextDirectivesUtils.findLinesWithPrefixRemoved(file.getText(), "// ERROR:");
|
||||
List<String> expectedErrorStrings = InTextDirectivesUtils.findLinesWithPrefixesRemoved(file.getText(), "// ERROR:");
|
||||
Collections.sort(expectedErrorStrings);
|
||||
|
||||
UsefulTestCase.assertOrderedEquals(
|
||||
@@ -69,7 +69,7 @@ public class QuickFixActionsUtils {
|
||||
|
||||
public static void checkAvailableActionsAreExpected(JetFile file, Collection<IntentionAction> availableActions) {
|
||||
List<String> validActions = Ordering.natural().sortedCopy(
|
||||
Sets.newHashSet(InTextDirectivesUtils.findLinesWithPrefixRemoved(file.getText(), "// ACTION:")));
|
||||
Sets.newHashSet(InTextDirectivesUtils.findLinesWithPrefixesRemoved(file.getText(), "// ACTION:")));
|
||||
|
||||
Collection<String> actualActions = Ordering.natural().sortedCopy(
|
||||
Collections2.transform(availableActions, new Function<IntentionAction, String>() {
|
||||
|
||||
@@ -50,7 +50,7 @@ public abstract class AbstractSearcherTest extends LightCodeInsightFixtureTestCa
|
||||
}
|
||||
|
||||
protected void checkResult(Query<?> actual) throws IOException {
|
||||
List<String> expected = InTextDirectivesUtils.findListWithPrefix(FileUtil.loadFile(new File(getPathToFile())), "// SEARCH: ");
|
||||
List<String> expected = InTextDirectivesUtils.findListWithPrefixes(FileUtil.loadFile(new File(getPathToFile())), "// SEARCH: ");
|
||||
List<String> actualModified = new ArrayList<String>();
|
||||
for (Object member : actual) {
|
||||
actualModified.add(member.toString());
|
||||
|
||||
@@ -42,7 +42,8 @@ public class AnnotatedMembersSearchTest extends AbstractSearcherTest {
|
||||
|
||||
private void doTest() throws IOException {
|
||||
myFixture.configureByFile(getFileName());
|
||||
List<String> directives = InTextDirectivesUtils.findListWithPrefix(FileUtil.loadFile(new File(getPathToFile())), "// ANNOTATION: ");
|
||||
List<String> directives = InTextDirectivesUtils.findListWithPrefixes(FileUtil.loadFile(new File(getPathToFile())),
|
||||
"// ANNOTATION: ");
|
||||
assertFalse("Specify ANNOTATION directive in test file", directives.isEmpty());
|
||||
String annotationClassName = directives.get(0);
|
||||
PsiClass psiClass = getPsiClass(annotationClassName);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ClassInheritorsSearchTest extends AbstractSearcherTest {
|
||||
|
||||
private void doTest() throws IOException {
|
||||
myFixture.configureByFile(getFileName());
|
||||
List<String> directives = InTextDirectivesUtils.findListWithPrefix(FileUtil.loadFile(new File(getPathToFile())), "// CLASS: ");
|
||||
List<String> directives = InTextDirectivesUtils.findListWithPrefixes(FileUtil.loadFile(new File(getPathToFile())), "// CLASS: ");
|
||||
assertFalse("Specify CLASS directive in test file", directives.isEmpty());
|
||||
String superClassName = directives.get(0);
|
||||
PsiClass psiClass = getPsiClass(superClassName);
|
||||
|
||||
@@ -49,7 +49,7 @@ public class JUnitMembersSearcherTest extends AbstractSearcherTest {
|
||||
|
||||
private void doJUnit3test() throws IOException {
|
||||
myFixture.configureByFile(getFileName());
|
||||
List<String> directives = InTextDirectivesUtils.findListWithPrefix(FileUtil.loadFile(new File(getPathToFile())), "// CLASS: ");
|
||||
List<String> directives = InTextDirectivesUtils.findListWithPrefixes(FileUtil.loadFile(new File(getPathToFile())), "// CLASS: ");
|
||||
assertFalse("Specify CLASS directive in test file", directives.isEmpty());
|
||||
String superClassName = directives.get(0);
|
||||
PsiClass psiClass = getPsiClass(superClassName);
|
||||
@@ -58,7 +58,8 @@ public class JUnitMembersSearcherTest extends AbstractSearcherTest {
|
||||
|
||||
private void doJUnit4test() throws IOException {
|
||||
myFixture.configureByFile(getFileName());
|
||||
List<String> directives = InTextDirectivesUtils.findListWithPrefix(FileUtil.loadFile(new File(getPathToFile())), "// ANNOTATION: ");
|
||||
List<String> directives = InTextDirectivesUtils.findListWithPrefixes(FileUtil.loadFile(new File(getPathToFile())),
|
||||
"// ANNOTATION: ");
|
||||
assertFalse("Specify ANNOTATION directive in test file", directives.isEmpty());
|
||||
String annotationClassName = directives.get(0);
|
||||
PsiClass psiClass = getPsiClass(annotationClassName);
|
||||
|
||||
Reference in New Issue
Block a user