A B C D E F G I L M N O P R S T V 

A

add(String) - Method in class org.junit.contrib.java.lang.system.internal.RestoreSpecificSystemProperties
 
add(String) - Method in class org.junit.contrib.java.lang.system.RestoreSystemProperties
Deprecated.
Simply remove all calls to this method. RestoreSystemProperties restores all properties automatically. That's why you don't have to add the properties anymore.
after() - Method in class org.junit.contrib.java.lang.system.ClearSystemProperties
 
after() - Method in class org.junit.contrib.java.lang.system.ProvideSecurityManager
 
after() - Method in class org.junit.contrib.java.lang.system.ProvideSystemProperty
 
after() - Method in class org.junit.contrib.java.lang.system.RestoreSystemProperties
 
after() - Method in class org.junit.contrib.java.lang.system.TextFromStandardInputStream
 
and(String, String) - Method in class org.junit.contrib.java.lang.system.ProvideSystemProperty
 
apply(Statement, Description) - Method in class org.junit.contrib.java.lang.system.DisallowWriteToSystemErr
 
apply(Statement, Description) - Method in class org.junit.contrib.java.lang.system.DisallowWriteToSystemOut
 
apply(Statement, Description) - Method in class org.junit.contrib.java.lang.system.EnvironmentVariables
 
apply(Statement, Description) - Method in class org.junit.contrib.java.lang.system.ExpectedSystemExit
 
apply(Statement, Description) - Method in class org.junit.contrib.java.lang.system.StandardErrorStreamLog
Deprecated.
 
apply(Statement, Description) - Method in class org.junit.contrib.java.lang.system.StandardOutputStreamLog
Deprecated.
 
apply(Statement, Description) - Method in class org.junit.contrib.java.lang.system.SystemErrRule
 
apply(Statement, Description) - Method in class org.junit.contrib.java.lang.system.SystemOutRule
 
Assertion - Interface in org.junit.contrib.java.lang.system
An Assertion encapsulates the code of an assertion into an object.

B

before() - Method in class org.junit.contrib.java.lang.system.ClearSystemProperties
 
before() - Method in class org.junit.contrib.java.lang.system.ProvideSecurityManager
 
before() - Method in class org.junit.contrib.java.lang.system.ProvideSystemProperty
 
before() - Method in class org.junit.contrib.java.lang.system.RestoreSystemProperties
 
before() - Method in class org.junit.contrib.java.lang.system.TextFromStandardInputStream
 

C

checkAccept(String, int) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkAccess(Thread) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkAccess(ThreadGroup) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkAssertion() - Method in interface org.junit.contrib.java.lang.system.Assertion
 
checkAssertionAfterwards(Assertion) - Method in class org.junit.contrib.java.lang.system.ExpectedSystemExit
 
checkAwtEventQueueAccess() - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkConnect(String, int) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkConnect(String, int, Object) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkCreateClassLoader() - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkDelete(String) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkExec(String) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkExit(int) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
CheckExitCalled - Exception in org.junit.contrib.java.lang.system.internal
 
CheckExitCalled(int) - Constructor for exception org.junit.contrib.java.lang.system.internal.CheckExitCalled
 
checkLink(String) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkListen(int) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkMemberAccess(Class<?>, int) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkMulticast(InetAddress) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkMulticast(InetAddress, byte) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkPackageAccess(String) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkPackageDefinition(String) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkPermission(Permission) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkPermission(Permission, Object) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkPrintJobAccess() - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkPropertiesAccess() - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkPropertyAccess(String) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkRead(FileDescriptor) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkRead(String) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkRead(String, Object) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkSecurityAccess(String) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkSetFactory() - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkSystemClipboardAccess() - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkTopLevelWindow(Object) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkWrite(FileDescriptor) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
checkWrite(String) - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
clear() - Method in class org.junit.contrib.java.lang.system.StandardErrorStreamLog
Deprecated.
Please use SystemErrRule.clearLog().

Clears the log. The log can be used again.

