Smack/smack-core/src/test/java/org/jivesoftware/smack
Florian Schmaus 89c0fa4b99 Let StringUtils.(insecure)randomString() return empty string
in case length is zero. Also do throw a NegativeArraySizeException if
length is negative instead of returning null.

This fixes the following sporadic test issue:

org.jivesoftware.smackx.ox.PainlessOpenPgpProviderTest > encryptDecryptTest FAILED
java.lang.AssertionError
at org.jivesoftware.smack.util.XmlStringBuilder.escape(XmlStringBuilder.java:425)
at org.jivesoftware.smackx.ox.element.EncryptedOpenPgpContentElement.addCommonXml(EncryptedOpenPgpContentElement.java:65)
at org.jivesoftware.smackx.ox.element.CryptElement.toXML(CryptElement.java:51)
at org.jivesoftware.smackx.ox.element.CryptElement.toXML(CryptElement.java:31)
at org.jivesoftware.smack.packet.Element.toXML(Element.java:41)
at org.jivesoftware.smackx.ox.element.OpenPgpContentElement.toInputStream(OpenPgpContentElement.java:186)
at org.jivesoftware.smackx.ox.crypto.PainlessOpenPgpProvider.encrypt(PainlessOpenPgpProvider.java:136)
at org.jivesoftware.smackx.ox.PainlessOpenPgpProviderTest.encryptDecryptTest(PainlessOpenPgpProviderTest.java:155)

because EncryptedOpenPgpContentElement rpad field was sometimes
'null' in case the random function returned '0' as length.
2019-03-25 18:58:58 +01:00
..
compress Introduce XmlEnvironment 2019-02-05 13:18:03 +01:00
filter Enable LeftCurly checkstyle check 2018-04-06 10:25:06 +02:00
packet Introduce XmlEnvironment 2019-02-05 13:18:03 +01:00
parsing Use XmlEnvironment in parsing/provider subsystem 2019-02-15 23:21:30 +01:00
provider Use XmlEnvironment in parsing/provider subsystem 2019-02-15 23:21:30 +01:00
sasl Merge branch '4.2' into master-paul-merged 2017-12-17 11:16:02 +01:00
test/util Use XmlEnvironment in parsing/provider subsystem 2019-02-15 23:21:30 +01:00
util Let StringUtils.(insecure)randomString() return empty string 2019-03-25 18:58:58 +01:00
ConnectionConfigurationTest.java Add ConnectionConfiguration.setHostAddressByNameOrIp(CharSequence fqdnOrIp) 2018-12-04 15:59:11 +01:00
DummyConnection.java Add MemoryLeakTest(Util) 2019-03-25 18:58:58 +01:00
SmackConfigurationTest.java Bump errorprone to 2.2.0 2018-03-28 15:56:04 +02:00
SmackExceptionTest.java Bump MiniDNS to 0.3.0 2018-05-05 10:53:52 +02:00
SmackFutureTest.java Rework SmackFuture and add async API based on it 2017-08-12 17:35:45 +02:00
StanzaCollectorTest.java Introduce XmlEnvironment 2019-02-05 13:18:03 +01:00
StanzaIdTest.java Add CustomImportOrder checkstyle rule 2017-06-14 17:12:43 +02:00
ThreadedDummyConnection.java Make sendStanza() final 2019-02-05 13:18:03 +01:00