Example usage for org.apache.commons.lang.reflect FieldUtils writeStaticField

List of usage examples for org.apache.commons.lang.reflect FieldUtils writeStaticField

Introduction

In this page you can find the example usage for org.apache.commons.lang.reflect FieldUtils writeStaticField.

Prototype

public static void writeStaticField(Class cls, String fieldName, Object value, boolean forceAccess)
        throws IllegalAccessException 

Source Link

Document

Write a named static Field.

Usage

From source file:com.kixeye.chassis.bootstrap.TestUtils.java

public static void resetArchaius() throws Exception {
    //super hacky and brittle, but archaius provides no way to reset its configuration
    FieldUtils.writeStaticField(ConfigurationManager.class, "customConfigurationInstalled", false, true);
    FieldUtils.writeStaticField(DynamicPropertyFactory.class, "initializedWithDefaultConfig", false, true);
    FieldUtils.writeStaticField(ConfigurationManager.class, "instance", null, true);
    FieldUtils.writeStaticField(DynamicPropertyFactory.class, "config", null, true);
}