Skip to content

Package: MultiTry

MultiTry

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2019 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Lucas Koehler - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.test.common;
15:
16: import static java.lang.annotation.ElementType.METHOD;
17: import static java.lang.annotation.RetentionPolicy.RUNTIME;
18:
19: import java.lang.annotation.Retention;
20: import java.lang.annotation.Target;
21:
22: /**
23: * Annotation used in conjunction with {@link MultiTryTestRule}. If a {@link MultiTryTestRule} is configured to not
24: * apply to all tests of a test class, only tests annotated with this annotation allow multiple tries. Furthermore, this
25: * annotation allows to increase the number of max tries. The number of max tries is the maximum of the rule's number
26: * and the annotation's number.
27: *
28: * @author Lucas Koehler
29: */
30: @Retention(RUNTIME)
31: @Target(METHOD)
32: public @interface MultiTry {
33:         /**
34:          * The maximum tries. The effective number of maximum tries is the <strong>maximum</strong> of this value and the
35:          * number configured in a {@link MultiTryTestRule} instance.
36:          *
37:          * @return The maximum number of retries
38:          */
39:         int maxTries() default 1;
40: }