类org.apache.logging.log4j.core.Filter源码实例Demo

下面列出了怎么用org.apache.logging.log4j.core.Filter的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: patchwork-patcher   文件: UIAppender.java
@SuppressWarnings("unused")
@PluginFactory
public static UIAppender createAppender(@PluginAttribute("name") String name, @PluginAttribute("maxLines") int maxLines,
			@PluginAttribute("ignoreExceptions") boolean ignoreExceptions,
			@PluginElement("Layout") Layout<?> layout, @PluginElement("Filters") Filter filter) {
	if (name == null) {
		LOGGER.error("No name provided for UIAppender");
		return null;
	}

	if (layout == null) {
		layout = JsonLayout.createDefaultLayout();
	}

	return new UIAppender(name, layout, filter, maxLines, ignoreExceptions);
}
 
源代码2 项目: DDMQ   文件: RocketmqLog4j2Appender.java
protected RocketmqLog4j2Appender(String name, Filter filter, Layout<? extends Serializable> layout,
    boolean ignoreExceptions, String nameServerAddress, String producerGroup,
    String topic, String tag) {
    super(name, filter, layout, ignoreExceptions);
    this.producer = producer;
    this.topic = topic;
    this.tag = tag;
    this.nameServerAddress = nameServerAddress;
    this.producerGroup = producerGroup;
    try {
        this.producer = ProducerInstance.getProducerInstance().getInstance(this.nameServerAddress, this.producerGroup);
    } catch (Exception e) {
        ErrorHandler handler = this.getHandler();
        if (handler != null) {
            handler.error("Starting RocketmqLog4j2Appender [" + this.getName()
                + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage());
        }
    }
}
 
源代码3 项目: rocketmq-read   文件: RocketmqLog4j2Appender.java
protected RocketmqLog4j2Appender(String name, Filter filter, Layout<? extends Serializable> layout,
    boolean ignoreExceptions, String nameServerAddress, String producerGroup,
    String topic, String tag) {
    super(name, filter, layout, ignoreExceptions);
    this.producer = producer;
    this.topic = topic;
    this.tag = tag;
    this.nameServerAddress = nameServerAddress;
    this.producerGroup = producerGroup;
    try {
        this.producer = ProducerInstance.getProducerInstance().getInstance(this.nameServerAddress, this.producerGroup);
    } catch (Exception e) {
        ErrorHandler handler = this.getHandler();
        if (handler != null) {
            handler.error("Starting RocketmqLog4j2Appender [" + this.getName()
                + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage());
        }
    }
}
 
源代码4 项目: logging-log4j2   文件: RegexFilterTest.java
@Test
public void testThresholds() throws Exception {
    RegexFilter filter = RegexFilter.createFilter(".* test .*", null, false, null, null);
    filter.start();
    assertTrue(filter.isStarted());
    assertSame(Filter.Result.NEUTRAL,
            filter.filter(null, Level.DEBUG, null, (Object) "This is a test message", (Throwable) null));
    assertSame(Filter.Result.DENY, filter.filter(null, Level.ERROR, null, (Object) "This is not a test",
            (Throwable) null));
    LogEvent event = Log4jLogEvent.newBuilder() //
            .setLevel(Level.DEBUG) //
            .setMessage(new SimpleMessage("Another test message")) //
            .build();
    assertSame(Filter.Result.NEUTRAL, filter.filter(event));
    event = Log4jLogEvent.newBuilder() //
            .setLevel(Level.ERROR) //
            .setMessage(new SimpleMessage("test")) //
            .build();
    assertSame(Filter.Result.DENY, filter.filter(event));
    filter = RegexFilter.createFilter(null, null, false, null, null);
    assertNull(filter);
}
 
SystemdJournalAppender(String name, Filter filter, Layout<?> layout, boolean ignoreExceptions,
                       SystemdJournalLibrary journalLibrary, boolean logSource, boolean logStacktrace, boolean logThreadName,
                       boolean logLoggerName, boolean logAppenderName, boolean logThreadContext, String threadContextPrefix, String syslogIdentifier, String syslogFacility) {
    super(name, filter, layout, ignoreExceptions);
    this.journalLibrary = journalLibrary;
    this.logSource = logSource;
    this.logStacktrace = logStacktrace;
    this.logThreadName = logThreadName;
    this.logLoggerName = logLoggerName;
    this.logAppenderName = logAppenderName;
    this.logThreadContext = logThreadContext;
    if (threadContextPrefix == null) {
        this.threadContextPrefix = "THREAD_CONTEXT_";
    } else {
        this.threadContextPrefix = normalizeKey(threadContextPrefix);
    }
    this.syslogIdentifier = syslogIdentifier;
    this.syslogFacility = syslogFacility;
}
 
