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 78169 Details for
Bug 198544
[content type] Platform.getContentTypeManager().findContentTypeFor( filename) ignores content type priority
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Tests showing that the priority works fine
198544.txt (text/plain), 4.89 KB, created by
Szymon Brandys
on 2007-09-12 08:08:22 EDT
(
hide
)
Description:
Tests showing that the priority works fine
Filename:
MIME Type:
Creator:
Szymon Brandys
Created:
2007-09-12 08:08:22 EDT
Size:
4.89 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.tests.runtime >Index: src/org/eclipse/core/tests/runtime/content/IContentTypeManagerTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/runtime/content/IContentTypeManagerTest.java,v >retrieving revision 1.70 >diff -u -r1.70 IContentTypeManagerTest.java >--- src/org/eclipse/core/tests/runtime/content/IContentTypeManagerTest.java 5 Sep 2007 13:34:28 -0000 1.70 >+++ src/org/eclipse/core/tests/runtime/content/IContentTypeManagerTest.java 12 Sep 2007 12:07:18 -0000 >@@ -540,6 +540,7 @@ > IContentType inappropriate = contentTypeManager.getContentType(RuntimeTestsPlugin.PI_RUNTIME_TESTS + ".sample-binary1"); > IContentType appropriate = contentTypeManager.getContentType(Platform.PI_RUNTIME + ".xml"); > IContentType appropriateSpecific1 = contentTypeManager.getContentType(RuntimeTestsPlugin.PI_RUNTIME_TESTS + ".xml-based-different-extension"); >+ IContentType appropriateSpecific1LowPriority = contentTypeManager.getContentType(RuntimeTestsPlugin.PI_RUNTIME_TESTS + ".xml-based-different-extension-low-priority"); > IContentType appropriateSpecific2 = contentTypeManager.getContentType(RuntimeTestsPlugin.PI_RUNTIME_TESTS + ".xml-based-specific-name"); > > // if only inappropriate is provided, none will be selected >@@ -563,6 +564,14 @@ > assertTrue("4.1", appropriateSpecific1.equals(selected[0]) || appropriateSpecific1.equals(selected[1])); > assertTrue("4.2", appropriateSpecific2.equals(selected[0]) || appropriateSpecific2.equals(selected[1])); > assertTrue("4.3", appropriate.equals(selected[2])); >+ >+ // if appropriate and a more specific appropriate type (but with low priority) are provided, the specific type will be selected >+ finder = contentTypeManager.getMatcher(new SubsetSelectionPolicy(new IContentType[] {appropriate, appropriateSpecific1LowPriority}), null); >+ assertEquals("5.0", appropriateSpecific1LowPriority, finder.findContentTypeFor(getInputStream(MINIMAL_XML), null)); >+ >+ // if appropriate and two specific appropriate types (but one with lower priority) are provided, the specific type with higher priority will be selected >+ finder = contentTypeManager.getMatcher(new SubsetSelectionPolicy(new IContentType[] {appropriate, appropriateSpecific1, appropriateSpecific1LowPriority}), null); >+ assertEquals("5.1", appropriateSpecific1, finder.findContentTypeFor(getInputStream(MINIMAL_XML), null)); > } > > public void testDefaultProperties() throws IOException /* never actually thrown */{ >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.tests.runtime/plugin.xml,v >retrieving revision 1.72 >diff -u -r1.72 plugin.xml >--- plugin.xml 11 Sep 2007 20:12:43 -0000 1.72 >+++ plugin.xml 12 Sep 2007 12:07:18 -0000 >@@ -138,18 +138,16 @@ > name="Sub Foo Bar" > id="subFooBar"/> > <content-type >- base-type="org.eclipse.core.runtime.xml" > file-extensions="xml2" >- id="xml-based-different-extension" >+ base-type="org.eclipse.core.runtime.xml" > name="XML Based with Different Extension" >- priority="high"> >+ id="xml-based-different-extension"> > </content-type> > <content-type >- base-type="org.eclipse.core.runtime.xml" > file-names="xml-based.xml" >- id="xml-based-specific-name" >+ base-type="org.eclipse.core.runtime.xml" > name="XML Based with Specific Name" >- priority="high"/> >+ id="xml-based-specific-name"/> > <content-type > file-extensions="samplebin1" > name="Sample Binary 1" >@@ -224,10 +222,9 @@ > <!-- content types for content describer tests --> > <content-type > base-type="org.eclipse.core.runtime.xml" >- describer="org.eclipse.core.runtime.content.XMLRootElementContentDescriber:org.eclipse.core.runtime.tests.root-element" >- id="root-element" > name="Root Element" >- priority="high"/> >+ id="root-element" >+ describer="org.eclipse.core.runtime.content.XMLRootElementContentDescriber:org.eclipse.core.runtime.tests.root-element"/> > <content-type > base-type="org.eclipse.core.runtime.xml" > name="DTD" >@@ -241,6 +238,13 @@ > <content-type > name="Void content type" > id="void"/> >+ <content-type >+ base-type="org.eclipse.core.runtime.xml" >+ file-extensions="xml2" >+ id="xml-based-different-extension-low-priority" >+ name="XML Based with Different Extension and Low Priority" >+ priority="low"> >+ </content-type> > </extension> > <extension > point="org.eclipse.core.runtime.adapters">
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 198544
:
78011
|
78018
|
78169
|
78195
|
78196