This commit is contained in:
Alexey Kudravtsev
2011-02-17 14:00:14 +03:00
parent 4e45f7dd08
commit 1f8283df9b
3 changed files with 13 additions and 11 deletions
@@ -17,6 +17,7 @@ package com.intellij.lang;
import com.intellij.lang.impl.PsiBuilderImpl;
import com.intellij.lexer.LexerBase;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ex.ApplicationEx;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.psi.TokenType;
@@ -64,7 +65,7 @@ public class PsiBuilderQuickTest {
@BeforeClass
public static void setUp() {
if (ApplicationManagerEx.getApplication() == null) {
if (ApplicationManager.getApplication() == null) {
if (myMockApp == null) {
myMockApp = createMock(ApplicationEx.class);
expect(myMockApp.isInternal()).andReturn(true);
@@ -466,7 +467,7 @@ public class PsiBuilderQuickTest {
" PsiElement(OTHER)('}')\n");
}
private static abstract class MyLazyElementType extends ILazyParseableElementType implements ILightLazyParseableElementType {
private abstract static class MyLazyElementType extends ILazyParseableElementType implements ILightLazyParseableElementType {
protected MyLazyElementType(@NonNls String debugName) {
super(debugName, Language.ANY);
}
@@ -384,7 +384,7 @@ public abstract class MavenTestCase extends UsefulTestCase {
return createProfilesFile(createProjectSubDir(relativePath), xml, false);
}
private VirtualFile createProfilesFile(VirtualFile dir, String xml, boolean oldStyle) throws IOException {
private static VirtualFile createProfilesFile(VirtualFile dir, String xml, boolean oldStyle) throws IOException {
return createProfilesFile(dir, createValidProfiles(xml, oldStyle));
}
@@ -396,7 +396,7 @@ public abstract class MavenTestCase extends UsefulTestCase {
return createProfilesFile(createProjectSubDir(relativePath), content);
}
private VirtualFile createProfilesFile(final VirtualFile dir, String content) throws IOException {
private static VirtualFile createProfilesFile(final VirtualFile dir, String content) throws IOException {
VirtualFile f = dir.findChild("profiles.xml");
if (f == null) {
f = new WriteAction<VirtualFile>() {
@@ -411,6 +411,7 @@ public abstract class MavenTestCase extends UsefulTestCase {
return f;
}
@Language("XML")
private static String createValidProfiles(String xml, boolean oldStyle) {
if (oldStyle) {
return "<?xml version=\"1.0\"?>" +
@@ -478,15 +479,15 @@ public abstract class MavenTestCase extends UsefulTestCase {
assertEquals(expected, actual);
}
protected <T, U> void assertOrderedElementsAreEqual(Collection<U> actual, Collection<T> expected) {
protected static <T, U> void assertOrderedElementsAreEqual(Collection<U> actual, Collection<T> expected) {
assertOrderedElementsAreEqual(actual, expected.toArray());
}
protected <T, U> void assertUnorderedElementsAreEqual(Collection<U> actual, Collection<T> expected) {
protected static <T, U> void assertUnorderedElementsAreEqual(Collection<U> actual, Collection<T> expected) {
assertUnorderedElementsAreEqual(actual, expected.toArray());
}
protected <T, U> void assertUnorderedElementsAreEqual(U[] actual, T... expected) {
protected static <T, U> void assertUnorderedElementsAreEqual(U[] actual, T... expected) {
assertUnorderedElementsAreEqual(Arrays.asList(actual), expected);
}
@@ -514,7 +515,7 @@ public abstract class MavenTestCase extends UsefulTestCase {
for (int i = 0; i < expected.length; i++) {
T expectedElement = expected[i];
U actualElement = actualList.get(i);
assertTrue(s, expectedElement.equals(actualElement));
assertEquals(s, expectedElement, actualElement);
}
}
@@ -526,7 +527,7 @@ public abstract class MavenTestCase extends UsefulTestCase {
protected static <T> void assertDoNotContain(List<T> actual, T... expected) {
List<T> actualCopy = new ArrayList<T>(actual);
actualCopy.removeAll(Arrays.asList(expected));
assertTrue(actual.toString(), actualCopy.size() == actual.size());
assertEquals(actual.toString(), actualCopy.size(), actual.size());
}
protected boolean ignore() {
@@ -19,7 +19,7 @@ import com.intellij.compiler.CompilerConfiguration;
import com.intellij.openapi.application.Result;
import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.fileTypes.FileTypeManager;
import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.openapi.fileTypes.FileTypes;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.idea.maven.MavenImportingTestCase;
@@ -858,7 +858,7 @@ public class ResourceFilteringTest extends MavenImportingTestCase {
public void testDoNotFilterButCopyBigFiles() throws Exception {
assertFalse(CompilerConfiguration.getInstance(myProject).isResourceFile("file.xyz"));
assertEquals(FileTypeManager.getInstance().getFileTypeByFileName("file.xyz"), StdFileTypes.UNKNOWN);
assertEquals(FileTypeManager.getInstance().getFileTypeByFileName("file.xyz"), FileTypes.UNKNOWN);
createProjectSubFile("resources/file.xyz").setBinaryContent(new byte[1024 * 1024 * 20]);