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

org.junitpioneer.jupiter.WritesStdIo Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
/*
 * Copyright 2016-2022 the original author or authors.
 *
 * All rights reserved. This program and the accompanying materials are
 * made available under the terms of the Eclipse Public License v2.0 which
 * accompanies this distribution and is available at
 *
 * http://www.eclipse.org/legal/epl-v20.html
 */

package org.junitpioneer.jupiter;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.junit.jupiter.api.parallel.ResourceAccessMode;
import org.junit.jupiter.api.parallel.ResourceLock;
import org.junit.jupiter.api.parallel.Resources;

/**
 * Marks tests that call {@code System.setIn()}, {@code System.setOut()} or {@code System.setErr()} to
 * set the static fields {@code System.in}/{@code System.out}/{@code System.err}.
 *
 * 

During * parallel test execution, * all tests annotated with {@link StdIo}, {@link WritesStdIo}, and {@link WritesStdIo} * are scheduled in a way that guarantees correctness under mutation of shared global state. *

* *

For more details and examples, see * the documentation on Standard input/output. *

* * @since 0.9 */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.PACKAGE, ElementType.TYPE }) @Inherited @ResourceLock(value = "java.lang.System.in", mode = ResourceAccessMode.READ_WRITE) @ResourceLock(value = Resources.SYSTEM_OUT, mode = ResourceAccessMode.READ_WRITE) @ResourceLock(value = Resources.SYSTEM_ERR, mode = ResourceAccessMode.READ_WRITE) public @interface WritesStdIo { }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy