Package com.mycila.testing

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


    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

    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

    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

Related Classes of com.mycila.testing.MycilaTestingException

Copyright © 2018 www.massapicom. 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.