< prev index next >

test/java/rmi/registry/serialFilter/RegistryFilterTest.java

Print this page

        

*** 33,54 **** import java.rmi.registry.Registry; import java.security.Security; import java.util.Objects; import org.testng.Assert; - import org.testng.TestNG; import org.testng.annotations.BeforeSuite; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; /* * @test * @library /java/rmi/testlibrary - * @modules java.rmi/sun.rmi.registry - * java.rmi/sun.rmi.server - * java.rmi/sun.rmi.transport - * java.rmi/sun.rmi.transport.tcp * @build TestLibrary * @summary Test filters for the RMI Registry * @run testng/othervm RegistryFilterTest * @run testng/othervm * -Dsun.rmi.registry.registryFilter=!java.lang.Long;!RegistryFilterTest$RejectableClass;maxdepth=19 --- 33,49 ----
*** 63,100 **** private static int port; private static Registry registry; static final int REGISTRY_MAX_DEPTH = 20; ! static final int REGISTRY_MAX_ARRAY = 10000; static final String registryFilter = System.getProperty("sun.rmi.registry.registryFilter", Security.getProperty("sun.rmi.registry.registryFilter")); - @DataProvider(name = "bindAllowed") - static Object[][] bindAllowedObjects() { - Object[][] objects = { - }; - return objects; - } - /** ! * Data RMI Regiry bind test. * - name * - Object * - true/false if object is blacklisted by a filter (implicit or explicit) * @return array of test data */ @DataProvider(name = "bindData") static Object[][] bindObjects() { Object[][] data = { { "byte[max]", new XX(new byte[REGISTRY_MAX_ARRAY]), false }, { "String", new XX("now is the time"), false}, ! { "String[]", new XX(new String[3]), false}, ! { "Long[4]", new XX(new Long[4]), registryFilter != null }, { "rej-byte[toobig]", new XX(new byte[REGISTRY_MAX_ARRAY + 1]), true }, { "rej-MarshalledObject", createMarshalledObject(), true }, { "rej-RejectableClass", new RejectableClass(), registryFilter != null}, }; return data; } --- 58,90 ---- private static int port; private static Registry registry; static final int REGISTRY_MAX_DEPTH = 20; ! static final int REGISTRY_MAX_ARRAY = 1_000_000; static final String registryFilter = System.getProperty("sun.rmi.registry.registryFilter", Security.getProperty("sun.rmi.registry.registryFilter")); /** ! * Data RMI Registry bind test. * - name * - Object * - true/false if object is blacklisted by a filter (implicit or explicit) * @return array of test data */ @DataProvider(name = "bindData") static Object[][] bindObjects() { Object[][] data = { { "byte[max]", new XX(new byte[REGISTRY_MAX_ARRAY]), false }, { "String", new XX("now is the time"), false}, ! { "String[3]", new XX(new String[3]), false}, ! { "Long[4]", new XX(new Long[4]), false }, ! { "Object[REGISTRY_MAX_ARRAY]", new XX(new Object[REGISTRY_MAX_ARRAY]), false }, { "rej-byte[toobig]", new XX(new byte[REGISTRY_MAX_ARRAY + 1]), true }, + { "rej-Object[toobig]", new XX(new Object[REGISTRY_MAX_ARRAY + 1]), true }, { "rej-MarshalledObject", createMarshalledObject(), true }, { "rej-RejectableClass", new RejectableClass(), registryFilter != null}, }; return data; }
< prev index next >