All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cognifide.qa.bb.wait.Timings Maven / Gradle / Ivy

The newest version!
/*-
 * #%L
 * Bobcat
 * %%
 * Copyright (C) 2018 Cognifide Ltd.
 * %%
 * 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.
 * #L%
 */
package com.cognifide.qa.bb.wait;

import com.cognifide.qa.bb.constants.Timeouts;

/**
 * A value object defining the set of timings used in {@link BobcatWait}.
 * Use {@link TimingsBuilder} to create instances of this class.
 * 

* Contains info about: *

    *
  • explicit timeout (in seconds)
  • *
  • implicit timeout (in seconds)
  • *
  • polling interval (in milliseconds)
  • *
*/ public class Timings { public static final int NEAR_ZERO = 1; public static final int DEFAULT_POLLING_INTERVAL = 500; public static final int DEFAULT_EXPLICIT_TIMEOUT = 10; public static final int DEFAULT_IMPLICIT_TIMEOUT = 1; private long explicitTimeout; private long pollingInterval; private long implicitTimeout; public Timings(long explicitTimeout, long pollingInterval, long implicitTimeout) { this.explicitTimeout = explicitTimeout; this.pollingInterval = pollingInterval; this.implicitTimeout = implicitTimeout; } public long getExplicitTimeout() { return explicitTimeout; } public long getPollingInterval() { return pollingInterval; } public long getImplicitTimeout() { return implicitTimeout; } /** * A {@link Timings} instance with explicit timeout set to {@value Timeouts#SMALL} */ public static final Timings SHORT_EXPLICIT = new TimingsBuilder().explicitTimeout(Timeouts.SMALL).build(); /** * A {@link Timings} instance with explicit timeout set to {@value Timeouts#MEDIUM} */ public static final Timings MEDIUM_EXPLICIT = new TimingsBuilder().explicitTimeout(Timeouts.MEDIUM).build(); /** * A {@link Timings} instance with explicit timeout set to {@value Timeouts#BIG} */ public static final Timings LONG_EXPLICIT = new TimingsBuilder().explicitTimeout(Timeouts.BIG).build(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy