List of usage examples for org.apache.commons.lang.reflect FieldUtils readStaticField
public static Object readStaticField(Class cls, String fieldName) throws IllegalAccessException
From source file:org.pentaho.di.ui.trans.steps.fileinput.text.TextFileInputDialogTest.java
@BeforeClass public static void hackPropsUi() throws Exception { Field props = getPropsField(); if (props == null) { throw new IllegalStateException("Cannot find 'props' field in " + Props.class.getName()); }/*www.j ava 2 s . c om*/ Object value = FieldUtils.readStaticField(props, true); if (value == null) { PropsUI mock = mock(PropsUI.class); FieldUtils.writeStaticField(props, mock, true); changedPropsUi = true; } else { changedPropsUi = false; } }
From source file:org.pentaho.di.ui.trans.steps.salesforceinput.SalesforceInputDialogTest.java
@BeforeClass public static void hackPropsUi() throws Exception { Field props = getPropsField(); if (props == null) { throw new IllegalStateException("Cannot find 'props' field in " + Props.class.getName()); }/*from ww w . j av a 2s . com*/ Object value = FieldUtils.readStaticField(props, true); if (value == null) { PropsUI mock = mock(PropsUI.class); FieldUtils.writeStaticField(props, mock, true); changedPropsUi = true; } else { changedPropsUi = false; } }