public boolean isInstantiated(final Object testCase) { try { field.setAccessible(true); Object fieldValue = field.get(testCase); return (fieldValue != null); } catch (IllegalAccessException e) { throw new InvalidStepsFieldException("Could not access or set @Steps field: " + field, e); } }
public boolean isInstantiated(final Object testCase) { try { field.setAccessible(true); Object fieldValue = field.get(testCase); return (fieldValue != null); } catch (IllegalAccessException e) { throw new InvalidStepsFieldException("Could not access or set @Steps field: " + field, e); } }
private void assignValueToField(Field field, Object steps, String value) { field.setAccessible(true); try { field.set(steps, value); } catch (IllegalAccessException e) { throw new InvalidStepsFieldException("Could not access or set name field: " + field, e); } }
public boolean isInstantiated(final Object testCase) { try { field.setAccessible(true); Object fieldValue = field.get(testCase); return (fieldValue != null); } catch (IllegalAccessException e) { throw new InvalidStepsFieldException("Could not access or set @Steps field: " + field, e); } }
public Object newInstance() { try { return innerClass.getEnclosingClass().newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new InvalidStepsFieldException("Please ensure that there is a default constructor for " + innerClass.getEnclosingClass()); } }
/** * Find the first field in the class annotated with the <b>Managed</b> annotation. */ public static List<StepsAnnotatedField> findMandatoryAnnotatedFields(final Class<?> clazz) { List<StepsAnnotatedField> annotatedFields = findOptionalAnnotatedFields(clazz); if (annotatedFields.isEmpty()) { throw new InvalidStepsFieldException(NO_ANNOTATED_FIELD_ERROR); } return annotatedFields; }
/** * Find the first field in the class annotated with the <b>Managed</b> annotation. */ public static List<StepsAnnotatedField> findMandatoryAnnotatedFields(final Class<?> clazz) { List<StepsAnnotatedField> annotatedFields = findOptionalAnnotatedFields(clazz); if (annotatedFields.isEmpty()) { throw new InvalidStepsFieldException(NO_ANNOTATED_FIELD_ERROR); } return annotatedFields; }
/** * Find the first field in the class annotated with the <b>Managed</b> annotation. */ public static List<StepsAnnotatedField> findMandatoryAnnotatedFields(final Class<?> clazz) { List<StepsAnnotatedField> annotatedFields = findOptionalAnnotatedFields(clazz); if (annotatedFields.isEmpty()) { throw new InvalidStepsFieldException(NO_ANNOTATED_FIELD_ERROR); } return annotatedFields; }
public void setValue(final Object testCase, final Object steps) { try { set(testCase).to(steps); } catch (IllegalAccessException e) { throw new InvalidStepsFieldException("Could not access or set @Steps field: " + field, e); } }
public void setValue(final Object testCase, final Object steps) { try { set(testCase).to(steps); } catch (IllegalAccessException e) { throw new InvalidStepsFieldException("Could not access or set @Steps field: " + field, e); } }
public void setValue(final Object field, final Object value) { try { set(field).to(value); } catch (IllegalAccessException e) { throw new InvalidStepsFieldException("Could not access or set field: " + field, e); } }