Package com.mycila.testing.core

Examples of com.mycila.testing.core.TestPluginException


            case NICE:
                return EasyMock.createNiceMock(name, field.getType());
            case STRICT:
                return EasyMock.createStrictMock(name, field.getType());
        }
        throw new TestPluginException("Invalid mock type for field '%s': %s", field, field.getAnnotation(Mock.class).value());
    }
View Full Code Here


        if (context != null) {
            for (Class<? extends Module> moduleClass : context.value()) {
                try {
                    modules.add(moduleClass.newInstance());
                } catch (Exception e) {
                    throw new TestPluginException(e, "Error instanciating module class '%s': %s", moduleClass.getName(), e.getMessage());
                }
            }
        }
        return modules;
    }
View Full Code Here

            case NICE:
                return EasyMock.createNiceMock(name, field.getType());
            case STRICT:
                return EasyMock.createStrictMock(name, field.getType());
        }
        throw new TestPluginException("Invalid mock type for field '%s': %s", field, field.getAnnotation(Mock.class).value());
    }
View Full Code Here

                if (field.get(context.getTest().getTarget()) == null) {
                    field.set(context.getTest().getTarget(), fieldValues.get(field));
                }
            }
        } catch (Exception e) {
            throw new TestPluginException("AtUnit configuration error: " + e.getMessage(), e);
        }
    }
View Full Code Here

            if (methods.length > 0) {
                Object o = context.getTest().invoke(methods[0]);
                if (o != null && o instanceof Mockery) {
                    return (Mockery) o;
                }
                throw new TestPluginException("Method '%s' annotated with @MockContextProvider did not returned a valid Mockery object: %s", methods[0], o);
            }
        }
        {
            Field[] fields = context.getTest().getFieldsAnnotatedWith(MockContextProvider.class);
            if (fields.length > 0) {
                Object o = context.getTest().get(fields[0]);
                if (o != null && o instanceof Mockery) {
                    return (Mockery) o;
                }
                throw new TestPluginException("Field '%s' annotated with @MockContextProvider does not have a valid Mockery object: %s", fields[0], o);
            }
        }
        return null;
    }
View Full Code Here

        if (context != null) {
            for (Class<? extends Module> moduleClass : context.value()) {
                try {
                    modules.add(moduleClass.newInstance());
                } catch (Exception e) {
                    throw new TestPluginException(e, "Error instanciating module class '%s': %s", moduleClass.getName(), e.getMessage());
                }
            }
        }
        return modules;
    }
View Full Code Here

            if (methods.length > 0) {
                Object o = context.getTest().invoke(methods[0]);
                if (o != null && o instanceof Mockery) {
                    return (Mockery) o;
                }
                throw new TestPluginException("Method '%s' annotated with @MockContextProvider did not returned a valid Mockery object: %s", methods[0], o);
            }
        }
        {
            Field[] fields = context.getTest().getFieldsAnnotatedWith(MockContextProvider.class);
            if (fields.length > 0) {
                Object o = context.getTest().get(fields[0]);
                if (o != null && o instanceof Mockery) {
                    return (Mockery) o;
                }
                throw new TestPluginException("Field '%s' annotated with @MockContextProvider does not have a valid Mockery object: %s", fields[0], o);
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of com.mycila.testing.core.TestPluginException

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.