This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-io.git
The following commit(s) were added to refs/heads/master by this push: new f0093ffa Sort members f0093ffa is described below commit f0093ffa7394d121a23c0b1649bddd41c0b6dcaf Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Wed Nov 15 21:36:35 2023 -0500 Sort members --- .../io/serialization/MoreComplexObjectTest.java | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/test/java/org/apache/commons/io/serialization/MoreComplexObjectTest.java b/src/test/java/org/apache/commons/io/serialization/MoreComplexObjectTest.java index 34910e05..a065a29b 100644 --- a/src/test/java/org/apache/commons/io/serialization/MoreComplexObjectTest.java +++ b/src/test/java/org/apache/commons/io/serialization/MoreComplexObjectTest.java @@ -56,27 +56,6 @@ public class MoreComplexObjectTest extends AbstractCloseableListTest { inputStream = closeAfterEachTest(new ByteArrayInputStream(bos.toByteArray())); } - /** Here we accept everything but reject specific classes, using a pure - * blacklist mode. - * - * That's not as safe as it's hard to get an exhaustive blacklist, but - * might be ok in controlled environments. - */ - @Test - public void testUseBlacklist() throws IOException, ClassNotFoundException { - final String [] blacklist = { - "org.apache.commons.collections.functors.InvokerTransformer", - "org.codehaus.groovy.runtime.ConvertedClosure", - "org.codehaus.groovy.runtime.MethodClosure", - "org.springframework.beans.factory.ObjectFactory" - }; - assertSerialization(closeAfterEachTest( - new ValidatingObjectInputStream(inputStream) - .accept("*") - .reject(blacklist) - )); - } - /** Trusting java.* is probably reasonable and avoids having to be too * detailed in the accepts. */ @@ -101,4 +80,25 @@ public class MoreComplexObjectTest extends AbstractCloseableListTest { .accept("java.lang.*", "[Ljava.lang.*") )); } + + /** Here we accept everything but reject specific classes, using a pure + * blacklist mode. + * + * That's not as safe as it's hard to get an exhaustive blacklist, but + * might be ok in controlled environments. + */ + @Test + public void testUseBlacklist() throws IOException, ClassNotFoundException { + final String [] blacklist = { + "org.apache.commons.collections.functors.InvokerTransformer", + "org.codehaus.groovy.runtime.ConvertedClosure", + "org.codehaus.groovy.runtime.MethodClosure", + "org.springframework.beans.factory.ObjectFactory" + }; + assertSerialization(closeAfterEachTest( + new ValidatingObjectInputStream(inputStream) + .accept("*") + .reject(blacklist) + )); + } } \ No newline at end of file