Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2012-08-22 18:04:44 -0400
committerSergey Prigogin2012-08-22 19:58:13 -0400
commit822e2091d207091b00c8cf17af1d6f6a3fb1304d (patch)
tree3f69fb251d3df09b2f122909ab99e02118439b0b
parente3e7ee663c755784697d90126e34b539fba13aa5 (diff)
downloadorg.eclipse.cdt-822e2091d207091b00c8cf17af1d6f6a3fb1304d.tar.gz
org.eclipse.cdt-822e2091d207091b00c8cf17af1d6f6a3fb1304d.tar.xz
org.eclipse.cdt-822e2091d207091b00c8cf17af1d6f6a3fb1304d.zip
Pushed INDEXER_TIMEOUT_SEC constant up the test class hierarchy.
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java1
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCompositeTests.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMProviderTests.java27
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTestBase.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/BaseTestCase.java5
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java1
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTestsIndexer.java1
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java19
8 files changed, 26 insertions, 32 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java
index e4d0bdfdb6..e4558287e4 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java
@@ -108,7 +108,6 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
public class IndexBugsTests extends BaseTestCase {
- private static final int INDEXER_TIMEOUT_SEC = 20;
private ICProject fCProject;
protected IIndex fIndex;
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCompositeTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCompositeTests.java
index b9c855ea51..b1ba0f5c4e 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCompositeTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCompositeTests.java
@@ -468,7 +468,7 @@ public class IndexCompositeTests extends BaseTestCase {
* Convenience class for setting up projects.
*/
class ProjectBuilder {
- private static final int INDEXER_TIMEOUT_SEC = 5;
+ private static final int INDEXER_TIMEOUT_SEC = 10;
private final String name;
private final boolean cpp;
private List dependencies = new ArrayList();
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMProviderTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMProviderTests.java
index d3fe6fa95c..cc5047d5ba 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMProviderTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMProviderTests.java
@@ -57,7 +57,7 @@ public class PDOMProviderTests extends PDOMTestBase {
{
ICProject cproject= CProjectHelper.createCCProject("foo"+System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
TestSourceReader.createFile(cproject.getProject(), new Path("/this.h"), "class A {};\n\n");
- CCorePlugin.getIndexManager().joinIndexer(3000, npm());
+ CCorePlugin.getIndexManager().joinIndexer(INDEXER_TIMEOUT_SEC * 1000, npm());
IIndex index= CCorePlugin.getIndexManager().getIndex(cproject, A_FRAGMENT_OPTIONS);
index.acquireReadLock();
@@ -78,7 +78,7 @@ public class PDOMProviderTests extends PDOMTestBase {
final URI baseURI= new File("c:/ExternalSDK/").toURI();
final ICProject cproject2= CProjectHelper.createCCProject("bar"+System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
TestSourceReader.createFile(cproject2.getProject(), new Path("/source.cpp"), "namespace X { class A {}; }\n\n");
- CCorePlugin.getIndexManager().joinIndexer(3000, npm());
+ CCorePlugin.getIndexManager().joinIndexer(INDEXER_TIMEOUT_SEC * 1000, npm());
IndexProviderManager ipm= CCoreInternals.getPDOMManager().getIndexProviderManager();
ipm.addIndexProvider(new ReadOnlyPDOMProviderBridge(
@@ -129,7 +129,7 @@ public class PDOMProviderTests extends PDOMTestBase {
{
ICProject cproject= CProjectHelper.createCCProject("foo"+System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
TestSourceReader.createFile(cproject.getProject(), new Path("/this.h"), "class A {};\n\n");
- CCorePlugin.getIndexManager().joinIndexer(3000, npm());
+ CCorePlugin.getIndexManager().joinIndexer(INDEXER_TIMEOUT_SEC * 1000, npm());
IIndex index= CCorePlugin.getIndexManager().getIndex(cproject, A_FRAGMENT_OPTIONS);
index.acquireReadLock();
@@ -149,12 +149,12 @@ public class PDOMProviderTests extends PDOMTestBase {
final ICProject cproject3= CProjectHelper.createCCProject("bar"+System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
TestSourceReader.createFile(cproject3.getProject(), new Path("/source.cpp"), "namespace Y { class A {}; }\n\n");
- CCorePlugin.getIndexManager().joinIndexer(3000, npm());
+ CCorePlugin.getIndexManager().joinIndexer(INDEXER_TIMEOUT_SEC * 1000, npm());
final URI baseURI= new File("c:/ExternalSDK/").toURI();
final ICProject cproject2= CProjectHelper.createCCProject("baz"+System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
TestSourceReader.createFile(cproject2.getProject(), new Path("/source.cpp"), "namespace X { class A {}; }\n\n");
- CCorePlugin.getIndexManager().joinIndexer(3000, npm());
+ CCorePlugin.getIndexManager().joinIndexer(INDEXER_TIMEOUT_SEC * 1000, npm());
IndexProviderManager ipm= CCoreInternals.getPDOMManager().getIndexProviderManager();
ipm.addIndexProvider(new ReadOnlyPDOMProviderBridge(
@@ -241,21 +241,18 @@ public class PDOMProviderTests extends PDOMTestBase {
}
}
- /*
- * see bugzilla 178998
- */
- public void testVersionMismatchOfExternalPDOM() throws Exception {
+ public void testVersionMismatchOfExternalPDOM_178998() throws Exception {
final File tempPDOM= File.createTempFile("foo", "bar");
{
- ICProject cproject= CProjectHelper.createCCProject("foo"+System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
+ ICProject cproject= CProjectHelper.createCCProject("foo" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
TestSourceReader.createFile(cproject.getProject(), new Path("/this.h"), "class A {};\n\n");
- CCorePlugin.getIndexManager().joinIndexer(3000, npm());
+ CCorePlugin.getIndexManager().joinIndexer(INDEXER_TIMEOUT_SEC * 1000, npm());
ResourceContainerRelativeLocationConverter cvr= new ResourceContainerRelativeLocationConverter(cproject.getProject());
CCoreInternals.getPDOMManager().exportProjectPDOM(cproject, tempPDOM, cvr);
CProjectHelper.delete(cproject);
- // mimic a pdom with superceded version
+ // Mimic a PDOM with superseded version.
WritablePDOM wpdom= new WritablePDOM(tempPDOM, cvr, LanguageManager.getInstance().getPDOMLinkageFactoryMappings());
wpdom.acquireWriteLock();
try {
@@ -267,9 +264,9 @@ public class PDOMProviderTests extends PDOMTestBase {
}
final URI baseURI= new File("c:/ExternalSDK/").toURI();
- final ICProject cproject2= CProjectHelper.createCCProject("baz"+System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
+ final ICProject cproject2= CProjectHelper.createCCProject("baz" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
TestSourceReader.createFile(cproject2.getProject(), new Path("/source.cpp"), "namespace X { class A {}; }\n\n");
- CCorePlugin.getIndexManager().joinIndexer(3000, npm());
+ CCorePlugin.getIndexManager().joinIndexer(INDEXER_TIMEOUT_SEC * 1000, npm());
IndexProviderManager ipm= CCoreInternals.getPDOMManager().getIndexProviderManager();
ipm.addIndexProvider(new ReadOnlyPDOMProviderBridge(
@@ -302,7 +299,7 @@ public class PDOMProviderTests extends PDOMTestBase {
setExpectedNumberOfLoggedNonOKStatusObjects(1); // (this applies to the entire test duration)
for (int i= 0; i < 3; i++) {
- // try several times in order to test the status is logged only once
+ // Try several times in order to test the status is logged only once.
ICProjectDescription pd= CCorePlugin.getDefault().getProjectDescription(cproject2.getProject(), false);
assertEquals(0, ipm.getProvidedIndexFragments(pd.getActiveConfiguration(), -1).length);
}
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTestBase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTestBase.java
index 101d538cf5..26cce84ea6 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTestBase.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTestBase.java
@@ -57,7 +57,7 @@ import org.eclipse.ui.wizards.datatransfer.ImportOperation;
public class PDOMTestBase extends BaseTestCase {
protected static final IProgressMonitor PROGRESS = new NullProgressMonitor();
static IPath rootPath = new Path("resources/pdomtests");
- private String projectName= null;
+ private String projectName;
protected ICProject createProject(String folderName) throws CoreException {
return createProject(folderName, false);
diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/BaseTestCase.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/BaseTestCase.java
index a6e9a5ad1f..3053135b96 100644
--- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/BaseTestCase.java
+++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/BaseTestCase.java
@@ -45,6 +45,7 @@ import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
public class BaseTestCase extends TestCase {
+ protected static final int INDEXER_TIMEOUT_SEC = 10;
private boolean fExpectFailure;
private int fBugNumber;
private int fExpectedLoggedNonOK;
@@ -290,12 +291,12 @@ public class BaseTestCase extends TestCase {
public static void waitForIndexer(ICProject project) throws InterruptedException {
final PDOMManager indexManager = CCoreInternals.getPDOMManager();
- assertTrue(indexManager.joinIndexer(10000, npm()));
+ assertTrue(indexManager.joinIndexer(INDEXER_TIMEOUT_SEC * 1000, npm()));
long waitms= 1;
while (waitms < 2000 && !indexManager.isProjectRegistered(project)) {
Thread.sleep(waitms);
waitms *= 2;
}
- assertTrue(indexManager.joinIndexer(10000, npm()));
+ assertTrue(indexManager.joinIndexer(INDEXER_TIMEOUT_SEC * 1000, npm()));
}
}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java
index f3af003451..a461896c7d 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java
@@ -56,7 +56,6 @@ import org.eclipse.cdt.internal.ui.refactoring.CRefactoringContext;
* Common base for refactoring tests.
*/
public abstract class RefactoringTestBase extends BaseTestCase {
- private static final int INDEXER_TIMEOUT_SEC = 300;
protected static final NullProgressMonitor NULL_PROGRESS_MONITOR = new NullProgressMonitor();
/** Allows empty files to be created during test setup. */
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTestsIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTestsIndexer.java
index a61d122a55..d38ec492a8 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTestsIndexer.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTestsIndexer.java
@@ -70,7 +70,6 @@ import org.eclipse.cdt.internal.ui.search.actions.OpenDeclarationsAction;
* @author dsteffle
*/
public class BaseSelectionTestsIndexer extends BaseUITestCase {
- protected static final int INDEXER_TIMEOUT_SEC = 20;
protected ICProject fCProject;
static FileManager fileManager = new FileManager();
IProgressMonitor monitor = new NullProgressMonitor();
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java
index 42ebecbc22..fcad138f1a 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java
@@ -100,8 +100,8 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
int hoffset= hcode.indexOf("MyInt");
int soffset = scode.indexOf("MyInt");
- IASTNode decl = testF3(file, soffset+2);
- IASTNode def = testF3(hfile, hoffset+2);
+ IASTNode decl = testF3(file, soffset + 2);
+ IASTNode def = testF3(hfile, hoffset + 2);
assertTrue(def instanceof IASTName);
assertTrue(decl instanceof IASTName);
assertEquals("MyInt", ((IASTName) decl).toString()); //$NON-NLS-1$
@@ -113,8 +113,8 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
hoffset= hcode.indexOf("MyConst");
soffset = scode.indexOf("MyConst");
- decl = testF3(file, soffset+2);
- def = testF3(hfile, hoffset+2);
+ decl = testF3(file, soffset + 2);
+ def = testF3(hfile, hoffset + 2);
assertTrue(def instanceof IASTName);
assertTrue(decl instanceof IASTName);
assertEquals("MyConst", ((IASTName) decl).toString()); //$NON-NLS-1$
@@ -126,8 +126,8 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
hoffset= hcode.indexOf("MyFunc");
soffset = scode.indexOf("MyFunc");
- decl = testF3(file, soffset+2);
- def = testF3(hfile, hoffset+2);
+ decl = testF3(file, soffset + 2);
+ def = testF3(hfile, hoffset + 2);
assertTrue(def instanceof IASTName);
assertTrue(decl instanceof IASTName);
assertEquals("MyFunc", ((IASTName) decl).toString()); //$NON-NLS-1$
@@ -139,8 +139,8 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
hoffset= hcode.indexOf("MyStruct");
soffset = scode.indexOf("MyStruct");
- decl = testF3(file, soffset+2);
- def = testF3(hfile, hoffset+2);
+ decl = testF3(file, soffset + 2);
+ def = testF3(hfile, hoffset + 2);
assertTrue(def instanceof IASTName);
assertTrue(decl instanceof IASTName);
assertEquals("MyStruct", ((IASTName) decl).toString()); //$NON-NLS-1$
@@ -150,8 +150,7 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
assertEquals(hoffset, def.getFileLocation().getNodeOffset());
assertEquals(8, ((ASTNode) def).getLength());
}
-
-
+
// // the header
// extern int a; // declares
// extern const int c = 1; // defines

Back to the top