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

com.eclipsesource.restfuse.PollState Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
/*******************************************************************************
 * Copyright (c) 2011 EclipseSource and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Holger Staudacher - initial API and implementation
 ******************************************************************************/
package com.eclipsesource.restfuse;

import java.util.List;

import com.eclipsesource.restfuse.annotation.Context;
import com.eclipsesource.restfuse.annotation.Poll;


/**
 * 

A PollState acts as a consistent state during a poll series. The * PollState object will be injected into a test object when it has a field of the * type PollState which is annotated with the {@link Context} * annotation. After the injection it can be used to test the responses of the poll series.

* * @see Poll * @see Context */ public interface PollState { /** *

Returns the number of the last request attempt. It can be used to get the current response * when it will be passed to the {@link PollState#getResponse(int)} method.

*/ int getTimes(); /** *

Aborts a poll series. After this method was called JUnit will continue with the next test * method.

*/ void abort(); /** *

Returns all responses that were received during the poll series.

*/ List getResponses(); /** *

Returns a single response for a specific request attempt with a poll series.

*/ Response getResponse( int attempt ) throws IllegalArgumentException; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy