Skip to content

Commit

Permalink
Remove trailing white spaces on all lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Dec 18, 2019
1 parent ade390e commit e1c6c76
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/test/java/org/apache/commons/mail/AbstractEmailTest.java
Expand Up @@ -519,7 +519,7 @@ private byte[] getMessageBodyBytes(final MimeMessage mimeMessage)
protected boolean isMailServerStopped(final Wiser fakeMailServer) {
return !fakeMailServer.getServer().isRunning();
}

/**
* Create a mocked URL object which always throws an IOException
* when the openStream() method is called.
Expand All @@ -533,7 +533,7 @@ protected URL createInvalidURL() throws Exception {
final URL url = createMock(URL.class);
expect(url.openStream()).andThrow(new IOException());
replay(url);

return url;
}
}
2 changes: 1 addition & 1 deletion src/test/java/org/apache/commons/mail/EmailLiveTest.java
Expand Up @@ -235,7 +235,7 @@ public void testHtmlMailMimeLayout() throws Exception
htmlEmail4.setHtmlMsg(htmlMsg);
htmlEmail4.attach(attachment);

EmailUtils.writeMimeMessage( new File("./target/test-emails/htmlemail4.eml"), send(htmlEmail4).getMimeMessage());
EmailUtils.writeMimeMessage( new File("./target/test-emails/htmlemail4.eml"), send(htmlEmail4).getMimeMessage());
}

/**
Expand Down
14 changes: 7 additions & 7 deletions src/test/java/org/apache/commons/mail/EmailTest.java
Expand Up @@ -343,7 +343,7 @@ public void testSetFromBadEncoding() throws Exception {
email.setFrom("me@home.com", "me@home.com", "bad.encoding\uc5ec\n");
}

@Test
@Test
public void testAddTo() throws Exception
{
// ====================================================================
Expand Down Expand Up @@ -913,7 +913,7 @@ public void testGetHeaders()

assertEquals(ht.size(), email.getHeaders().size());
}

@Test
public void testFoldingHeaders() throws Exception
{
Expand All @@ -925,23 +925,23 @@ public void testFoldingHeaders() throws Exception

final String headerValue = "1234567890 1234567890 123456789 01234567890 123456789 0123456789 01234567890 01234567890";
email.addHeader("X-LongHeader", headerValue);

assertTrue(email.getHeaders().size() == 1);
// the header should not yet be folded -> will be done by buildMimeMessage()
assertFalse(email.getHeaders().get("X-LongHeader").contains("\r\n"));

email.buildMimeMessage();

final MimeMessage msg = email.getMimeMessage();
msg.saveChanges();

final String[] values = msg.getHeader("X-LongHeader");
assertEquals(1, values.length);

// the header should be split in two lines
final String[] lines = values[0].split("\\r\\n");
assertEquals(2, lines.length);

// there should only be one line-break
assertTrue(values[0].indexOf("\n") == values[0].lastIndexOf("\n"));
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/apache/commons/mail/HtmlEmailTest.java
Expand Up @@ -599,7 +599,7 @@ public void testAddZipUrl() throws Exception
this.email.getCcAddresses(),
this.email.getBccAddresses(),
false);

// make sure that no double dots show up
assertTrue(this.email.getHtmlMsg().contains("3DTZC268X93337.zip"));
assertFalse(this.email.getHtmlMsg().contains("3DTZC268X93337..zip"));
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/apache/commons/mail/ImageHtmlEmailTest.java
Expand Up @@ -476,7 +476,7 @@ public void testEmail127() throws Exception {
email.getFromAddress(), email.getToAddresses(),
email.getCcAddresses(), email.getBccAddresses(), true);
}

private String loadUrlContent(final URL url) throws IOException {
final InputStream stream = url.openStream();
final StringBuilder html = new StringBuilder();
Expand All @@ -490,7 +490,7 @@ private String loadUrlContent(final URL url) throws IOException {
}
return html.toString();
}

private static final class MockDataSourceClassPathResolver extends DataSourceClassPathResolver {

public MockDataSourceClassPathResolver(final String classPathBase, final boolean lenient) {
Expand All @@ -504,6 +504,6 @@ public DataSource resolve(final String resourceLocation, final boolean isLenient
ds.setName(null);
return ds;
}

}
}
4 changes: 2 additions & 2 deletions src/test/java/org/apache/commons/mail/MultiPartEmailTest.java
Expand Up @@ -327,15 +327,15 @@ public void testAttachFileLocking() throws Exception {
// ====================================================================

final File tmpFile = File.createTempFile("attachment", ".eml");

this.email.attach(
new FileDataSource(tmpFile),
"Test Attachment",
"Test Attachment Desc");

assertTrue(tmpFile.delete());
}

@Test
public void testAddPart() throws Exception
{
Expand Down
Expand Up @@ -69,14 +69,14 @@ public void testExternalModification() throws Exception
final DataSourceCompositeResolver dataSourceResolver = new DataSourceCompositeResolver(dataSourceResolvers, true);

final DataSourceResolver[] arr = dataSourceResolver.getDataSourceResolvers();

// modify an element in the returned array
arr[0] = null;

final DataSourceResolver[] arr2 = dataSourceResolver.getDataSourceResolvers();

// assert that the external modification is not propagated to the internal array
assertNotNull(arr2[0]);
assertNotNull(arr2[0]);
}

}
Expand Up @@ -159,7 +159,7 @@ public void testParseHtmlEmailWithAttachmentAndEncodedFilename() throws Exceptio
*
* @throws Exception the test failed
*/
@Test
@Test
public void testParseMultipartReport() throws Exception
{
DataSource dataSource;
Expand Down Expand Up @@ -197,7 +197,7 @@ public void testParseMultipartReport() throws Exception
*
* @throws Exception the test failed
*/
@Test
@Test
public void testAttachmentOnly() throws Exception
{
DataSource dataSource;
Expand Down Expand Up @@ -227,15 +227,15 @@ public void testAttachmentOnly() throws Exception
assertNotNull(dataSource);
assertEquals("application/pdf", dataSource.getContentType());
}

/**
* This test parses an eml file published with issue EMAIL-110.
* This eml file has a corrupted attachment but should not create
* an OutOfMemoryException.
*
*
* @throws Exception the test failed
*/
@Test
@Test
public void testParseNoHeaderSeperatorWithOutOfMemory() throws Exception
{
final Session session = Session.getDefaultInstance(new Properties());
Expand All @@ -261,7 +261,7 @@ public void testParseNoHeaderSeperatorWithOutOfMemory() throws Exception
*
* @throws Exception the test failed
*/
@Test
@Test
public void testMultipartTextAttachment() throws Exception
{
DataSource dataSource;
Expand Down Expand Up @@ -297,7 +297,7 @@ public void testMultipartTextAttachment() throws Exception
*
* @throws Exception the test failed
*/
@Test
@Test
public void testMultipartTextAttachmentOnly() throws Exception
{
DataSource dataSource;
Expand Down

0 comments on commit e1c6c76

Please sign in to comment.