源代码6 项目: logging-log4j2   文件: LoggerConfig.java
protected LoggerConfig(final String name, final List<AppenderRef> appenders, final Filter filter,
        final Level level, final boolean additive, final Property[] properties, final Configuration config,
        final boolean includeLocation) {
    super(filter, null);
    this.logEventFactory = LOG_EVENT_FACTORY;
    this.name = name;
    this.appenderRefs = appenders;
    this.level = level;
    this.additive = additive;
    this.includeLocation = includeLocation;
    this.config = config;
    if (properties != null && properties.length > 0) {
        this.properties = Collections.unmodifiableList(Arrays.asList(Arrays.copyOf(
                properties, properties.length)));
    } else {
        this.properties = null;
    }
    this.propertiesRequireLookup = containsPropertyRequiringLookup(properties);
    this.reliabilityStrategy = config.getReliabilityStrategy(this);
}
 
源代码7 项目: logging-log4j2   文件: CompositeFilter.java
public CompositeFilter removeFilter(final Filter filter) {
    if (filter == null) {
        // null does nothing
        return this;
    }
    // This is not a great implementation but simpler than copying Apache Commons
    // Lang ArrayUtils.removeElement() and associated bits (MutableInt),
    // which is OK since removing a filter should not be on the critical path.
    final List<Filter> filterList = new ArrayList<>(Arrays.asList(this.filters));
    if (filter instanceof CompositeFilter) {
        for (final Filter currentFilter : ((CompositeFilter) filter).filters) {
            filterList.remove(currentFilter);
        }
    } else {
        filterList.remove(filter);
    }
    return new CompositeFilter(filterList.toArray(new Filter[this.filters.length - 1]));
}
 
源代码8 项目: logging-log4j2   文件: AsyncLoggerConfig.java
/**
 * @since 3.0
 */
@PluginFactory
public static LoggerConfig createLogger(
        @PluginAttribute final String additivity,
        @PluginAttribute final Level level,
        @PluginAttribute final String includeLocation,
        @PluginElement final AppenderRef[] refs,
        @PluginElement final Property[] properties,
        @PluginConfiguration final Configuration config,
        @PluginElement final Filter filter) {
    final List<AppenderRef> appenderRefs = Arrays.asList(refs);
    final Level actualLevel = level == null ? Level.ERROR : level;
    final boolean additive = Booleans.parseBoolean(additivity, true);
    return new AsyncLoggerConfig(LogManager.ROOT_LOGGER_NAME, appenderRefs, filter, actualLevel, additive,
            properties, config, AsyncLoggerConfig.includeLocation(includeLocation));
}
 
@Test
public void testPropertiesConfiguration() {
    final Configuration config = context.getConfiguration();
    assertNotNull("No configuration created", config);
    assertEquals("Incorrect State: " + config.getState(), config.getState(), LifeCycle.State.STARTED);
    final Map<String, Appender> appenders = config.getAppenders();
    assertNotNull(appenders);
    assertTrue("Incorrect number of Appenders: " + appenders.size(), appenders.size() == 1);
    final Map<String, LoggerConfig> loggers = config.getLoggers();
    assertNotNull(loggers);
    assertTrue("Incorrect number of LoggerConfigs: " + loggers.size(), loggers.size() == 2);
    final Filter filter = config.getFilter();
    assertNotNull("No Filter", filter);
    assertTrue("Not a Threshold Filter", filter instanceof ThresholdFilter);
    final Logger logger = LogManager.getLogger(getClass());
    logger.info("Welcome to Log4j!");
}
 
