Package org.apache.openejb.junit

Examples of org.apache.openejb.junit.TestInstance


    private static void ensureInit() {
        if (!initialized) {
            synchronized (MockRegistry.class) {
                if (!initialized) {
                    final TestInstance instance = SystemInstance.get().getComponent(TestInstance.class);
                    if (instance != null) {
                        Class<?> current = instance.getTestClass();
                        while (!current.equals(Object.class)) {
                            for (Field f : current.getDeclaredFields()) {
                                for (Annotation annotation : f.getAnnotations()) {
                                    if (annotation.annotationType().getName().startsWith("org.mockito.")) {
                                        final boolean acc = f.isAccessible();
                                        try {
                                            f.setAccessible(true);
                                            final Object mockInstance = f.get(instance.getInstance());

                                            if (Mock.class.equals(annotation.annotationType())) {
                                                final Mock mock = (Mock) annotation;
                                                if (!"".equals(mock.name())) {
                                                    mockInstancesByName.put(mock.name(), mockInstance);
View Full Code Here

TOP

Related Classes of org.apache.openejb.junit.TestInstance

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.