use of org.eclipse.tycho.versions.bundle.MutableBundleManifest in project tycho by eclipse.
the class MutableBundleManifestTest method addAttribute.
@Test
public void addAttribute() throws Exception {
MutableBundleManifest mf = getManifest("/manifests/addheader.mf");
mf.add(new ManifestAttribute("header", "value"));
assertContents(mf, "/manifests/addheader.mf_expected");
}
use of org.eclipse.tycho.versions.bundle.MutableBundleManifest in project tycho by eclipse.
the class MutableBundleManifestTest method updateExportedPackageVersions.
@Test
public void updateExportedPackageVersions() throws IOException {
MutableBundleManifest mf = getManifest("/manifests/updateExportedPackageVersions.mf");
Map<String, String> importPackageVersionChanges = new HashMap<>();
importPackageVersionChanges.put("com.package1", "1.0.1");
importPackageVersionChanges.put("com.package2", "1.1.0");
mf.updateExportedPackageVersions(importPackageVersionChanges);
assertContents(mf, "/manifests/updateExportedPackageVersions.mf_expected");
}
use of org.eclipse.tycho.versions.bundle.MutableBundleManifest in project tycho by eclipse.
the class MutableBundleManifestTest method updateExportedPackageVersionsDoesNotReformatIfNotNecessary.
@Test
public void updateExportedPackageVersionsDoesNotReformatIfNotNecessary() throws Exception {
MutableBundleManifest mf = getManifest("/manifests/updateExportedPackageVersions.mf");
// change nothing: the specified versions are already the version presents in the manifest
Map<String, String> importPackageVersionChanges = new HashMap<>();
importPackageVersionChanges.put("com.package1", "1.0.0");
importPackageVersionChanges.put("com.package2", "1.0.0");
// expect that nothing is changed (that is the formatting remains intact)
assertContents(mf, "/manifests/updateExportedPackageVersions.mf");
}
use of org.eclipse.tycho.versions.bundle.MutableBundleManifest in project tycho by eclipse.
the class MutableBundleManifestTest method shouldPreserveWindowsLineEndings.
@Test
public void shouldPreserveWindowsLineEndings() throws Exception {
// given
String manifestStr = "Bundle-SymbolicName: name\r\nBundle-Version: version\r\n\r\nUnparsed1\r\nUnparsed2\r\n";
// when
InputStream manifestIs = new ByteArrayInputStream(manifestStr.getBytes("ascii"));
MutableBundleManifest manifest = MutableBundleManifest.read(manifestIs);
String written = toAsciiString(manifest);
// then
Assert.assertEquals(manifestStr, written);
Assert.assertEquals("name", manifest.getSymbolicName());
Assert.assertEquals("version", manifest.getVersion());
}
use of org.eclipse.tycho.versions.bundle.MutableBundleManifest in project tycho by eclipse.
the class MutableBundleManifestTest method setFragmentHostVersion.
@Test
public void setFragmentHostVersion() throws IOException {
MutableBundleManifest mf = getManifest("/manifests/setFragmentHostVersion.mf");
mf.setFragmentHostVersion("1.0.1");
assertContents(mf, "/manifests/setFragmentHostVersion.mf_expected");
}
Aggregations