Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 114542 Details for
Bug 250083
[model] Search indexes are not correctly updated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Test case
ResolveTests3.java (text/plain), 3.98 KB, created by
David Audel
on 2008-10-08 09:03:19 EDT
(
hide
)
Description:
Test case
Filename:
MIME Type:
Creator:
David Audel
Created:
2008-10-08 09:03:19 EDT
Size:
3.98 KB
patch
obsolete
>package org.eclipse.jdt.core.tests.model; > >import java.io.File; >import java.util.ArrayList; >import java.util.HashMap; > >import org.eclipse.core.runtime.NullProgressMonitor; >import org.eclipse.core.runtime.OperationCanceledException; >import org.eclipse.jdt.core.*; >import org.eclipse.jdt.core.compiler.CharOperation; >import org.eclipse.jdt.core.search.IJavaSearchConstants; >import org.eclipse.jdt.core.search.SearchEngine; >import org.eclipse.jdt.core.search.SearchPattern; >import org.eclipse.jdt.core.search.TypeNameMatch; >import org.eclipse.jdt.core.search.TypeNameMatchRequestor; >import org.eclipse.jdt.core.tests.util.Util; > >import junit.framework.*; > >public class ResolveTests3 extends ModifyingResourceTests { > >static { >// TESTS_NAMES = new String[] { "testSecondaryTypes" }; >} >public static Test suite() { > return buildModelTestSuite(ResolveTests3.class); >} > >public ResolveTests3(String name) { > super(name); >} >public void setUpSuite() throws Exception { > super.setUpSuite(); > > setUpJavaProject("Resolve"); >} >public void tearDownSuite() throws Exception { > deleteProject("Resolve"); > > super.tearDownSuite(); >} > >private IJavaElement[] search(String typeName) throws JavaModelException { > final ArrayList list = new ArrayList(); > TypeNameMatchRequestor requestorWrapper = new TypeNameMatchRequestor() { > > public void acceptTypeNameMatch(TypeNameMatch match) { > list.add(match.getType()); > } > > }; > try { > new SearchEngine().searchAllTypeNames( > null, > SearchPattern.R_EXACT_MATCH, > CharOperation.toLowerCase(typeName.toCharArray()), > SearchPattern.R_EXACT_MATCH, > IJavaSearchConstants.TYPE, > SearchEngine.createWorkspaceScope(), > requestorWrapper, > IJavaSearchConstants.CANCEL_IF_NOT_READY_TO_SEARCH, > new NullProgressMonitor()); > } catch (OperationCanceledException e) { > // do nothing > } > > return (IJavaElement[])list.toArray(new IJavaElement[]{}); >} >public void test1() throws Exception { > String outputDirectory = Util.getOutputDirectory(); > String externalJar1 = outputDirectory + File.separator + "myjar.jar"; //$NON-NLS-1$ > try { > > // create external jar 1 > Util.createJar( > new String[] { > "test0/IResource.java", //$NON-NLS-1$ > "package test0;\n" + //$NON-NLS-1$ > "public class IResource {\n" + //$NON-NLS-1$ > "}" //$NON-NLS-1$ > }, > new HashMap(), > externalJar1); > > // create P1 > this.createJavaProject( > "PS1", > new String[]{"src"}, > new String[]{"JCL_LIB", externalJar1}, > "bin"); > > waitUntilIndexesReady(); > > IJavaElement[] elements = search("IResource"); > > assertElementsEqual( > "Unexpected elements", > "IResource [in IResource.class [in test0 [in "+outputDirectory+"\\myjar.jar]]]", > elements > ); > } finally { > this.deleteExternalFile(externalJar1); > this.deleteProject("PS1"); > } >} >public void test2() throws Exception { > String outputDirectory = Util.getOutputDirectory(); > String externalJar1 = outputDirectory + File.separator + "myjar.jar"; //$NON-NLS-1$ > try { > > // create external jar 1 > Util.createJar( > new String[] { > "test1/IResource.java", //$NON-NLS-1$ > "package test1;\n" + //$NON-NLS-1$ > "public class IResource {\n" + //$NON-NLS-1$ > "}", //$NON-NLS-1$ > "test2/IResource.java", //$NON-NLS-1$ > "package test2;\n" + //$NON-NLS-1$ > "public class IResource {\n" + //$NON-NLS-1$ > "}" //$NON-NLS-1$ > }, > new HashMap(), > externalJar1); > > // create P1 > this.createJavaProject( > "PS1", > new String[]{"src"}, > new String[]{"JCL_LIB", externalJar1}, > "bin"); > > waitUntilIndexesReady(); > > IJavaElement[] elements = search("IResource"); > > assertElementsEqual( > "Unexpected elements", > "IResource [in IResource.class [in test1 [in "+outputDirectory+"\\myjar.jar]]]\n" + > "IResource [in IResource.class [in test2 [in "+outputDirectory+"\\myjar.jar]]]", > elements > ); > } finally { > this.deleteExternalFile(externalJar1); > this.deleteProject("PS1"); > } >} >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 250083
: 114542 |
114944