源代码10 项目: logging-log4j2   文件: ConfigurationBuilderTest.java
private void addTestFixtures(final String name, final ConfigurationBuilder<BuiltConfiguration> builder) {
    builder.setConfigurationName(name);
    builder.setStatusLevel(Level.ERROR);
    builder.setShutdownTimeout(5000, TimeUnit.MILLISECONDS);
    builder.add(builder.newScriptFile("target/test-classes/scripts/filter.groovy").addIsWatched(true));
    builder.add(builder.newFilter("ThresholdFilter", Filter.Result.ACCEPT, Filter.Result.NEUTRAL)
            .addAttribute("level", Level.DEBUG));

    final AppenderComponentBuilder appenderBuilder = builder.newAppender("Stdout", "CONSOLE").addAttribute("target", ConsoleAppender.Target.SYSTEM_OUT);
    appenderBuilder.add(builder.newLayout("PatternLayout").
            addAttribute("pattern", "%d [%t] %-5level: %msg%n%throwable"));
    appenderBuilder.add(builder.newFilter("MarkerFilter", Filter.Result.DENY,
            Filter.Result.NEUTRAL).addAttribute("marker", "FLOW"));
    builder.add(appenderBuilder);

    builder.add(builder.newLogger("org.apache.logging.log4j", Level.DEBUG, true).
                add(builder.newAppenderRef("Stdout")).
                addAttribute("additivity", false));
    builder.add(builder.newLogger("org.apache.logging.log4j.core").
                add(builder.newAppenderRef("Stdout")));
    builder.add(builder.newRootLogger(Level.ERROR).add(builder.newAppenderRef("Stdout")));

    builder.addProperty("MyKey", "MyValue");
    builder.add(builder.newCustomLevel("Panic", 17));
    builder.setPackages("foo,bar");
}
 
源代码11 项目: logging-log4j2   文件: LevelRangeFilterTest.java
@Test
public void testLevels() {
    final LevelRangeFilter filter = LevelRangeFilter.createFilter(Level.ERROR, Level.INFO, null, null);
    filter.start();
    assertTrue(filter.isStarted());
    assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null));
    assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.ERROR, null, (Object) null, (Throwable) null));
    LogEvent event = Log4jLogEvent.newBuilder() //
            .setLevel(Level.DEBUG) //
            .setMessage(new SimpleMessage("Test")) //
            .build();
    assertSame(Filter.Result.DENY, filter.filter(event));
    event = Log4jLogEvent.newBuilder() //
            .setLevel(Level.ERROR) //
            .setMessage(new SimpleMessage("Test")) //
            .build();
    assertSame(Filter.Result.NEUTRAL, filter.filter(event));
}
 
源代码12 项目: logging-log4j2   文件: RollingFilePropertiesTest.java
@Test
public void testPropertiesConfiguration() {
    final Configuration config = context.getConfiguration();
    assertNotNull("No configuration created", config);
    assertEquals("Incorrect State: " + config.getState(), config.getState(), LifeCycle.State.STARTED);
    final Map<String, Appender> appenders = config.getAppenders();
    assertNotNull(appenders);
    assertTrue("Incorrect number of Appenders: " + appenders.size(), appenders.size() == 3);
    final Map<String, LoggerConfig> loggers = config.getLoggers();
    assertNotNull(loggers);
    assertTrue("Incorrect number of LoggerConfigs: " + loggers.size(), loggers.size() == 2);
    final Filter filter = config.getFilter();
    assertNotNull("No Filter", filter);
    assertTrue("Not a Threshold Filter", filter instanceof ThresholdFilter);
    final Logger logger = LogManager.getLogger(getClass());
    logger.info("Welcome to Log4j!");
}
 
源代码13 项目: logging-log4j2   文件: XIncludeTest.java
@Test
public void testLogger() throws Exception {
    final Logger logger = this.ctx.getLogger(LOGGER_NAME);
    assertThat(logger, is(instanceOf(org.apache.logging.log4j.core.Logger.class)));
    final org.apache.logging.log4j.core.Logger l = (org.apache.logging.log4j.core.Logger) logger;
    assertThat(l.getLevel(), is(equalTo(Level.DEBUG)));
    assertThat(l.filterCount(), is(equalTo(1)));
    final Iterator<Filter> iterator = l.getFilters();
    assertThat(iterator.hasNext(), is(true));
    final Filter filter = iterator.next();
    assertThat(filter, is(instanceOf(ThreadContextMapFilter.class)));
    final Map<String, Appender> appenders = l.getAppenders();
    assertThat(appenders, is(notNullValue()));
    assertThat(appenders, hasSize(1));
    final Appender appender = appenders.get(APPENDER_NAME);
    assertThat(appender, is(notNullValue()));
    assertThat(appender.getName(), is(equalTo("STDOUT")));
}
 
