Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptff2004-09-20 04:55:58 -0400
committerptff2004-09-20 04:55:58 -0400
commit222701367f8b0a26c1ef107d150f8c56600db8e1 (patch)
tree143de83d65bcb4f845d27225bfac638036264a7f
parente5bfb5b8c46b2fe09294f92989edfab52d5d2f0c (diff)
downloadeclipse.jdt.core-222701367f8b0a26c1ef107d150f8c56600db8e1.tar.gz
eclipse.jdt.core-222701367f8b0a26c1ef107d150f8c56600db8e1.tar.xz
eclipse.jdt.core-222701367f8b0a26c1ef107d150f8c56600db8e1.zip
73112, 73551
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java59
1 files changed, 59 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java
index bddb113f7d..032ce2b503 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java
@@ -302,6 +302,7 @@ public static Test suite() {
suite.addTest(new JavaSearchTests("testSimplePackageDeclaration"));
suite.addTest(new JavaSearchTests("testVariousPackageDeclarations"));
suite.addTest(new JavaSearchTests("testPackageDeclaration"));
+ suite.addTest(new JavaSearchTests("testPackageDeclarationBug73551"));
// package reference
suite.addTest(new JavaSearchTests("testSimplePackageReference"));
@@ -435,6 +436,8 @@ public static Test suite() {
suite.addTest(new JavaSearchTests("testFieldReference5"));
suite.addTest(new JavaSearchTests("testFieldReference6"));
suite.addTest(new JavaSearchTests("testFieldReference7"));
+ suite.addTest(new JavaSearchTests("testFieldReferenceBug73112a"));
+ suite.addTest(new JavaSearchTests("testFieldReferenceBug73112b"));
suite.addTest(new JavaSearchTests("testFieldReferenceInInnerClass"));
suite.addTest(new JavaSearchTests("testFieldReferenceInAnonymousClass"));
suite.addTest(new JavaSearchTests("testFieldReferenceThroughSubclass"));
@@ -1186,6 +1189,47 @@ public void testFieldReference7() throws CoreException {
resultCollector);
}
/**
+ * Field reference test.
+ * (regression test for bug 73112: [Search] SearchEngine doesn't find all fields multiple field declarations
+ */
+public void testFieldReferenceBug73112a() throws CoreException {
+ JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
+ search(
+ "fieldA73112*",
+ FIELD,
+ ALL_OCCURRENCES,
+ getJavaSearchScope(),
+ resultCollector);
+ assertSearchResults(
+ "src/bug73112/A.java bug73112.A.fieldA73112a [fieldA73112a]\n" +
+ "src/bug73112/A.java bug73112.A.fieldA73112b [fieldA73112b]\n" +
+ "src/bug73112/A.java bug73112.A.fieldA73112c [fieldA73112c]\n" +
+ "src/bug73112/A.java bug73112.A.fieldA73112c [fieldA73112a]\n" +
+ "src/bug73112/A.java bug73112.A.fieldA73112c [fieldA73112b]\n" +
+ "src/bug73112/A.java bug73112.A.fieldA73112d [fieldA73112d]",
+ resultCollector);
+}
+public void testFieldReferenceBug73112b() throws CoreException {
+ JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
+ search(
+ "fieldB73112*",
+ FIELD,
+ ALL_OCCURRENCES,
+ getJavaSearchScope(),
+ resultCollector);
+ assertSearchResults(
+ "src/bug73112/B.java bug73112.B.fieldB73112a [fieldB73112a]\n" +
+ "src/bug73112/B.java bug73112.B.fieldB73112b [fieldB73112b]\n" +
+ "src/bug73112/B.java bug73112.B.fieldB73112c [fieldB73112c]\n" +
+ "src/bug73112/B.java bug73112.B.fieldB73112c [fieldB73112a]\n" +
+ "src/bug73112/B.java bug73112.B.fieldB73112c [fieldB73112b]\n" +
+ "src/bug73112/B.java bug73112.B.fieldB73112d [fieldB73112d]\n" +
+ "src/bug73112/B.java bug73112.B.fieldB73112d [fieldB73112c]\n" +
+ "src/bug73112/B.java bug73112.B.fieldB73112d [fieldB73112a]\n" +
+ "src/bug73112/B.java bug73112.B.fieldB73112e [fieldB73112e]",
+ resultCollector);
+}
+/**
* Field reference in anonymous class test.
* (regression test for PR 1GL12XE: ITPJCORE:WIN2000 - search: missing field references in inner class)
*/
@@ -2121,6 +2165,21 @@ public void testPackageDeclaration() throws CoreException {
getExternalJCLPath() + " java.lang",
resultCollector);
}
+
+/**
+ * Test fix for bug 73551: NPE while searching package declaration
+ * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=73551">73551</a>
+ * @throws CoreException
+ */
+public void testPackageDeclarationBug73551() throws CoreException {
+ JavaSearchResultCollector result = new JavaSearchResultCollector();
+ result.showAccuracy = true;
+ IPackageDeclaration packDecl = getCompilationUnit("JavaSearch", "src", "p71267", "Test.java").getPackageDeclaration("p71267");
+ search(packDecl, DECLARATIONS, getJavaSearchScope(), result);
+ assertSearchResults(
+ "src/p71267/Test.java [No source] EXACT_MATCH",
+ result);
+}
/**
* Package reference test.
* (regression test for PR 1GK90H4: ITPJCORE:WIN2000 - search: missing package reference)

Back to the top