clear() - Method in class org.junit.contrib.java.lang.system.StandardOutputStreamLog
Deprecated.
Please use SystemOutRule.clearLog().

Clears the log. The log can be used again.

clear(String...) - Method in class org.junit.contrib.java.lang.system.EnvironmentVariables
Delete multiple environment variables.
clearLog() - Method in class org.junit.contrib.java.lang.system.internal.LogPrintStream
 
clearLog() - Method in class org.junit.contrib.java.lang.system.SystemErrRule
Clears the current log.
clearLog() - Method in class org.junit.contrib.java.lang.system.SystemOutRule
Clears the current log.
clearProperty(String) - Method in class org.junit.contrib.java.lang.system.ClearSystemProperties
Deprecated.
Please use RestoreSystemProperties along with System.clearProperty(String).
ClearSystemProperties - Class in org.junit.contrib.java.lang.system
The ClearSystemProperties rule clears a set of system properties when the test starts and restores their original values when the test finishes (whether it passes or fails).
ClearSystemProperties(String...) - Constructor for class org.junit.contrib.java.lang.system.ClearSystemProperties
Creates a ClearSystemProperties rule that clears the specified properties and restores their original values when the test finishes (whether it passes or fails).
createStatement(Statement) - Method in class org.junit.contrib.java.lang.system.internal.DisallowWrite
 
createStatement(Statement) - Method in class org.junit.contrib.java.lang.system.internal.LogPrintStream
 

D

DisallowWrite - Class in org.junit.contrib.java.lang.system.internal
 
DisallowWrite(PrintStreamHandler) - Constructor for class org.junit.contrib.java.lang.system.internal.DisallowWrite
 
DisallowWriteToSystemErr - Class in org.junit.contrib.java.lang.system
DisallowWriteToSystemErr lets a test fail if it tries to write something to System.err.
DisallowWriteToSystemErr() - Constructor for class org.junit.contrib.java.lang.system.DisallowWriteToSystemErr
 
DisallowWriteToSystemOut - Class in org.junit.contrib.java.lang.system
DisallowWriteToSystemOut lets a test fail if it tries to write something to System.out.
DisallowWriteToSystemOut() - Constructor for class org.junit.contrib.java.lang.system.DisallowWriteToSystemOut
 

E

emptyStandardInputStream() - Static method in class org.junit.contrib.java.lang.system.TextFromStandardInputStream
 
enableLog() - Method in class org.junit.contrib.java.lang.system.internal.LogPrintStream
 
enableLog() - Method in class org.junit.contrib.java.lang.system.SystemErrRule
Start logging of everything that is written to System.err.
enableLog() - Method in class org.junit.contrib.java.lang.system.SystemOutRule
Start logging of everything that is written to System.out.
EnvironmentVariables - Class in org.junit.contrib.java.lang.system
The EnvironmentVariables rule allows you to set environment variables for your test.
EnvironmentVariables() - Constructor for class org.junit.contrib.java.lang.system.EnvironmentVariables
 
ExpectedSystemExit - Class in org.junit.contrib.java.lang.system
The ExpectedSystemExit allows in-test specification of expected System.exit(...) calls.
expectSystemExit() - Method in class org.junit.contrib.java.lang.system.ExpectedSystemExit
 
expectSystemExitWithStatus(int) - Method in class org.junit.contrib.java.lang.system.ExpectedSystemExit
 

F

fromFile(String) - Static method in class org.junit.contrib.java.lang.system.ProvideSystemProperty
 
fromResource(String) - Static method in class org.junit.contrib.java.lang.system.ProvideSystemProperty
 

G

getInCheck() - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
getLog() - Method in class org.junit.contrib.java.lang.system.internal.LogPrintStream
 
getLog() - Method in class org.junit.contrib.java.lang.system.StandardErrorStreamLog
Deprecated.
Please use SystemErrRule.getLog().

Returns the text written to the standard error stream.

getLog() - Method in class org.junit.contrib.java.lang.system.StandardOutputStreamLog
Deprecated.
Please use SystemOutRule.getLog().

