Top Description Fields Constructors Methods
org.junit.jupiter.api.condition

public final Enum OS

extends Enum<OS>
Class Inheritance
Annotations
@API
status:STABLE
since:5.1
Static Imports
org.apiguardian.api.API.Status.STABLE

Enumeration of common operating systems used for testing Java applications.

If the current operating system cannot be detected — for example, if the os.name JVM system property is undefined — then none of the constants defined in this enum will be considered to be the current operating system.

Since
5.1
See Also
AIX, FREEBSD, LINUX, MAC, OPENBSD, SOLARIS, WINDOWS, OTHER, EnabledOnOs, DisabledOnOs

Field Summary

Modifier and TypeField and Description
public static final OS
AIX

IBM AIX operating system.

private static final @Nullable OS
public static final OS
FREEBSD

FreeBSD operating system.

public static final OS
LINUX

Linux-based operating system.

private static final Logger
public static final OS
MAC

Apple Macintosh operating system (e.g., macOS).

public static final OS
OPENBSD

OpenBSD operating system.

public static final OS
OTHER

An operating system other than AIX, FREEBSD, LINUX, MAC, OPENBSD, SOLARIS, or WINDOWS.

public static final OS
SOLARIS

Oracle Solaris operating system.

public static final OS
WINDOWS

Microsoft Windows operating system.

Constructor Summary

AccessConstructor and Description
private
OS()

Method Summary

Modifier and TypeMethod and Description
public static @Nullable OS

Returns:

the current operating system, if known; otherwise, null
current
()

Returns the current operating system, if known; otherwise, null.

private static @Nullable OS
public boolean

Returns:

true if this OS is known to be the operating system on which the current JVM is executing
isCurrentOs
()

Returns true if this OS is known to be the operating system on which the current JVM is executing.

pack-priv static @Nullable OS
parse(String osName)

public static OS
public static OS[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

AIXback to summary
public static final OS AIX

IBM AIX operating system.

Annotations
@API
status:STABLE
since:5.3
Since
5.3
CURRENT_OSback to summary
private static final @Nullable OS CURRENT_OS
FREEBSDback to summary
public static final OS FREEBSD

FreeBSD operating system.

Annotations
@API
status:STABLE
since:5.9
Since
5.9
LINUXback to summary
public static final OS LINUX

Linux-based operating system.

loggerback to summary
private static final Logger logger
MACback to summary
public static final OS MAC

Apple Macintosh operating system (e.g., macOS).

OPENBSDback to summary
public static final OS OPENBSD

OpenBSD operating system.

Annotations
@API
status:STABLE
since:5.9
Since
5.9
OTHERback to summary
public static final OS OTHER

An operating system other than AIX, FREEBSD, LINUX, MAC, OPENBSD, SOLARIS, or WINDOWS.

SOLARISback to summary
public static final OS SOLARIS

Oracle Solaris operating system.

WINDOWSback to summary
public static final OS WINDOWS

Microsoft Windows operating system.

Constructor Detail

OSback to summary
private OS()

Method Detail

currentback to summary
public static @Nullable OS current()

Returns the current operating system, if known; otherwise, null.

Returns:@Nullable OS

the current operating system, if known; otherwise, null

Annotations
@API
status:STABLE
since:5.10
Since
5.9
determineCurrentOsback to summary
private static @Nullable OS determineCurrentOs()
isCurrentOsback to summary
public boolean isCurrentOs()

Returns true if this OS is known to be the operating system on which the current JVM is executing.

Returns:boolean

true if this OS is known to be the operating system on which the current JVM is executing

parseback to summary
pack-priv static @Nullable OS parse(String osName)
valueOfback to summary
public static OS valueOf(String name)
valuesback to summary
public static OS[] values()