use of org.eclipse.tycho.versions.bundle.ManifestAttribute in project tycho by eclipse.
the class ManifestAttributeTest method shouldNotWrapOriginalLines.
@Test
public void shouldNotWrapOriginalLines() throws Exception {
// given
StringWriter writer = new StringWriter();
// when
ManifestAttribute attribute = new ManifestAttribute("headername: abcdefghijklmnopq");
attribute.add(" rstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
attribute.add(" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
attribute.add(" abcdefghijklmnop");
attribute.add(" qrstuvwxyzABCDE");
attribute.add(" FGHIJKLMNOPQRSTUVWXYZ0123");
attribute.add(" 456789");
attribute.writeTo(writer, "\n");
// then
assertEquals("headername: abcdefghijklmnopq\n" + " rstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n" + " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n" + " abcdefghijklmnop\n" + " qrstuvwxyzABCDE\n" + " FGHIJKLMNOPQRSTUVWXYZ0123\n" + " 456789\n", writer.toString());
}
use of org.eclipse.tycho.versions.bundle.ManifestAttribute in project tycho by eclipse.
the class ManifestAttributeTest method shouldCreateWithOldMacLine.
@Test
public void shouldCreateWithOldMacLine() {
// given
String key = "headername";
String value = "headervalue";
String line = key + ": " + value + "\r";
// when
ManifestAttribute attribute = new ManifestAttribute(line);
// then
assertEquals(value, attribute.getValue());
assertTrue(attribute.hasName(key));
}
Aggregations