Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVivian Kong2012-08-21 16:35:30 +0000
committerVivian Kong2012-08-21 17:00:26 +0000
commit21b42beb1f122b4d516d774b69831fccf039f9c9 (patch)
tree6f131497d442d1ab7cc1b81432ac0bb89fdff1c4 /core/org.eclipse.cdt.core.tests/misc
parent712d9b86d58d8fc1e8ec8a14746837b5130d5d36 (diff)
downloadorg.eclipse.cdt-21b42beb1f122b4d516d774b69831fccf039f9c9.tar.gz
org.eclipse.cdt-21b42beb1f122b4d516d774b69831fccf039f9c9.tar.xz
org.eclipse.cdt-21b42beb1f122b4d516d774b69831fccf039f9c9.zip
Bug 387428 - NPE in RefreshScopeManager
Diffstat (limited to 'core/org.eclipse.cdt.core.tests/misc')
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/RefreshScopeTests.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/RefreshScopeTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/RefreshScopeTests.java
index 4bc8323db7..bbfc50bcb5 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/RefreshScopeTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/RefreshScopeTests.java
@@ -53,6 +53,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
public class RefreshScopeTests extends TestCase {
private IProject fProject;
+ private IProject fGeneralProject;
private IFolder fFolder1;
private IFolder fFolder2;
private IFolder fFolder3;
@@ -73,6 +74,20 @@ public class RefreshScopeTests extends TestCase {
public void run(IProgressMonitor monitor) throws CoreException {
ICProject cProject = CProjectHelper.createNewStileCProject("testRefreshScope", IPDOMManager.ID_NO_INDEXER, false);
fProject = cProject.getProject();
+
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ fGeneralProject = root.getProject("testRefreshScopeGeneral");
+ assertNotNull(fGeneralProject);
+
+ if (!fGeneralProject.exists()) {
+ fGeneralProject.create(null);
+ } else {
+ fGeneralProject.refreshLocal(IResource.DEPTH_INFINITE, null);
+ }
+
+ if (!fGeneralProject.isOpen()) {
+ fGeneralProject.open(null);
+ }
}
}, null);
@@ -662,6 +677,21 @@ public class RefreshScopeTests extends TestCase {
}
+ public void testNullProjectDescription_bug387428() {
+ final String CFG_NAME="empty_config";
+
+ CProjectDescriptionManager descriptionManager = CProjectDescriptionManager.getInstance();
+ ICProjectDescription projectDescription = descriptionManager.getProjectDescription(fGeneralProject, false);
+ assertNull(projectDescription);
+
+ RefreshScopeManager manager = RefreshScopeManager.getInstance();
+ manager.clearAllData();
+
+ List<IResource> empty_config_resources = manager.getResourcesToRefresh(fGeneralProject, CFG_NAME);
+ assertEquals(1,empty_config_resources.size());
+ assertEquals(true,empty_config_resources.contains(fGeneralProject));
+ }
+
public static Test suite() {
return new TestSuite(RefreshScopeTests.class);
}

Back to the top