Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2013-09-06 18:30:53 -0400
committerSergey Prigogin2013-09-10 12:43:48 -0400
commitf1275ddaaa578dc9f75d2bb6a990df2b4e1499ab (patch)
tree021375456a77bba6053033c2013f3953ee75f689
parent2272e31185e465163d54344c48fcfc939ad8775d (diff)
downloadorg.eclipse.cdt-f1275ddaaa578dc9f75d2bb6a990df2b4e1499ab.tar.gz
org.eclipse.cdt-f1275ddaaa578dc9f75d2bb6a990df2b4e1499ab.tar.xz
org.eclipse.cdt-f1275ddaaa578dc9f75d2bb6a990df2b4e1499ab.zip
Obey indexer.timeout property.
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java28
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTestBase.java5
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java4
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/BaseTestCase.java2
4 files changed, 19 insertions, 20 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java
index 4e58eb978f..dee71a7622 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java
@@ -313,7 +313,7 @@ public class IndexIncludeTest extends IndexTestBase {
// change header2:
h2= TestSourceReader.createFile(fProject.getProject(), "header2.h", sources[2].toString());
- TestSourceReader.waitUntilFileIsIndexed(fIndex, h2, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, h2, INDEXER_TIMEOUT_MILLISEC);
fIndex.acquireReadLock();
try {
IIndexBinding[] binding= fIndex.findBindings("ok_2_220358".toCharArray(), IndexFilter.ALL_DECLARED, npm());
@@ -336,7 +336,7 @@ public class IndexIncludeTest extends IndexTestBase {
waitForIndexer();
IFile s2= TestSourceReader.createFile(fProject.getProject(), "s2.cpp", source);
- TestSourceReader.waitUntilFileIsIndexed(fIndex, s2, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, s2, INDEXER_TIMEOUT_MILLISEC);
fIndex.acquireReadLock();
try {
@@ -355,7 +355,7 @@ public class IndexIncludeTest extends IndexTestBase {
}
s1= TestSourceReader.createFile(fProject.getProject(), "s1.cpp", source + "\nint a20070426;");
- TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_TIMEOUT_MILLISEC);
fIndex.acquireReadLock();
try {
assertEquals(1, fIndex.findBindings("a20070426".toCharArray(), IndexFilter.ALL_DECLARED, npm()).length);
@@ -372,7 +372,7 @@ public class IndexIncludeTest extends IndexTestBase {
}
s2= TestSourceReader.createFile(fProject.getProject(), "s2.cpp", source + "\nint b20070426;");
- TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_TIMEOUT_MILLISEC);
fIndex.acquireReadLock();
try {
assertEquals(1, fIndex.findBindings("b20070426".toCharArray(), IndexFilter.ALL_DECLARED, npm()).length);
@@ -414,42 +414,42 @@ public class IndexIncludeTest extends IndexTestBase {
IFile header= TestSourceReader.createFile(fProject.getProject(), "resolved20070427.h", "");
IFile s1= TestSourceReader.createFile(fProject.getProject(), "s20070427.cpp",
source[0].toString() + "\nint a20070427;");
- TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_TIMEOUT_MILLISEC);
standardCheckUpdateIncludes(header, s1, "a20070427");
s1= TestSourceReader.createFile(fProject.getProject(), "s20070427.cpp",
source[0].toString() + "\nint b20070427;");
- TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_TIMEOUT_MILLISEC);
standardCheckUpdateIncludes(header, s1, "b20070427");
s1= TestSourceReader.createFile(fProject.getProject(), "s20070427.cpp",
source[1].toString() + "\nint c20070427;");
- TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_TIMEOUT_MILLISEC);
checkUpdateIncludes1(header, s1, "c20070427");
s1= TestSourceReader.createFile(fProject.getProject(), "s20070427.cpp",
source[0].toString() + "\nint d20070427;");
- TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_TIMEOUT_MILLISEC);
standardCheckUpdateIncludes(header, s1, "d20070427");
s1= TestSourceReader.createFile(fProject.getProject(), "s20070427.cpp",
source[2].toString() + "\nint e20070427;");
- TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_TIMEOUT_MILLISEC);
checkUpdateIncludes2(header, s1, "e20070427");
s1= TestSourceReader.createFile(fProject.getProject(), "s20070427.cpp",
source[0].toString() + "\nint f20070427;");
- TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_TIMEOUT_MILLISEC);
standardCheckUpdateIncludes(header, s1, "f20070427");
s1= TestSourceReader.createFile(fProject.getProject(), "s20070427.cpp",
source[3].toString() + "\nint g20070427;");
- TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_TIMEOUT_MILLISEC);
checkUpdateIncludes3(header, s1, "g20070427");
s1= TestSourceReader.createFile(fProject.getProject(), "s20070427.cpp",
source[0].toString() + "\nint h20070427;");
- TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_TIMEOUT_MILLISEC);
standardCheckUpdateIncludes(header, s1, "h20070427");
}
@@ -483,8 +483,8 @@ public class IndexIncludeTest extends IndexTestBase {
IFile h2= TestSourceReader.createFile(fProject.getProject(), "h2.h", contents[1].toString());
IFile s1= TestSourceReader.createFile(fProject.getProject(), "s1.cpp", contents[2].toString());
IFile s2= TestSourceReader.createFile(fProject.getProject(), "s2.cpp", contents[3].toString());
- TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME);
- TestSourceReader.waitUntilFileIsIndexed(fIndex, s2, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_TIMEOUT_MILLISEC);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, s2, INDEXER_TIMEOUT_MILLISEC);
fIndex.acquireReadLock();
try {
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTestBase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTestBase.java
index 59cab0fd37..358aa05e53 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTestBase.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTestBase.java
@@ -6,9 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
+ * Markus Schorn - initial API and implementation
*******************************************************************************/
-
package org.eclipse.cdt.internal.index.tests;
import java.io.IOException;
@@ -27,8 +26,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
public class IndexTestBase extends BaseTestCase {
- protected static int INDEXER_WAIT_TIME= 8000;
-
public IndexTestBase(String name) {
super(name);
}
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java
index 0fd42ab7de..8ea35764df 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java
@@ -135,7 +135,7 @@ public class IndexUpdateTests extends IndexTestBase {
}
ICProject cproject= cpp ? fCppProject : fCProject;
fFile= TestSourceReader.createFile(cproject.getProject(), "file" + (cpp ? ".cpp" : ".c"), fContents[++fContentUsed].toString());
- TestSourceReader.waitUntilFileIsIndexed(fIndex, fFile, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, fFile, INDEXER_TIMEOUT_MILLISEC);
waitForIndexer(cproject);
}
@@ -930,7 +930,7 @@ public class IndexUpdateTests extends IndexTestBase {
}
fFile= TestSourceReader.createFile(fFile.getParent(), fFile.getName(), fContents[1].toString().replaceAll("globalVar", "newVar"));
- TestSourceReader.waitUntilFileIsIndexed(fIndex, fFile, INDEXER_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, fFile, INDEXER_TIMEOUT_MILLISEC);
fIndex.acquireReadLock();
try {
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 ac01819891..9efc655527 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
@@ -53,6 +53,8 @@ public class BaseTestCase extends TestCase {
private static final String INDEXER_TIMEOUT_PROPERTY = "indexer.timeout";
protected static final int INDEXER_TIMEOUT_SEC =
Integer.parseInt(System.getProperty(INDEXER_TIMEOUT_PROPERTY, DEFAULT_INDEXER_TIMEOUT_SEC));
+ protected static final int INDEXER_TIMEOUT_MILLISEC= INDEXER_TIMEOUT_SEC * 1000;
+
private boolean fExpectFailure;
private int fBugNumber;
private int fExpectedLoggedNonOK;

Back to the top