源代码14 项目: logging-log4j2   文件: LoggerConfig.java
@PluginFactory
public static LoggerConfig createLogger(
        // @formatter:off
        @PluginAttribute final String additivity,
        @PluginAttribute final Level level,
        @PluginAttribute final String includeLocation,
        @PluginElement final AppenderRef[] refs,
        @PluginElement final Property[] properties,
        @PluginConfiguration final Configuration config,
        @PluginElement final Filter filter) {
        // @formatter:on
    final List<AppenderRef> appenderRefs = Arrays.asList(refs);
    final Level actualLevel = level == null ? Level.ERROR : level;
    final boolean additive = Booleans.parseBoolean(additivity, true);

    return new LoggerConfig(LogManager.ROOT_LOGGER_NAME, appenderRefs, filter, actualLevel, additive,
            properties, config, includeLocation(includeLocation, config));
}
 
源代码15 项目: logging-log4j2   文件: AppenderAdapter.java
/**
 * Constructor.
 */
public AppenderAdapter(Appender appender) {
    this.appender = appender;
    org.apache.logging.log4j.core.Filter appenderFilter = null;
    if (appender.getFilter() != null) {
        if (appender.getFilter().getNext() != null) {
            org.apache.log4j.spi.Filter filter = appender.getFilter();
            List<org.apache.logging.log4j.core.Filter> filters = new ArrayList<>();
            while (filter != null) {
                filters.add(new FilterAdapter(filter));
                filter = filter.getNext();
            }
            appenderFilter = CompositeFilter.createFilters(filters.toArray(new Filter[0]));
        } else {
            appenderFilter = new FilterAdapter(appender.getFilter());
        }
    }
    this.adapter = new Adapter(appender.getName(), appenderFilter, null, true, null);
}
 
源代码16 项目: logging-log4j2   文件: TimeFilterTest.java
@Test
public void overnight() {
    final TimeFilter filter = new TimeFilter(LocalTime.of(23,0), LocalTime.of(1,0),
            ZoneId.of("America/Los_Angeles"), null, null, LocalDate.of(2020, 3, 10));
    filter.start();
    assertTrue(filter.isStarted());
    ZonedDateTime date = ZonedDateTime.of(2020, 3, 10, 23, 30, 30, 0, ZoneId.of("America/Los_Angeles")).withEarlierOffsetAtOverlap();
    CLOCKTIME = date.toInstant().toEpochMilli();
    LogEvent event = Log4jLogEvent.newBuilder().setTimeMillis(CLOCKTIME).build();
    assertSame("Time " + CLOCKTIME + " is not within range: " + filter.toString(), Filter.Result.NEUTRAL, filter.filter(event));
    date = date.plusHours(1);
    CLOCKTIME = date.toInstant().toEpochMilli();
    event = Log4jLogEvent.newBuilder().setTimeMillis(CLOCKTIME).build();
    assertSame("Time " + CLOCKTIME + " is not within range: " + filter.toString(), Filter.Result.NEUTRAL, filter.filter(event));
    date = date.plusHours(1);
    CLOCKTIME = date.toInstant().toEpochMilli();
    event = Log4jLogEvent.newBuilder().setTimeMillis(CLOCKTIME).build();
    assertSame("Time " + CLOCKTIME + " is within range: " + filter.toString(), Filter.Result.DENY, filter.filter(event));
    date = date.plusDays(1).withHour(0);
    CLOCKTIME = date.toInstant().toEpochMilli();
    event = Log4jLogEvent.newBuilder().setTimeMillis(CLOCKTIME).build();
    assertSame("Time " + CLOCKTIME + " is not within range: " + filter.toString(), Filter.Result.NEUTRAL, filter.filter(event));
}
 
源代码17 项目: Flashtool   文件: TextAreaAppender.java
/**
 * Factory method. Log4j will parse the configuration and call this factory 
 * method to construct the appender with
 * the configured attributes.
 *
 * @param name   Name of appender
 * @param layout Log layout of appender
 * @param filter Filter for appender
 * @return The TextAreaAppender
 */
