Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 278309
Collapse All | Expand All

(-)src/org/eclipse/equinox/internal/provisional/p2/metadata/IInstallableUnit.java (+6 lines)
Lines 69-74 Link Here
69
	public static final String PROP_TYPE_FRAGMENT = "org.eclipse.equinox.p2.type.fragment"; //$NON-NLS-1$
69
	public static final String PROP_TYPE_FRAGMENT = "org.eclipse.equinox.p2.type.fragment"; //$NON-NLS-1$
70
70
71
	/**
71
	/**
72
	 * A property key (value <code>"org.eclipse.equinox.p2.type.fragment.translation"</code>) for a
73
	 * boolean property indicating that an installable unit is a translation fragment
74
	 */
75
	public static final String PROP_TYPE_FRAGMENT_TRANSLATION = "org.eclipse.equinox.p2.type.fragment.translation"; //$NON-NLS-1$
76
77
	/**
72
	 * A property key (value <code>"org.eclipse.equinox.p2.type.group"</code>) for a 
78
	 * A property key (value <code>"org.eclipse.equinox.p2.type.group"</code>) for a 
73
	 * boolean property indicating that an installable unit is a group.
79
	 * boolean property indicating that an installable unit is a group.
74
	 * 
80
	 * 
(-)src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java (+13 lines)
Lines 18-23 Link Here
18
import org.eclipse.core.runtime.NullProgressMonitor;
18
import org.eclipse.core.runtime.NullProgressMonitor;
19
import org.eclipse.equinox.internal.p2.updatesite.SiteXMLAction;
19
import org.eclipse.equinox.internal.p2.updatesite.SiteXMLAction;
20
import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
20
import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
21
import org.eclipse.equinox.internal.provisional.p2.metadata.query.IUPropertyQuery;
21
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
22
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
22
import org.eclipse.equinox.internal.provisional.p2.query.Collector;
23
import org.eclipse.equinox.internal.provisional.p2.query.Collector;
23
import org.eclipse.equinox.p2.publisher.PublisherInfo;
24
import org.eclipse.equinox.p2.publisher.PublisherInfo;
Lines 187-192 Link Here
187
		assertEquals("1.1", "Foo English Provider - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH));
188
		assertEquals("1.1", "Foo English Provider - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH));
188
	}
189
	}
189
190
191
	public void testBundleLocalization_fragmentProperty() throws IOException {
192
		File bundle = TestData.getFile("localizationtests/foobundle2", "");
193
		File fragment = TestData.getFile("localizationtests/foofragment2", "");
194
		BundlesAction action = new BundlesAction(new File[] {bundle, fragment});
195
		action.perform(info, results, monitor);
196
197
		Collector collector = results.query(new IUPropertyQuery(IInstallableUnit.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()), new Collector(), new NullProgressMonitor());
198
		assertEquals("1.0", 1, collector.size());
199
		IInstallableUnit translationFragment = (IInstallableUnit) collector.iterator().next();
200
		assertEquals("1.1", Boolean.TRUE.toString(), translationFragment.getProperty(IInstallableUnit.PROP_TYPE_FRAGMENT_TRANSLATION));
201
	}
202
190
	public void testBundleLocalizationDE_fragment() throws IOException {
203
	public void testBundleLocalizationDE_fragment() throws IOException {
191
		File bundle = TestData.getFile("localizationtests/foobundle2", "");
204
		File bundle = TestData.getFile("localizationtests/foobundle2", "");
192
		File fragment = TestData.getFile("localizationtests/foofragment2", "");
205
		File fragment = TestData.getFile("localizationtests/foofragment2", "");
(-)src/org/eclipse/equinox/p2/publisher/eclipse/BundlesAction.java (+1 lines)
Lines 270-275 Link Here
270
270
271
		fragment.setSingleton(true);
271
		fragment.setSingleton(true);
272
		fragment.setProperty(IInstallableUnit.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString());
272
		fragment.setProperty(IInstallableUnit.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString());
273
		fragment.setProperty(IInstallableUnit.PROP_TYPE_FRAGMENT_TRANSLATION, Boolean.TRUE.toString());
273
274
274
		// Create a provided capability for each locale and add the translated properties.
275
		// Create a provided capability for each locale and add the translated properties.
275
		ArrayList providedCapabilities = new ArrayList(hostLocalizations.keySet().size());
276
		ArrayList providedCapabilities = new ArrayList(hostLocalizations.keySet().size());

Return to bug 278309