1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-13 21:15:08 -05:00
Commit Graph

52 Commits

Author SHA1 Message Date
Joe Steele
dab8d3807f Change LocalKeyStore error reporting
The error reporting assures an exception is thrown if
setKeyStoreFile(null) is called without a prior call to
setKeyStoreLocation(String directory).

Also, fix TrustManagerFactoryTest indentation.
2013-12-04 12:10:12 -05:00
Joe Steele
cedcd7e47c Eliminate the need to pass a context to LocalKeyStore.getInstance
Instead, have K9.onCreate initialize the location of the key
store file (similar to what is done with
BinaryTempFileBody.setTempDirectory).

Also, LocalKeyStore.getInstance has been changed so that it
no longer needs to be synchronized.
2013-12-03 19:24:37 -05:00
cketti
765b390eb5 Remove LocalKeyStore's dependency on K9.app 2013-12-03 13:28:48 +01:00
Joe Steele
5bf27c1031 Move unit test class to match changes in commit 40404c3 2013-12-02 16:50:57 -05:00
Joe Steele
9e6abf5fa7 Merge branch 'cert_validation' of git://github.com/k9mail/k-9.git into cert_validation
Conflicts:
	tests/src/com/fsck/k9/mail/store/TrustManagerFactoryTest.java
2013-12-02 16:30:11 -05:00
Joe Steele
40404c3700 Move some classes out of com.fsck.k9.mail.store
The classes are just as much related to com.fsck.k9.mail.transport
as com.fsck.k9.mail.store, so having them in
com.fsck.k9.mail.store doesn't seem appropriate.

Move LocalKeyStore to com.fsck.k9.security

Move TrustManagerFactory and TrustedSocketFactory to com.fsck.k9.net.ssl
2013-12-02 14:07:57 -05:00
Joe Steele
76605f7d86 Extract code into new LocalKeyStore class
Also, implement the ability to configure an alternate key store
file location. This permits the running of unit tests without
clobbering the live key store file.

Also, add a test to confirm that the key store file is being written
out and reread correctly.
2013-12-02 14:04:40 -05:00
cketti
5f38306a9a Add more unit tests for TrustManagerFactory 2013-12-02 16:42:33 +01:00
Joe Steele
eb13691918 Eliminate the need for reflection to access hidden API 2013-11-30 18:34:57 -05:00
cketti
8368ba8a11 Add test to make sure we don't check the wrong certificates
Right now we happily accept every certificate in our local key store as long as
the hostname matches the certificate DN. So this test fails.
It's not a huge deal since the user accepted the certificate at one point. But we
want to do this right.
2013-11-29 11:39:04 +01:00
cketti
c5c195d243 Add unit tests for TrustManagerFactory 2013-11-29 10:49:52 +01:00
Joe Steele
5a46575dc2 Generally replace \n with \r\n when part of a message
This builds upon the efforts started 2 commits back where \r\n is used for
all message text and \n is only used when the text is inside an
EolConvertingEditText widget.
2013-10-11 11:39:46 -04:00
Joe Steele
e20170c996 Update the tests project.
Target the same SDK version as in K-9 Mail.

Update the .classpath file as modified by the latest Eclipse ADT plugin.

Remove unused import.
2013-10-11 11:24:55 -04:00
Koji Arai
0be299fbd0 Avoid StringIndexOutOfBoundsException when the header is broken like "=?us-ascii?q?abc?= =?" 2013-09-20 13:15:57 +09:00
Koji Arai
1c7d7af975 newly added a test testDecodeEncodedWords() 2013-09-20 13:15:49 +09:00
Joe Steele
1ca1ef5c84 Content-type case-conversion changes.
Don't convert the content-type to lower case in
MimeMessage.getContentType.  The content-type may have optional parameters
that are case sensitive (boundary, name).

In removing the lower-case conversion from getContentType, a review was
made for inappropriate case-sensitive comparisons which use data obtained
with getContentType.  The only ones found were in isMimeType in both
Message and MimeBodyPart.

Case-sensitive instances of isMimeType were made case-insensitive.  Also,
isMimeType was moved from Message to MimeMessage for symmetry with
MimeBodyPart (MimeMessage & MimeBodyPart are similar and contain a good
bit of duplication such as this).

The unit test required fixing now that the case of the boundary text is
preserved.

References:

Commits 2c5186 and dc4002 added the toLowerCase to getContentType in
MimeMessage & MimeBodyPart (Issue 94).

Later, commit 50cd60 removed the toLowerCase addition from MimeBodyPart
(Issue 1289).
2013-09-03 19:54:18 -04:00
Joe Steele
63f68328ff Standardize line breaks within headers.
Fix the unit test to match.

All line endings in the unit test are now the same.