@PluginFactory
public static TextAreaAppender createAppender(
    @PluginAttribute("name") String name,
    @PluginElement("Layout") Layout<? extends Serializable> layout,
    @PluginElement("Filter") final Filter filter) {
  if (name == null) {
    LOGGER.error("No name provided for TextAreaAppender2");
    return null;
  }
  if (layout == null) {
    layout = PatternLayout.createDefaultLayout();
  }
  return new TextAreaAppender(name, filter, layout, true);
}
 
源代码18 项目: molicode   文件: FrontConsoleAppender.java
@PluginFactory
public static FrontConsoleAppender createAppender(@PluginAttribute("name") String name,
                                                  @PluginAttribute("fileName") String fileName,
                                                  @PluginElement("Filter") final Filter filter,
                                                  @PluginElement("Layout") Layout<? extends Serializable> layout,
                                                  @PluginAttribute("ignoreExceptions") boolean ignoreExceptions) {
    if (name == null) {
        LOGGER.error("no name defined in conf.");
        return null;
    }
    if (layout == null) {
        layout = PatternLayout.createDefaultLayout();
    }
    return new FrontConsoleAppender(name, filter, layout, ignoreExceptions, fileName);
}
 
源代码19 项目: spectator   文件: SpectatorAppender.java
/** Create a new instance of the appender. */
SpectatorAppender(
    Registry registry,
    String name,
    Filter filter,
    Layout<? extends Serializable> layout,
    boolean ignoreExceptions,
    Property[] properties) {
  super(name, filter, layout, ignoreExceptions, properties);
  this.registry = registry;
}
 
源代码20 项目: logging-log4j2   文件: AbstractFilterable.java
/**
 * Adds a filter.
 * @param filter The Filter to add.
 */
@Override
public synchronized void addFilter(final Filter filter) {
    if (filter == null) {
        return;
    }
    if (this.filter == null) {
        this.filter = filter;
    } else if (this.filter instanceof CompositeFilter) {
        this.filter = ((CompositeFilter) this.filter).addFilter(filter);
    } else {
        final Filter[] filters = new Filter[] {this.filter, filter};
        this.filter = CompositeFilter.createFilters(filters);
    }
}
 
源代码21 项目: logging-log4j2   文件: BlockingAppender.java
@PluginFactory
public static BlockingAppender createAppender(
        @PluginAttribute
        @Required(message = "No name provided for HangingAppender")
        final String name,
        @PluginElement final Layout<? extends Serializable> layout,
        @PluginElement final Filter filter) {
    return new BlockingAppender(name);
}
 
源代码22 项目: logging-log4j2   文件: ServletAppender.java
private ServletAppender(final String name, final Layout<? extends Serializable> layout, final Filter filter,
        final ServletContext servletContext, final boolean ignoreExceptions, final boolean logThrowables,
        Property[] properties) {
    super(name, filter, layout, ignoreExceptions, properties);
    this.servletContext = servletContext;
    this.logThrowables = logThrowables;
}
 
源代码23 项目: logging-log4j2   文件: CompositeFilter.java
@Override
public boolean stop(final long timeout, final TimeUnit timeUnit) {
    this.setStopping();
    for (final Filter filter : filters) {
        ((LifeCycle) filter).stop(timeout, timeUnit);
    }
    setStopped();
    return true;
}
 
源代码24 项目: collect-earth   文件: JSwingAppender.java
@PluginFactory
public static JSwingAppender createAppender(@PluginAttribute("name") String name,
		@PluginElement("Layout") Layout<?> layout, @PluginElement("Filters") Filter filter,
		@PluginAttribute("ignoreExceptions") boolean ignoreExceptions) {

	if (name == null) {
		LoggerFactory.getLogger( JSwingAppender.class ).error("No name provided for JTextAreaAppender");
		return null;
	}

	if (layout == null) {
		layout = PatternLayout.createDefaultLayout();
	}
	return new JSwingAppender(name, filter, layout, ignoreExceptions);
}
 