Returns the text written to the standard output stream.

getLog() - Method in class org.junit.contrib.java.lang.system.SystemErrRule
Returns the text that is written to System.err since SystemErrRule.enableLog() (respectively SystemErrRule.clearLog() has been called.
getLog() - Method in class org.junit.contrib.java.lang.system.SystemOutRule
Returns the text that is written to System.out since SystemOutRule.enableLog() (respectively SystemOutRule.clearLog() has been called.
getLogAsBytes() - Method in class org.junit.contrib.java.lang.system.internal.LogPrintStream
 
getLogAsBytes() - Method in class org.junit.contrib.java.lang.system.SystemErrRule
Returns the raw bytes that are written to System.err since SystemErrRule.enableLog() (respectively SystemErrRule.clearLog() has been called.
getLogAsBytes() - Method in class org.junit.contrib.java.lang.system.SystemOutRule
Returns the raw bytes that are written to System.out since SystemOutRule.enableLog() (respectively SystemOutRule.clearLog() has been called.
getLogWithNormalizedLineSeparator() - Method in class org.junit.contrib.java.lang.system.internal.LogPrintStream
 
getLogWithNormalizedLineSeparator() - Method in class org.junit.contrib.java.lang.system.SystemErrRule
Returns the text that is written to System.err since SystemErrRule.enableLog() (respectively SystemErrRule.clearLog() has been called.
getLogWithNormalizedLineSeparator() - Method in class org.junit.contrib.java.lang.system.SystemOutRule
Returns the text that is written to System.out since SystemOutRule.enableLog() (respectively SystemOutRule.clearLog() has been called.
getSecurityContext() - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
getStatus() - Method in exception org.junit.contrib.java.lang.system.internal.CheckExitCalled
 
getStatusOfFirstCheckExitCall() - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
getThreadGroup() - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 

I

isCheckExitCalled() - Method in class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 

L

LOG_AND_WRITE_TO_STREAM - org.junit.contrib.java.lang.system.LogMode
Deprecated.
Please use SystemErrRule.enableLog() or SystemOutRule.enableLog().

Record the writes while they are still written to the stream.

LOG_ONLY - org.junit.contrib.java.lang.system.LogMode
Deprecated.
Please use SystemErrRule.enableLog().mute() or SystemOutRule.enableLog().mute().

Capture the writes to the stream. Nothing is written to the stream itself.

LogMode - Enum in org.junit.contrib.java.lang.system
Deprecated.
This enum is no longer needed, because all rules that are using it have been replaced with rules that don't need the enum.

Mode of the StandardErrorStreamLog and the StandardOutputStreamLog.

LogPrintStream - Class in org.junit.contrib.java.lang.system.internal
 
LogPrintStream(PrintStreamHandler) - Constructor for class org.junit.contrib.java.lang.system.internal.LogPrintStream
 

M

mute() - Method in class org.junit.contrib.java.lang.system.internal.LogPrintStream
 
mute() - Method in class org.junit.contrib.java.lang.system.SystemErrRule
Suppress the output to System.err.
mute() - Method in class org.junit.contrib.java.lang.system.SystemOutRule
Suppress the output to System.out.
muteForSuccessfulTests() - Method in class org.junit.contrib.java.lang.system.internal.LogPrintStream
 
muteForSuccessfulTests() - Method in class org.junit.contrib.java.lang.system.SystemErrRule
Suppress the output to System.err for successful tests only.
muteForSuccessfulTests() - Method in class org.junit.contrib.java.lang.system.SystemOutRule
Suppress the output to System.out for successful tests only.

N

NoExitSecurityManager - Class in org.junit.contrib.java.lang.system.internal
A NoExitSecurityManager throws a CheckExitCalled exception whenever NoExitSecurityManager.checkExit(int) is called.
NoExitSecurityManager(SecurityManager) - Constructor for class org.junit.contrib.java.lang.system.internal.NoExitSecurityManager
 
none() - Static method in class org.junit.contrib.java.lang.system.ExpectedSystemExit
 

O

org.junit.contrib.java.lang.system - package org.junit.contrib.java.lang.system
 
org.junit.contrib.java.lang.system.internal - package org.junit.contrib.java.lang.system.internal
 

P

PrintStreamHandler - Enum in org.junit.contrib.java.lang.system.internal
 
provideLines(String...) - Method in class org.junit.contrib.java.lang.system.TextFromStandardInputStream
Set the lines that are returned by System.in.
ProvideSecurityManager - Class in org.junit.contrib.java.lang.system
The ProvideSecurityManager rule provides an arbitrary security manager to a test.
ProvideSecurityManager(SecurityManager) - Constructor for class org.junit.contrib.java.lang.system.ProvideSecurityManager
 
ProvideSystemProperty - Class in org.junit.contrib.java.lang.system
The ProvideSystemProperty rule provides an arbitrary value for a system property to a test.
ProvideSystemProperty() - Constructor for class org.junit.contrib.java.lang.system.ProvideSystemProperty
ProvideSystemProperty(String, String) - Constructor for class org.junit.contrib.java.lang.system.ProvideSystemProperty
 
provideText(String...) - Method in class org.junit.contrib.java.lang.system.TextFromStandardInputStream

R

restore() - Method in class org.junit.contrib.java.lang.system.internal.RestoreSpecificSystemProperties
 
RestoreSpecificSystemProperties - Class in org.junit.contrib.java.lang.system.internal
 
RestoreSpecificSystemProperties() - Constructor for class org.junit.contrib.java.lang.system.internal.RestoreSpecificSystemProperties
 
RestoreSystemProperties - Class in org.junit.contrib.java.lang.system
The RestoreSystemProperties rule undoes changes of system properties when the test finishes (whether it passes or fails).
RestoreSystemProperties() - Constructor for class org.junit.contrib.java.lang.system.RestoreSystemProperties
Creates a RestoreSystemProperties rule that restores all system properties.
RestoreSystemProperties(String...) - Constructor for class org.junit.contrib.java.lang.system.RestoreSystemProperties
Deprecated.
Please use RestoreSystemProperties(). The rule restores all properties. That's why you don't have to specify the properties anymore.

S

set(String, String) - Method in class org.junit.contrib.java.lang.system.EnvironmentVariables
Set the value of an environment variable.
setProperty(String, String) - Method in class org.junit.contrib.java.lang.system.ProvideSystemProperty
Deprecated.
Please use RestoreSystemProperties along with System.setProperty(String, String).
StandardErrorStreamLog - Class in org.junit.contrib.java.lang.system
Deprecated.
Please use SystemErrRule.

The StandardErrorStreamLog records writes to the standard error stream. The text written is available via StandardErrorStreamLog.getLog().

   public void MyTest {
     @Rule
     public final StandardErrorStreamLog log = new StandardErrorStreamLog();

     @Test
     public void captureErrorStream() {
       System.err.print("hello world");
       assertEquals("hello world", log.getLog());
     }
   }
 
You can clear the log if you only want to test parts of the text written to the standard error stream.
   @Test
   public void captureErrorStream() {
     System.err.print("before");
     log.clear();
     System.err.print("afterwards");
     assertEquals("afterwards", log.getLog());
   }
 

Prevent output to the standard error stream

In general it is not necessary that a test writes to the standard error stream. Avoiding this output may speed up the test and reduce the clutter on the commandline.

The test does not write to the stream if the rule is created with the LogMode.LOG_ONLY mode.

 @Rule
 public final StandardErrorStreamLog log = new StandardErrorStreamLog(LOG_ONLY);
StandardErrorStreamLog() - Constructor for class org.junit.contrib.java.lang.system.StandardErrorStreamLog
Deprecated.
Please use new SystemErrRule().enableLog().

Creates a rule that records writes while they are still written to the standard error stream.

StandardErrorStreamLog(LogMode) - Constructor for class org.junit.contrib.java.lang.system.StandardErrorStreamLog
Deprecated.
Please use new SystemErrRule().enableLog() instead of new StandardErrorStreamLog(LogMode.LOG_AND_WRITE_TO_STREAM) or new SystemErrRule().enableLog().mute() instead of new StandardErrorStreamLog(LogMode.LOG_ONLY).

Creates a rule that records writes to the standard error stream according to the specified LogMode.

StandardOutputStreamLog - Class in org.junit.contrib.java.lang.system
Deprecated.
Please use SystemOutRule.

The StandardOutputStreamLog records writes to the standard output stream. The text written is available via StandardOutputStreamLog.getLog().

   public void MyTest {
     @Rule
     public final StandardOutputStreamLog log = new StandardOutputStreamLog();

     @Test
     public void captureOutputStream() {
       System.out.print("hello world");
       assertEquals("hello world", log.getLog());
     }
   }
 
You can clear the log if you only want to test parts of the text written to the standard output stream.
   @Test
   public void captureOutputStream() {
     System.out.print("before");
     log.clear();
     System.out.print("afterwards");
     assertEquals("afterwards", log.getLog());
   }
 

Prevent output to the standard output stream

In general it is not necessary that a test writes to the standard output stream. Avoiding this output may speed up the test and reduce the clutter on the commandline.

The test does not write to the stream if the rule is created with the LogMode.LOG_ONLY mode.

 @Rule
 public final StandardOutputStreamLog log = new StandardOutputStreamLog(LOG_ONLY);
StandardOutputStreamLog() - Constructor for class org.junit.contrib.java.lang.system.StandardOutputStreamLog
Deprecated.
Please use new SystemOutRule().enableLog().

Creates a rule that records writes while they are still written to the standard output stream.

StandardOutputStreamLog(LogMode) - Constructor for class org.junit.contrib.java.lang.system.StandardOutputStreamLog
Deprecated.
Please use new SystemOutRule().enableLog() instead of new StandardOutputStreamLog(LogMode.LOG_AND_WRITE_TO_STREAM) or new SystemOutRule().enableLog().mute() instead of new StandardOutputStreamLog(LogMode.LOG_ONLY).

Creates a rule that records writes to the standard output stream according to the specified LogMode.

SYSTEM_ERR - org.junit.contrib.java.lang.system.internal.PrintStreamHandler
 
SYSTEM_OUT - org.junit.contrib.java.lang.system.internal.PrintStreamHandler
 
SystemErrRule - Class in org.junit.contrib.java.lang.system
The SystemErrRule intercepts the writes to System.err.
SystemErrRule() - Constructor for class org.junit.contrib.java.lang.system.SystemErrRule
 
SystemOutRule - Class in org.junit.contrib.java.lang.system
The SystemOutRule intercepts the writes to System.out.
SystemOutRule() - Constructor for class org.junit.contrib.java.lang.system.SystemOutRule
 

T

TextFromStandardInputStream - Class in org.junit.contrib.java.lang.system
The TextFromStandardInputStream rule replaces System.in with another InputStream, which provides an arbitrary text.
TextFromStandardInputStream(String) - Constructor for class org.junit.contrib.java.lang.system.TextFromStandardInputStream
throwExceptionOnInputEnd(IOException) - Method in class org.junit.contrib.java.lang.system.TextFromStandardInputStream
Specify an IOException that is thrown by System.in.
throwExceptionOnInputEnd(RuntimeException) - Method in class org.junit.contrib.java.lang.system.TextFromStandardInputStream
Specify a RuntimeException that is thrown by System.in.

V

valueOf(String) - Static method in enum org.junit.contrib.java.lang.system.internal.PrintStreamHandler
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum org.junit.contrib.java.lang.system.LogMode
Deprecated.
Returns the enum constant of this type with the specified name.
values() - Static method in enum org.junit.contrib.java.lang.system.internal.PrintStreamHandler
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum org.junit.contrib.java.lang.system.LogMode
Deprecated.
Returns an array containing the constants of this enum type, in the order they are declared.
A B C D E F G I L M N O P R S T V 
Skip navigation links

Copyright © 2011–2018. All rights reserved.