From 3300cd7900f7a07c350f175c9e5198c8d1aab8d1 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 19 Dec 2011 12:26:51 +0100 Subject: [PATCH] VFS tests moved to platform-tests --- .../openapi/vfs/DummyFileSystemTest.java | 25 ++++++++--- .../openapi/vfs/GetPathPerformanceTest.java | 19 +++++++- .../openapi/vfs/RefreshChildrenTest.java | 39 ++++++++++++----- .../com/intellij/openapi/vfs/VfsUtilTest.java | 43 +++++++++++++------ .../openapi/vfs/VirtualFilePointerTest.java | 19 +++++++- .../vfs/local}/LocalFileSystemTest.java | 25 +++++++---- .../vfs/local/SymLinkHandlingTest.java | 2 + .../LightPlatformLangTestCase.java | 23 ++++++++++ .../testFramework/PlatformLangTestCase.java | 23 ++++++++++ .../testFramework/PlatformTestUtil.java | 6 +-- 10 files changed, 179 insertions(+), 45 deletions(-) rename {java/java-tests => platform/platform-tests}/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java (58%) rename {java/java-tests => platform/platform-tests}/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java (63%) rename {java/java-tests => platform/platform-tests}/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java (54%) rename {java/java-tests => platform/platform-tests}/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java (83%) rename {java/java-tests => platform/platform-tests}/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java (96%) rename {java/java-tests/testSrc/com/intellij/openapi/vfs => platform/platform-tests/testSrc/com/intellij/openapi/vfs/local}/LocalFileSystemTest.java (94%) create mode 100644 platform/testFramework/src/com/intellij/testFramework/LightPlatformLangTestCase.java create mode 100644 platform/testFramework/src/com/intellij/testFramework/PlatformLangTestCase.java diff --git a/java/java-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java similarity index 58% rename from java/java-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java index 17014f94662b..179b7dc68bb2 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java @@ -1,12 +1,27 @@ +/* + * Copyright 2000-2011 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.openapi.vfs; import com.intellij.openapi.application.Result; import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.vfs.ex.dummy.DummyFileSystem; -import com.intellij.testFramework.IdeaTestCase; +import com.intellij.testFramework.PlatformLangTestCase; -public class DummyFileSystemTest extends IdeaTestCase { - DummyFileSystem fs; +public class DummyFileSystemTest extends PlatformLangTestCase { + private DummyFileSystem fs; @Override protected void setUp() throws Exception { @@ -19,7 +34,7 @@ public class DummyFileSystemTest extends IdeaTestCase { VirtualFile f = new WriteAction() { @Override protected void run(Result result) throws Throwable { - VirtualFile res = root.createChildData(null, "f"); + VirtualFile res = root.createChildData(this, "f"); result.setResult(res); } }.execute().getResultObject(); @@ -37,7 +52,7 @@ public class DummyFileSystemTest extends IdeaTestCase { } }); - f.delete(null); + f.delete(this); for (int i = 0; i < 2; i++) { assertNotNull(events[i]); diff --git a/java/java-tests/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java similarity index 63% rename from java/java-tests/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java index c3270eddb929..1dab0f73b0f2 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java @@ -1,16 +1,31 @@ +/* + * Copyright 2000-2011 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.openapi.vfs; import com.intellij.openapi.Disposable; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; -import com.intellij.testFramework.LightPlatformTestCase; +import com.intellij.testFramework.LightPlatformLangTestCase; import com.intellij.testFramework.PlatformTestUtil; import com.intellij.util.ThrowableRunnable; import java.io.File; import java.io.IOException; -public class GetPathPerformanceTest extends LightPlatformTestCase { +public class GetPathPerformanceTest extends LightPlatformLangTestCase { public void testGetPath() throws IOException, InterruptedException { final File dir = FileUtil.createTempDirectory("GetPath",""); disposeOnTearDown(new Disposable() { diff --git a/java/java-tests/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java similarity index 54% rename from java/java-tests/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java index dedc483a8e89..03804fdc56cd 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java @@ -1,21 +1,34 @@ +/* + * Copyright 2000-2011 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.openapi.vfs; import com.intellij.openapi.util.io.FileUtil; -import com.intellij.testFramework.IdeaTestCase; +import com.intellij.testFramework.PlatformLangTestCase; import java.io.*; /** * @author yole */ -public class RefreshChildrenTest extends IdeaTestCase { +public class RefreshChildrenTest extends PlatformLangTestCase { private File testDir; @Override protected void setUp() throws Exception { - - // the superclass sets tmpdir on every run and cleans up, but we want to do it our way - + // the superclass sets tmp. dir on every run and cleans up, but we want to do it our way String baseTempDir = FileUtil.getTempDirectory(); testDir = new File(baseTempDir, "RefreshChildrenTest." + getName()); @@ -30,12 +43,13 @@ public class RefreshChildrenTest extends IdeaTestCase { public void testRefreshSeesLatestDirectoryContents() throws Exception { assertFalse(testDir.exists()); - testDir.mkdir(); + assert testDir.exists() || testDir.mkdir() : testDir; assertTrue(testDir.isDirectory()); writeFile(testDir, "Foo.java", ""); LocalFileSystem local = LocalFileSystem.getInstance(); VirtualFile virtualDir = local.findFileByIoFile(testDir); + assert virtualDir != null : virtualDir; virtualDir.getChildren(); virtualDir.refresh(false, true); @@ -47,13 +61,17 @@ public class RefreshChildrenTest extends IdeaTestCase { checkChildCount(virtualDir, 2); } - private void writeFile(File dir, String filename, String contents) throws IOException { + private static void writeFile(File dir, String filename, String contents) throws IOException { Writer writer = new OutputStreamWriter(new FileOutputStream(new File(dir, filename)), "UTF-8"); - writer.write(contents); - writer.close(); + try { + writer.write(contents); + } + finally { + writer.close(); + } } - private void checkChildCount(VirtualFile virtualDir, int expectedCount) { + private static void checkChildCount(VirtualFile virtualDir, int expectedCount) { VirtualFile[] children = virtualDir.getChildren(); if (children.length != expectedCount) { System.err.println("children:"); @@ -63,5 +81,4 @@ public class RefreshChildrenTest extends IdeaTestCase { } assertEquals(expectedCount, children.length); } - } diff --git a/java/java-tests/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java similarity index 83% rename from java/java-tests/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java index c9f857b36418..0b34c40a2d8b 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2011 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.openapi.vfs; import com.intellij.concurrency.JobUtil; @@ -6,8 +21,9 @@ import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.application.ex.PathManagerEx; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.util.io.FileUtil; -import com.intellij.testFramework.IdeaTestCase; -import com.intellij.testFramework.IdeaTestUtil; +import com.intellij.testFramework.PlatformLangTestCase; +import com.intellij.testFramework.PlatformTestUtil; +import com.intellij.testFramework.UsefulTestCase; import com.intellij.util.Processor; import com.intellij.util.ui.UIUtil; @@ -22,7 +38,7 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -public class VfsUtilTest extends IdeaTestCase { +public class VfsUtilTest extends PlatformLangTestCase { @Override protected void runBareRunnable(Runnable runnable) throws Throwable { runnable.run(); @@ -82,7 +98,7 @@ public class VfsUtilTest extends IdeaTestCase { final VirtualFileFilter fileFilter = new VirtualFileFilter() { @Override public boolean accept(VirtualFile file) { - return IdeaTestUtil.CVS_FILE_FILTER.accept(file) && !file.getName().endsWith(".new"); + return PlatformTestUtil.CVS_FILE_FILTER.accept(file) && !file.getName().endsWith(".new"); } }; for (VirtualFile child : children) { @@ -156,8 +172,8 @@ public class VfsUtilTest extends IdeaTestCase { } }.execute().getResultObject(); LocalFileSystem fs = LocalFileSystem.getInstance(); - VirtualFile vtemp = fs.findFileByIoFile(temp); - assert vtemp != null; + VirtualFile vTemp = fs.findFileByIoFile(temp); + assert vTemp != null; VirtualFile[] children = new VirtualFile[N]; long[] timestamp = new long[N]; @@ -170,7 +186,7 @@ public class VfsUtilTest extends IdeaTestCase { timestamp[i] = file.lastModified(); } - vtemp.refresh(false,true); + vTemp.refresh(false, true); for (int i=0;i< N;i++) { File file = new File(temp, i + ".txt"); @@ -183,7 +199,8 @@ public class VfsUtilTest extends IdeaTestCase { assertNotNull(child); long mod = child.getTimeStamp(); - assertEquals("File:"+child.getPath()+"; mod:"+ new Date(mod)+"; io:"+new File(child.getPath()).lastModified(),timestamp[i], mod); + assertEquals("File:" + child.getPath() + "; mod:" + new Date(mod) + "; io:" + new File(child.getPath()).lastModified(), + timestamp[i], mod); } Thread.sleep(2000); // todo[r.sh] find a way to get timestamps with millisecond granularity on Linux ? @@ -231,13 +248,13 @@ public class VfsUtilTest extends IdeaTestCase { result.setResult(res); } }.execute().getResultObject(); - VirtualFile vdir = LocalFileSystem.getInstance().findFileByIoFile(tempDir); - assertNotNull(vdir); - assertTrue(vdir.isDirectory()); + VirtualFile vDir = LocalFileSystem.getInstance().findFileByIoFile(tempDir); + assertNotNull(vDir); + assertTrue(vDir.isDirectory()); - VirtualFile child = vdir.findChild(" "); + VirtualFile child = vDir.findChild(" "); assertNull(child); - assertEmpty(vdir.getChildren()); + UsefulTestCase.assertEmpty(vDir.getChildren()); } } diff --git a/java/java-tests/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java similarity index 96% rename from java/java-tests/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java index eee42b232161..bef72829f97d 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2011 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.openapi.vfs; import com.intellij.concurrency.JobUtil; @@ -11,7 +26,7 @@ import com.intellij.openapi.vfs.impl.VirtualFilePointerImpl; import com.intellij.openapi.vfs.pointers.VirtualFilePointer; import com.intellij.openapi.vfs.pointers.VirtualFilePointerListener; import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager; -import com.intellij.testFramework.IdeaTestCase; +import com.intellij.testFramework.PlatformLangTestCase; import com.intellij.testFramework.PlatformTestUtil; import com.intellij.testFramework.Timings; import com.intellij.util.IncorrectOperationException; @@ -28,7 +43,7 @@ import java.util.Collections; /** * @author dsl */ -public class VirtualFilePointerTest extends IdeaTestCase { +public class VirtualFilePointerTest extends PlatformLangTestCase { private VirtualFilePointerManager myVirtualFilePointerManager; @Override diff --git a/java/java-tests/testSrc/com/intellij/openapi/vfs/LocalFileSystemTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/LocalFileSystemTest.java similarity index 94% rename from java/java-tests/testSrc/com/intellij/openapi/vfs/LocalFileSystemTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/LocalFileSystemTest.java index 016c2dc0b8de..c6669ea819b3 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/vfs/LocalFileSystemTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/LocalFileSystemTest.java @@ -13,25 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.openapi.vfs; +package com.intellij.openapi.vfs.local; import com.intellij.execution.util.ExecUtil; import com.intellij.ide.GeneralSettings; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.vfs.LocalFileSystem; +import com.intellij.openapi.vfs.SafeWriteRequestor; +import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.newvfs.ManagingFS; import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS; -import com.intellij.testFramework.IdeaTestCase; +import com.intellij.testFramework.PlatformLangTestCase; import com.intellij.testFramework.PlatformTestUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.Nullable; -import java.io.*; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; import java.nio.charset.Charset; import java.util.Arrays; -public class LocalFileSystemTest extends IdeaTestCase{ +public class LocalFileSystemTest extends PlatformLangTestCase { public static void setContentOnDisk(File file, byte[] bom, String content, Charset charset) throws IOException { FileOutputStream stream = new FileOutputStream(file); if (bom != null) { @@ -161,11 +168,11 @@ public class LocalFileSystemTest extends IdeaTestCase{ VirtualFile toVDir = LocalFileSystem.getInstance().findFileByPath(toDir.getPath().replace(File.separatorChar, '/')); assertNotNull(fromVDir); assertNotNull(toVDir); - final VirtualFile fileToCopy = fromVDir.createChildData(null, "temp_file"); + final VirtualFile fileToCopy = fromVDir.createChildData(this, "temp_file"); final byte[] byteContent = {0, 1, 2, 3}; fileToCopy.setBinaryContent(byteContent); final String newName = "new_temp_file"; - final VirtualFile copy = fileToCopy.copy(null, toVDir, newName); + final VirtualFile copy = fileToCopy.copy(this, toVDir, newName); assertEquals(newName, copy.getName()); assertTrue(Arrays.equals(byteContent, copy.contentsToByteArray())); } @@ -190,11 +197,11 @@ public class LocalFileSystemTest extends IdeaTestCase{ VirtualFile toVDir = LocalFileSystem.getInstance().findFileByPath(toDir.getPath().replace(File.separatorChar, '/')); assertNotNull(fromVDir); assertNotNull(toVDir); - final VirtualFile dirToCopy = fromVDir.createChildDirectory(null, "dir"); - final VirtualFile file = dirToCopy.createChildData(null, "temp_file"); + final VirtualFile dirToCopy = fromVDir.createChildDirectory(this, "dir"); + final VirtualFile file = dirToCopy.createChildData(this, "temp_file"); file.setBinaryContent(new byte[]{0, 1, 2, 3}); final String newName = "dir"; - final VirtualFile dirCopy = dirToCopy.copy(null, toVDir, newName); + final VirtualFile dirCopy = dirToCopy.copy(this, toVDir, newName); assertEquals(newName, dirCopy.getName()); PlatformTestUtil.assertDirectoriesEqual(toVDir, fromVDir, null); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/SymLinkHandlingTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/SymLinkHandlingTest.java index 0dfcf29017a3..41afb77e8246 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/SymLinkHandlingTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/SymLinkHandlingTest.java @@ -23,6 +23,7 @@ import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.testFramework.LightPlatformTestCase; import com.intellij.testFramework.PlatformTestCase; +import org.jetbrains.annotations.Nullable; import java.io.File; import java.io.IOException; @@ -158,6 +159,7 @@ public class SymLinkHandlingTest extends LightPlatformTestCase { return linkFile; } + @Nullable private VirtualFile refreshAndFind(final File ioFile) { refresh(); return myFileSystem.findFileByPath(ioFile.getAbsolutePath()); diff --git a/platform/testFramework/src/com/intellij/testFramework/LightPlatformLangTestCase.java b/platform/testFramework/src/com/intellij/testFramework/LightPlatformLangTestCase.java new file mode 100644 index 000000000000..aa070a93137d --- /dev/null +++ b/platform/testFramework/src/com/intellij/testFramework/LightPlatformLangTestCase.java @@ -0,0 +1,23 @@ +/* + * Copyright 2000-2011 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.testFramework; + +public abstract class LightPlatformLangTestCase extends LightPlatformTestCase { + @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors") + protected LightPlatformLangTestCase() { + PlatformTestCase.initPlatformLangPrefix(); + } +} diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformLangTestCase.java b/platform/testFramework/src/com/intellij/testFramework/PlatformLangTestCase.java new file mode 100644 index 000000000000..34d276e0a2b3 --- /dev/null +++ b/platform/testFramework/src/com/intellij/testFramework/PlatformLangTestCase.java @@ -0,0 +1,23 @@ +/* + * Copyright 2000-2011 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.testFramework; + +public abstract class PlatformLangTestCase extends PlatformTestCase { + @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors") + protected PlatformLangTestCase() { + initPlatformLangPrefix(); + } +} diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java b/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java index c155d4ebe703..ac396c20fef1 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java +++ b/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -579,7 +579,7 @@ public class PlatformTestUtil { } } - private static HashMap buildNameToFileMap(VirtualFile[] files, VirtualFileFilter filter) { + private static HashMap buildNameToFileMap(VirtualFile[] files, @Nullable VirtualFileFilter filter) { HashMap map = new HashMap(); for (VirtualFile file : files) { if (filter != null && !filter.accept(file)) continue; @@ -588,7 +588,7 @@ public class PlatformTestUtil { return map; } - public static void assertDirectoriesEqual(VirtualFile dirAfter, VirtualFile dirBefore, VirtualFileFilter fileFilter) throws IOException { + public static void assertDirectoriesEqual(VirtualFile dirAfter, VirtualFile dirBefore, @Nullable VirtualFileFilter fileFilter) throws IOException { FileDocumentManager.getInstance().saveAllDocuments(); VirtualFile[] childrenAfter = dirAfter.getChildren(); if (dirAfter.isInLocalFileSystem()) {