Smack/smack-core/src/test/java/org/jivesoftware/smack/util
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
..
stringencoder Remove package-info.java from test packages 2015-04-05 10:48:00 +02:00
DnsUtilTest.java Fix DNSUtil.setDaneProvider() 2018-06-12 19:06:18 +02:00
MemoryLeakTestUtil.java Add MemoryLeakTest(Util) 2019-03-25 18:58:58 +01:00
NetworkUtil.java Implement flexible port selection in Socks5ClientTest 2016-07-08 08:07:37 +02:00
PacketParserUtilsTest.java Introduce XmlEnvironment 2019-02-05 13:18:03 +01:00
SHA1Test.java More checkstyle whitespace related checks 2017-05-24 14:42:38 +02:00
StringUtilsTest.java Let StringUtils.(insecure)randomString() return empty string 2019-03-25 18:58:58 +01:00
XmlUtilTest.java Add XmlUtil.prettyFormatXml() 2017-09-10 16:46:26 +02:00