Lines Matching defs:filter

65      * @param <V> Boolean for if the filter should allow or reject
146 * available to the filter.
218 * Test each object and verify the classes identified by the filter,
219 * the count of calls to the filter, the max array size, max refs, max depth,
221 * This test ignores/is not dependent on the global filter settings.
224 * @param count the expected count of calls to the filter
251 * A filter is created from the pattern and used to serialize and
253 * This test ignores/is not dependent on the global filter settings.
263 * Test that the filter on a OIS can be set only on a fresh OIS,
265 * This test is agnostic the global filter being set or not.
277 // Check the initial filter is the global filter; may be null
280 Assert.assertEquals(global, initial, "initial filter should be the global filter");
284 ObjectInputFilter filter = ois.getObjectInputFilter();
285 Assert.assertNull(filter, "set to null should be null");
291 Assert.fail("Should not be able to set filter twice");
307 * that the callback to the filter includes the proper array length.
314 Object o = validate(bytes, object); // the object is its own filter
321 * Construct a filter with the limit and the limit repeated -1.
322 * Invoke the filter with the limit to make sure it is rejected.
323 * Invoke the filter with the limit -1 to make sure it is accepted.
331 ObjectInputFilter filter = ObjectInputFilter.Config.createFilter(pattern);
333 filter.checkInput(new FilterValues(arrayClass, value, value, value, value)),
335 "last limit value not used: " + filter);
337 filter.checkInput(new FilterValues(arrayClass, value-1, value-1, value-1, value-1)),
339 "last limit value not used: " + filter);
344 * Construct a filter with the limit, it should throw IllegalArgumentException.
350 ObjectInputFilter filter = ObjectInputFilter.Config.createFilter(pattern);
358 * Test that returning null from a filter causes deserialization to fail.
394 ObjectInputFilter filter = ObjectInputFilter.Config.createFilter("");
395 Assert.assertNull(filter, "empty pattern did not return null");
397 filter = ObjectInputFilter.Config.createFilter(";;;;");
398 Assert.assertNull(filter, "pattern with only delimiters did not return null");
402 * Read objects from the serialized stream, validated with the filter.
405 * @param filter the ObjectInputFilter
410 ObjectInputFilter filter) throws IOException {
413 ois.setObjectInputFilter(filter);
445 * A filter that accumulates information about the checkInput callbacks
460 public ObjectInputFilter.Status checkInput(FilterInfo filter) {
461 Class<?> serialClass = filter.serialClass();
463 serialClass, filter.arrayLength(), filter.references(),
464 filter.depth(), filter.streamBytes());
478 this.maxArray = Math.max(this.maxArray, filter.arrayLength());
479 this.maxRefs = Math.max(this.maxRefs, filter.references());
480 this.maxDepth = Math.max(this.maxDepth, filter.depth());
481 this.maxBytes = Math.max(this.maxBytes, filter.streamBytes());
497 * Create a filter from a pattern and API factory, then serialize and
507 ObjectInputFilter filter = ObjectInputFilter.Config.createFilter(pattern);
508 validate(bytes, filter);
509 Assert.assertTrue(allowed, "filter should have thrown an exception");
513 Assert.assertFalse(allowed, "filter should not have thrown an exception: " + ice);
520 * For a filter pattern, generate and apply a test object to the action.
740 public ObjectInputFilter.Status checkInput(FilterInfo filter) {
741 if (ReadResolveToArray.class.isAssignableFrom(filter.serialClass())) {
744 if (filter.serialClass() != array.getClass() ||
745 (filter.arrayLength() >= 0 && filter.arrayLength() != length)) {