Fix refresh-afraid tests

This commit is contained in:
Roman Shevchenko
2012-03-07 21:56:28 +01:00
parent 0770a1e6ba
commit 0367655cc5
4 changed files with 49 additions and 8 deletions
@@ -1,3 +1,18 @@
/*
* Copyright 2000-2012 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.psi;
import com.intellij.openapi.application.ApplicationManager;
@@ -58,7 +73,7 @@ public class ClsRepositoryUseTest extends PsiTestCase{
}
public void testClassFileUpdate() throws Exception {
final File classes = createTempDir("classes");
final File classes = createTempDir("classes", false);
final File com = new File(classes, "com");
//noinspection ResultOfMethodCallIgnored
@@ -1,3 +1,18 @@
/*
* Copyright 2000-2012 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.psi.impl.file.impl;
import com.intellij.JavaTestUtil;
@@ -14,6 +29,7 @@ import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiTreeChangeAdapter;
import com.intellij.psi.PsiTreeChangeEvent;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.testFramework.PsiTestCase;
import java.io.File;
@@ -26,11 +42,10 @@ public class InvalidateClassFileTest extends PsiTestCase {
private static final String BASE_PATH = "/psi/java/cls/";
@Override
protected void setUp() throws Exception {
super.setUp();
myRoot = createTempDirectory();
myRoot = createTempDirectory(false);
myFilesToDelete.add(myRoot);
}
@@ -58,8 +73,7 @@ public class InvalidateClassFileTest extends PsiTestCase {
}
});
PsiClass clazz = getJavaFacade().findClass("Clazz");
PsiClass clazz = getJavaFacade().findClass("Clazz", GlobalSearchScope.allScope(myProject));
assertNotNull(clazz);
final boolean[] notified = new boolean[] {false};
final PsiTreeChangeAdapter listener = new PsiTreeChangeAdapter() {
@@ -85,6 +99,6 @@ public class InvalidateClassFileTest extends PsiTestCase {
}
assertFalse(clazz.isValid());
assertNotNull(getJavaFacade().findClass("Clazz"));
assertNotNull(getJavaFacade().findClass("Clazz", GlobalSearchScope.allScope(myProject)));
}
}