源代码25 项目: logging-log4j2   文件: RegexFilterTest.java
@Test
public void testDotAllPattern() throws Exception {
    final String singleLine = "test single line matches";
    final String multiLine = "test multi line matches\nsome more lines";
    final RegexFilter filter = RegexFilter.createFilter(".*line.*", new String[] { "DOTALL", "COMMENTS" }, false,
            Filter.Result.DENY, Filter.Result.ACCEPT);
    final Result singleLineResult = filter.filter(null, null, null, (Object) singleLine, (Throwable) null);
    final Result multiLineResult = filter.filter(null, null, null, (Object) multiLine, (Throwable) null);
    assertThat(singleLineResult, equalTo(Result.DENY));
    assertThat(multiLineResult, equalTo(Result.DENY));
}
 
源代码26 项目: logging-log4j2   文件: StructuredDataFilterTest.java
@Test
public void testConfig() {
    final Configuration config = context.getConfiguration();
    final Filter filter = config.getFilter();
    assertNotNull("No StructuredDataFilter", filter);
    assertTrue("Not a StructuredDataFilter", filter instanceof  StructuredDataFilter);
    final StructuredDataFilter sdFilter = (StructuredDataFilter) filter;
    assertFalse("Should not be And filter", sdFilter.isAnd());
    final IndexedReadOnlyStringMap map = sdFilter.getStringMap();
    assertNotNull("No Map", map);
    assertFalse("No elements in Map", map.isEmpty());
    assertEquals("Incorrect number of elements in Map", 1, map.size());
    assertTrue("Map does not contain key eventId", map.containsKey("eventId"));
    assertEquals("List does not contain 2 elements", 2, map.<Collection<?>>getValue("eventId").size());
}
 
源代码27 项目: logging-log4j2   文件: TestConfigurator.java
@Test
public void testBadFilterParam() throws Exception {
    ctx = Configurator.initialize("Test1", "bad/log4j-badfilterparam.xml");
    LogManager.getLogger("org.apache.test.TestConfigurator");
    final Configuration config = ctx.getConfiguration();
    assertNotNull("No configuration", config);
    assertEquals("Unexpected Configuration", "XMLConfigTest", config.getName());
    final LoggerConfig lcfg = config.getLoggerConfig("org.apache.logging.log4j.test1");
    assertNotNull("No Logger", lcfg);
    final Filter filter = lcfg.getFilter();
    assertNull("Unexpected Filter", filter);
}
 
源代码28 项目: logging-log4j2   文件: UsesLoggingAppender.java
@PluginFactory
public static UsesLoggingAppender createAppender(
    @PluginAttribute @Required(message = "A name for the Appender must be specified") final String name,
    @PluginAttribute("ignoreExceptions") final boolean ignore,
    @PluginElement final Layout<?> layout,
    @PluginElement final Filter filter) {
    return new UsesLoggingAppender(name, filter, layout, ignore);
}
 
源代码29 项目: Flashtool   文件: StringBuilderAppender.java
/**
 * Factory method. Log4j will parse the configuration and call this factory 
 * method to construct the appender with
 * the configured attributes.
 *
 * @param name   Name of appender
 * @param layout Log layout of appender
 * @param filter Filter for appender
 * @return The TextAreaAppender
 */
@PluginFactory
public static StringBuilderAppender createAppender(
    @PluginAttribute("name") String name,
    @PluginElement("Layout") Layout<? extends Serializable> layout,
    @PluginElement("Filter") final Filter filter) {
  if (name == null) {
    LOGGER.error("No name provided for TextAreaAppender2");
    return null;
  }
  if (layout == null) {
    layout = PatternLayout.createDefaultLayout();
  }
  return new StringBuilderAppender(name, filter, layout, true);
}
 
源代码30 项目: logging-log4j2   文件: AbstractFilterableTest.java
@Test
public void testRemoveCompositeFilterFromCompositeFilter() {
    final Filter filter1 = ThresholdFilter.createFilter(Level.ERROR, null, null);
    final Filter filter2 = ThresholdFilter.createFilter(Level.ERROR, null, null);
    final Filter compositeFilter = CompositeFilter.createFilters(new Filter[]{filter1, filter2});

    filterable.addFilter(compositeFilter);
    filterable.removeFilter(compositeFilter);
    assertNull(filterable.getFilter());
}
 
 类所在包
 类方法
 同包方法