Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-04-16 17:33:55 -0400
committerAndrew Gvozdev2012-04-16 17:40:30 -0400
commit31331544b64727d486d19b62fba458f32f9896a9 (patch)
treec0ae30ec07c9378e51c026c078385fc02480e06b /core/org.eclipse.cdt.core.tests
parent955bd297b2038127a7e9c8d941430e790792e44c (diff)
downloadorg.eclipse.cdt-31331544b64727d486d19b62fba458f32f9896a9.tar.gz
org.eclipse.cdt-31331544b64727d486d19b62fba458f32f9896a9.tar.xz
org.eclipse.cdt-31331544b64727d486d19b62fba458f32f9896a9.zip
Ignore InterruptedException in unit tests
Diffstat (limited to 'core/org.eclipse.cdt.core.tests')
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorTests.java51
1 files changed, 33 insertions, 18 deletions
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorTests.java
index e304a21cdb..68a4db6e9d 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorTests.java
@@ -49,7 +49,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
/**
* @author David
- *
+ *
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
@@ -62,7 +62,7 @@ public class CDescriptorTests extends BaseTestCase {
/**
* Constructor for CDescriptorTest.
- *
+ *
* @param name
*/
public CDescriptorTests(String name) {
@@ -92,7 +92,7 @@ public class CDescriptorTests extends BaseTestCase {
};
return wrapper;
}
-
+
@Override
protected void setUp() throws Exception {
fProject.open(new NullProgressMonitor());
@@ -101,7 +101,7 @@ public class CDescriptorTests extends BaseTestCase {
@Override
protected void tearDown() throws Exception {
}
-
+
private static void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor) throws CoreException {
IProjectDescription description = proj.getDescription();
String[] prevNatures = description.getNatureIds();
@@ -193,8 +193,11 @@ public class CDescriptorTests extends BaseTestCase {
};
t.start();
ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(fProject, true);
- t.join();
-
+ try {
+ t.join();
+ } catch (InterruptedException e) {
+ }
+
ICStorageElement data = desc.getProjectStorageElement("testElement0");
data.createChild("test");
desc.saveProjectData();
@@ -204,7 +207,7 @@ public class CDescriptorTests extends BaseTestCase {
/*
* This tests concurrent descriptor modification inside of a ICDescriptor operation run
- * with
+ * with
* CConfigBasedDescriptorManager.runDescriptorOperation(IProject project, ICDescriptorOperation op, IProgressMonitor monitor)
*/
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=185930
@@ -253,7 +256,10 @@ public class CDescriptorTests extends BaseTestCase {
}
for (int j = 0; j < threads.length; j++) {
if (threads[j] != null) {
- threads[j].join();
+ try {
+ threads[j].join();
+ } catch (InterruptedException e) {
+ }
}
assertNull("Exception occurred: "+exception[j], exception[j]);
}
@@ -267,7 +273,7 @@ public class CDescriptorTests extends BaseTestCase {
}
/*
- * This test should pass as two threads, operating on the
+ * This test should pass as two threads, operating on the
* different storage elements (outside of an operation) should be safe
*/
public void testConcurrentDifferentStorageElementModification() throws Exception {
@@ -291,7 +297,10 @@ public class CDescriptorTests extends BaseTestCase {
ICStorageElement data = desc.getProjectStorageElement("testElement5");
data.createChild("test");
desc.saveProjectData();
- t.join();
+ try {
+ t.join();
+ } catch (InterruptedException e) {
+ }
fLastEvent = null;
}
@@ -324,8 +333,11 @@ public class CDescriptorTests extends BaseTestCase {
ICStorageElement data = desc.getProjectStorageElement("testElement6");
data.createChild("test");
desc.saveProjectData();
- t.join();
-
+ try {
+ t.join();
+ } catch (InterruptedException e) {
+ }
+
fLastEvent = null;
}
Assert.assertEquals(200, CCorePlugin.getDefault().getCProjectDescription(fProject, false).getProjectStorageElement("testElement6").getChildren().length);
@@ -356,8 +368,11 @@ public class CDescriptorTests extends BaseTestCase {
ICStorageElement data = desc.getProjectStorageElement("testElement0");
data.createChild("test");
desc.saveProjectData();
- t.join();
-
+ try {
+ t.join();
+ } catch (InterruptedException e) {
+ }
+
fLastEvent = null;
}
}
@@ -488,7 +503,7 @@ public class CDescriptorTests extends BaseTestCase {
String dotCProject1 = readDotCProjectFile(fProject);
long mtime1 = fProject.getFile(".cproject").getLocalTimeStamp();
-
+
desc = CCorePlugin.getDefault().getCProjectDescription(fProject, true);
data = desc.getProjectStorageElement("testElement");
for (ICStorageElement child : data.getChildren()) {
@@ -522,11 +537,11 @@ public class CDescriptorTests extends BaseTestCase {
/**
* Read .cproject file.
- *
+ *
* @param project
* @return content of .cproject file
- * @throws CoreException
- * @throws IOException
+ * @throws CoreException
+ * @throws IOException
*/
private static String readDotCProjectFile(IProject project) throws CoreException, IOException {
IFile cProjectFile = project.getFile(".cproject");

Back to the top