Search in sources :

Example 1 with CharacterFilter

use of org.apache.flink.metrics.CharacterFilter in project flink by apache.

the class AbstractMetricGroupTest method testGetAllVariables.

/**
	 * Verifies that no {@link NullPointerException} is thrown when {@link AbstractMetricGroup#getAllVariables()} is
	 * called and the parent is null.
	 */
@Test
public void testGetAllVariables() {
    MetricRegistry registry = new MetricRegistry(MetricRegistryConfiguration.defaultMetricRegistryConfiguration());
    AbstractMetricGroup group = new AbstractMetricGroup<AbstractMetricGroup<?>>(registry, new String[0], null) {

        @Override
        protected QueryScopeInfo createQueryServiceMetricInfo(CharacterFilter filter) {
            return null;
        }

        @Override
        protected String getGroupName(CharacterFilter filter) {
            return "";
        }
    };
    assertTrue(group.getAllVariables().isEmpty());
    registry.shutdown();
}
Also used : CharacterFilter(org.apache.flink.metrics.CharacterFilter) MetricRegistry(org.apache.flink.runtime.metrics.MetricRegistry) Test(org.junit.Test)

Aggregations

CharacterFilter (org.apache.flink.metrics.CharacterFilter)1 MetricRegistry (org.apache.flink.runtime.metrics.MetricRegistry)1 Test (org.junit.Test)1