public abstract class FaultInjection extends Object
Concrete classes should be available only during testing, not in production.
To activate fault injection the FAULT_INJECTION
system property must be set to true.
When fault injection is activated, the concrete class (specified by name) will be call for activation.
Concrete classes should be activated by presense of a second system property.
This fault injection pattern provides 3 levels of safeguard: a general 'fault injection' system property, the availabity of of the concrete 'fault injection' class in the classpath, a specifi 'fault injection' system property.
Refer to the SkipCommitFaultInjection
class in the test classes for an example.
Modifier and Type | Field and Description |
---|---|
static String |
FAULT_INJECTION |
Constructor and Description |
---|
FaultInjection() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
activate() |
static boolean |
activate(String className) |
abstract void |
deactivate() |
static void |
deactivate(String className) |
abstract boolean |
isActive() |
static boolean |
isActive(String className) |
public static final String FAULT_INJECTION
public FaultInjection()
public static void deactivate(String className)
public abstract boolean activate()
public abstract void deactivate()
public abstract boolean isActive()
Copyright © 2018 Apache Software Foundation. All rights reserved.