public interface

IMonitorFactory

 androidx.test.jank.IMonitorFactory

Subclasses:

JankMonitorFactory

Gradle dependencies

compile group: 'androidx.test.janktesthelper', name: 'janktesthelper', version: '1.0.1'

  • groupId: androidx.test.janktesthelper
  • artifactId: janktesthelper
  • version: 1.0.1

Artifact androidx.test.janktesthelper:janktesthelper:1.0.1 it located at Google repository (https://maven.google.com/)

Overview

An interface used to define a class that constructs IMonitors for test methods. Implementing classes must have a public constructor that takes an instance as the sole argument.

Summary

Methods
public java.util.List<IMonitor>getMonitors(java.lang.reflect.Method method, java.lang.Object test)

Returns a list of IMonitors that should be used to monitor the given test method.

Methods

public java.util.List<IMonitor> getMonitors(java.lang.reflect.Method method, java.lang.Object test)

Returns a list of IMonitors that should be used to monitor the given test method.

Parameters:

method: The test method to monitor.
test: An instance of the class to which method belongs.

Returns:

A list of IMonitors that should be used to monitor the given test method.

Source

/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.test.jank;

import androidx.test.annotation.Beta;

import java.lang.reflect.Method;
import java.util.List;

/**
 * An interface used to define a class that constructs {@link IMonitor}s for test methods.
 * Implementing classes must have a public constructor that takes an {@link Instrumentation}
 * instance as the sole argument.
 */
@Beta
public interface IMonitorFactory {

    /**
     * Returns a list of {@link IMonitor}s that should be used to monitor the given test method.
     *
     * @param method The test method to monitor.
     * @param test An instance of the class to which {@code method} belongs.
     * @return A list of {@link IMonitor}s that should be used to monitor the given test method.
     */
    public List<IMonitor> getMonitors(Method method, Object test);
}