Examples of MycilaTestingException


Examples of com.mycila.testing.MycilaTestingException

        notNull("Method", method);
        notNull("Method argumentd", args);
        try {
            return method.invoke(instance(), args);
        } catch (IllegalAccessException e) {
            throw new MycilaTestingException(e, "Error invoking method '%s' with arguments: %s: %s", method, Arrays.deepToString(args), e.getMessage());
        } catch (InvocationTargetException e) {
            throw new MycilaTestingException(e.getTargetException().getClass().getSimpleName() + ": " + e.getTargetException().getMessage(), e.getTargetException());
        } catch (Exception e) {
            throw new MycilaTestingException(e, "Error invoking method '%s' with arguments: %s: %s", method, Arrays.deepToString(args), e.getMessage());
        }
    }
View Full Code Here

Examples of com.mycila.testing.MycilaTestingException

    public Object get(Field field) {
        notNull("Field", field);
        try {
            return field.get(instance());
        } catch (Exception e) {
            throw new MycilaTestingException(e, "Error getting value of field '%s' on test class '%s': %s", field, testClass().getName(), e.getMessage());
        }
    }
View Full Code Here

Examples of com.mycila.testing.MycilaTestingException

    public void set(Field field, Object value) {
        notNull("Field", field);
        try {
            field.set(instance(), value);
        } catch (Exception e) {
            throw new MycilaTestingException(e, "Error setting value on field '%s' on test class '%s': %s", field, testClass().getName(), e.getMessage());
        }
    }
View Full Code Here

Examples of com.mycila.testing.MycilaTestingException

    public static TestContext context(Object testInstance) {
        notNull("Test instance", testInstance);
        TestContext context = CONTEXTS.get(testInstance);
        if (context == null) {
            throw new MycilaTestingException("No Global Test Context available for test %s#%s", testInstance.getClass().getName(), testInstance.hashCode());
        }
        return context;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.