Java Code Examples for org.apache.commons.lang.reflect.FieldUtils#writeStaticField()
The following examples show how to use
org.apache.commons.lang.reflect.FieldUtils#writeStaticField() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SFTPPutDialogTest.java From hop with Apache License 2.0 | 6 votes |
@BeforeClass public static void hackPropsUi() throws Exception { Field props = getPropsField(); if ( props == null ) { throw new IllegalStateException( "Cannot find 'props' field in " + Props.class.getName() ); } Object value = FieldUtils.readStaticField( props, true ); if ( value == null ) { PropsUI mock = mock( PropsUI.class ); FieldUtils.writeStaticField( props, mock, true ); changedPropsUi = true; } else { changedPropsUi = false; } }
Example 2
Source File: TextFileInputDialogTest.java From hop with Apache License 2.0 | 6 votes |
@BeforeClass public static void hackPropsUi() throws Exception { Field props = getPropsField(); if ( props == null ) { throw new IllegalStateException( "Cannot find 'props' field in " + Props.class.getName() ); } Object value = FieldUtils.readStaticField( props, true ); if ( value == null ) { PropsUI mock = mock( PropsUI.class ); FieldUtils.writeStaticField( props, mock, true ); changedPropsUi = true; } else { changedPropsUi = false; } }
Example 3
Source File: SFTPPutDialogTest.java From pentaho-kettle with Apache License 2.0 | 6 votes |
@BeforeClass public static void hackPropsUi() throws Exception { Field props = getPropsField(); if ( props == null ) { throw new IllegalStateException( "Cannot find 'props' field in " + Props.class.getName() ); } Object value = FieldUtils.readStaticField( props, true ); if ( value == null ) { PropsUI mock = mock( PropsUI.class ); FieldUtils.writeStaticField( props, mock, true ); changedPropsUi = true; } else { changedPropsUi = false; } }
Example 4
Source File: TextFileInputDialogTest.java From pentaho-kettle with Apache License 2.0 | 6 votes |
@BeforeClass public static void hackPropsUi() throws Exception { Field props = getPropsField(); if ( props == null ) { throw new IllegalStateException( "Cannot find 'props' field in " + Props.class.getName() ); } Object value = FieldUtils.readStaticField( props, true ); if ( value == null ) { PropsUI mock = mock( PropsUI.class ); FieldUtils.writeStaticField( props, mock, true ); changedPropsUi = true; } else { changedPropsUi = false; } }
Example 5
Source File: SFTPPutDialogTest.java From hop with Apache License 2.0 | 5 votes |
@AfterClass public static void restoreNullInPropsUi() throws Exception { if ( changedPropsUi ) { Field props = getPropsField(); FieldUtils.writeStaticField( props, null, true ); } }
Example 6
Source File: TextFileInputDialogTest.java From hop with Apache License 2.0 | 5 votes |
@AfterClass public static void restoreNullInPropsUi() throws Exception { if ( changedPropsUi ) { Field props = getPropsField(); FieldUtils.writeStaticField( props, null, true ); } }
Example 7
Source File: TestUtils.java From chassis with Apache License 2.0 | 5 votes |
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); }
Example 8
Source File: SFTPPutDialogTest.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@AfterClass public static void restoreNullInPropsUi() throws Exception { if ( changedPropsUi ) { Field props = getPropsField(); FieldUtils.writeStaticField( props, null, true ); } }
Example 9
Source File: TextFileInputDialogTest.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@AfterClass public static void restoreNullInPropsUi() throws Exception { if ( changedPropsUi ) { Field props = getPropsField(); FieldUtils.writeStaticField( props, null, true ); } }
Example 10
Source File: SalesforceInputDialogTest.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@BeforeClass public static void hackPropsUi() throws Exception { Field props = getPropsField(); if ( props == null ) { throw new IllegalStateException( "Cannot find 'props' field in " + Props.class.getName() ); } Object value = FieldUtils.readStaticField( props, true ); if ( value == null ) { PropsUI mock = mock( PropsUI.class ); FieldUtils.writeStaticField( props, mock, true ); changedPropsUi = true; } else { changedPropsUi = false; } }
Example 11
Source File: SalesforceInputDialogTest.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@AfterClass public static void restoreNullInPropsUi() throws Exception { if ( changedPropsUi ) { Field props = getPropsField(); FieldUtils.writeStaticField( props, null, true ); } }