Lines 865-868
Link Here
|
865 |
deleteProject("P2"); |
865 |
deleteProject("P2"); |
866 |
} |
866 |
} |
867 |
} |
867 |
} |
|
|
868 |
|
869 |
/** |
870 |
* @bug 167743: [search] Open Type Dialog cannot find types from projects migrated from 3.2.1 workspace |
871 |
* @test Ensure that types are found even in default package fragment root |
872 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=167743" |
873 |
*/ |
874 |
public void testBug167743() throws CoreException { |
875 |
try { |
876 |
IJavaProject p = createJavaProject("P"); |
877 |
createFolder("/P/test"); |
878 |
createFile( |
879 |
"/P/test/TestClass.java", |
880 |
"package test;\n" + |
881 |
"public class Test {\n" + |
882 |
"}\n" |
883 |
); |
884 |
|
885 |
// Search all type names with TypeNameMatchRequestor |
886 |
AbstractJavaSearchTests.TypeNameMatchCollector collector = new AbstractJavaSearchTests.TypeNameMatchCollector() { |
887 |
public String toString(){ |
888 |
return toFullyQualifiedNamesString(); |
889 |
} |
890 |
}; |
891 |
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { p }); |
892 |
new SearchEngine().searchAllTypeNames( |
893 |
null, |
894 |
SearchPattern.R_EXACT_MATCH, |
895 |
new char[] { '*' }, |
896 |
SearchPattern.R_PATTERN_MATCH, |
897 |
IJavaSearchConstants.TYPE, |
898 |
scope, |
899 |
collector, |
900 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
901 |
null); |
902 |
// Search all type names with TypeNameRequestor |
903 |
SearchTests.SearchTypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
904 |
new SearchEngine().searchAllTypeNames( |
905 |
null, |
906 |
SearchPattern.R_EXACT_MATCH, |
907 |
new char[] { '*' }, |
908 |
SearchPattern.R_PATTERN_MATCH, |
909 |
IJavaSearchConstants.TYPE, |
910 |
scope, |
911 |
requestor, |
912 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
913 |
null); |
914 |
// Should have same types with these 2 searches |
915 |
assertEquals("Invalid number of types found!", requestor.size(), collector.size()); |
916 |
assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString()); |
917 |
} finally { |
918 |
deleteProject("P"); |
919 |
} |
920 |
} |
868 |
} |
921 |
} |