(Just for consistency.  Not a big deal, since such problems are fixed when
the messages are run through EOLConvertingOutputStream.)
2013-09-03 19:54:17 -04:00
Joe Steele
074159f442 Unit test for recursive 8bit -> 7bit message conversion 2013-09-03 19:54:16 -04:00
Koji Arai
4dcf50d127 Re-desined textToHtml() according to the state transition diagram. 2013-05-11 08:44:17 +09:00
Koji Arai
3c83f7354e Added more tests for preserve spaces 2013-05-09 23:07:58 +09:00
Koji Arai
ae681cb7fe Added test for preserve spaces at first of line 2013-05-09 22:11:05 +09:00
Koji Arai
ba33ef232e Wrap expected long strings 2013-05-09 22:10:37 +09:00
Joe Steele
c790fa73c1 Don't store the font-family preference with plain text messages.
Dynamically generate the CSS style for <pre> elements
for inclusion in the HTML <head> element when messages
are displayed.

This permits a user to change their font-family preference
for plain text messages and see the results immediately.

Obviously any old locally-stored messages that had their
font-family stored with them will continue to display using
that font-family, irrespective of the user's current
preference setting.
2013-03-01 18:48:46 -05:00
Joe Steele
c21ea14af1 Fix unit tests. 2013-03-01 14:34:31 -05:00
Danny Baumann
0fac8e999d Clean up date handling.
Remove home-grown date formatting, and replace it by usage of the
DateUtils class which is present since API level 3.
2013-02-11 15:19:15 +01:00
cketti
e66dd3d521 Fixed unit tests 2012-10-08 14:43:34 +02:00
cketti
2ad748fad7 Change ImapUtility to use 'long' for the values of sequence sets 2012-07-07 16:21:07 +02:00
cketti
602ce7be99 Trim the first value in getHeaderParameters()
Previously a value like 'text/html ; charset="windows-1251"' for the
Content-Type header would not be decoded correctly.

Fixes issue 4348
2012-06-18 04:46:46 +02:00
cketti
609cdf6bc5 Worked around API7/API10 differences in unit test
GMT-dates are formatted without "+00:00" offset in API7 emulators.
2012-06-09 01:39:15 +02:00
cketti
982f78fcc9 Explicitly set the language to be used in unit test 2012-05-30 16:02:00 +02:00
cketti
3daaecf2c9 Added test to validate the date format strings in translations 2012-05-30 15:12:51 +02:00
ashley willis
2ffc18f224 Replaced android.test.InstrumentationTestRunner with com.zutubi.android.junitreport.JUnitReportTestRunner.
Create javadoc/ directory when doing "ant javadoc". Fixed installing debug builds with ant.

"ant -f tests/build.xml debug && ant -f tests/build.xml installt test test-report" compiles, installs, tests,
and saves output to tests/junit-report.xml.
2012-05-23 21:16:12 -05:00
cketti
e591674357 Fixed issue with TimeZone.setDefault() 2012-05-18 20:00:15 +02:00
cketti
87c11a4ad2 Updated tests to reflect changes in HtmlConverter.htmlifyMessageHeader() 2012-05-18 19:59:29 +02:00
cketti
2c8ae0644b Fixed code style 2012-04-25 16:46:05 +00:00
cketti
464a5d54e3 Make HtmlConverterTest extend TestCase like the other tests do 2012-04-25 14:11:15 +00:00
Andrew Chen
adf00946bf Use property to determine if we should write test debug information or not. 2012-04-23 15:24:02 -07:00
Andrew Chen
c829fe9cd2 Remove top margin on converted quote text, consistent with html quoted text. 2012-04-23 15:13:45 -07:00
Andrew Chen
9f1e2717a6 Colorize quoted text that has been converted to html.
Like Thunderbird, but optimized for mobile (no right margin quote bar, thinner left margin quote bar).
2012-04-23 15:10:34 -07:00
Andrew Chen
0bb1f4ff56 Add 1ex of margin at the bottom of converted blockquotes. 2012-04-23 14:00:03 -07:00
Andrew Chen
32ce196b5a Convert quote characters in plain text messages to blockquotes in the html version. "Be like Thunderbird." 2012-04-17 10:22:43 -07:00
cketti
0caac114a6 Added some error checks when processing IMAP FETCH responses 2012-04-03 07:55:52 +02:00
cketti
561d2a1a44 Added unit test for MimeUtility.getHeaderParameter() 2012-03-12 17:44:53 +01:00
cketti
5591865f17 Merge branch 'uidplus' 2012-02-29 14:09:41 +01:00
cketti
03d4cee14a Added tests for MimeUtility.extractTextAndAttachments() 2012-02-18 00:25:14 +01:00
cketti
33029a1f17 Imported unit tests for ImapUtility from AOSP Email 2012-02-17 15:34:10 +01:00
cketti
ed560bdac7 Added unit tests for IMAP store URIs 2011-12-01 06:31:18 +01:00
cketti
4f060642ee Merge branch 'imap_parser' 2011-11-16 04:52:05 +01:00
cketti
1ab75f11f1 Added simple unit tests for ImapResponseParser 2011-11-16 04:34:38 +01:00
Bernhard Redl
68cecb168e added testcases for address#parse function,changed empty to null (conforms to existing code) 2011-11-03 01:36:57 +01:00