Package org.ops4j.pax.exam

Examples of org.ops4j.pax.exam.TestContainerException


        BundleContext bc = null;
        while (bc == null) {
            bc = bundle.getBundleContext();
            if (bc == null) {
                if (System.currentTimeMillis() >= endTime) {
                    throw new TestContainerException(
                        "Unable to retrieve bundle context from bundle " + bundle);
                }
                try {
                    Thread.sleep(100);
                }
View Full Code Here


                    return true;
                }
            }
        }
        catch (NoClassDefFoundError e) {
            throw new TestContainerException(e);
        }
        catch (InstantiationException e) {
            throw new TestContainerException(e);
        }
        catch (IllegalAccessException e) {
            throw new TestContainerException(e);
        }
        return false;
    }
View Full Code Here

                Object[] parameters = injectHook(testMethod, params);
                testMethod.invoke(testInstance, parameters);
            }
        }
        catch (InvocationTargetException e) {
            throw new TestContainerException(e);

        }
        catch (IllegalAccessException e) {
            throw new TestContainerException(e);
        }
    }
View Full Code Here

        this.injector = injector;
        try {
            testClass = ctx.getBundle().loadClass(clazz);
        }
        catch (ClassNotFoundException e) {
            throw new TestContainerException(e);
        }
    }
View Full Code Here

        }
    }

    public void call(Object... args) {
        if (!(findAndInvoke(args))) {
            throw new TestContainerException(" Test " + method + " not found in test class "
                + testClass.getName());
        }
    }
View Full Code Here

             * If args are present, we expect exactly one integer argument, defining the index of
             * the parameter set for a parameterized test.
             */
            if (args.length > 0) {
                if (!(args[0] instanceof Integer)) {
                    throw new TestContainerException("Integer argument expected");
                }
                index = (Integer) args[0];
            }

            // find matching method
            for (Method m : testClass.getMethods()) {
                if (m.getName().equals(method)) {
                    // we assume its correct:
                    invokeViaJUnit(m, index);
                    return true;
                }
            }
        }
        catch (NoClassDefFoundError e) {
            throw new TestContainerException(e);
        }
        return false;
    }
View Full Code Here

     * @param ex
     * @return serializable exception
     */
    private TestContainerException createTestContainerException(String message, Throwable ex) {
        return isSerializable(ex)
            ? new TestContainerException(message, ex)
            : new WrappedTestContainerException(message, ex);
    }
View Full Code Here

            URLClassLoader classLoader = new URLClassLoader(new URL[]{jar.toURL()});
            contextClassLoader = Thread.currentThread().getContextClassLoader();
            Thread.currentThread().setContextClassLoader(classLoader);
        }
        catch (MalformedURLException exc) {
            throw new TestContainerException(exc);
        }
    }
View Full Code Here

    private void validateConfiguration() {
        ConfigurationManager cm = new ConfigurationManager();
        String systemType = cm.getProperty(Constants.EXAM_SYSTEM_KEY);
        if (! Constants.EXAM_SYSTEM_CDI.equals(systemType)) {
            String msg = "WeldTestContainer requires pax.exam.system = cdi";
            throw new TestContainerException(msg);
        }
    }
View Full Code Here

        try {
            URL applUrl = new URL(option.getURL());
            deployModule(option.getName(), applUrl.openStream());
        }
        catch (MalformedURLException exc) {
            throw new TestContainerException("Problem deploying " + option, exc);
        }
        catch (IOException exc) {
            throw new TestContainerException("Problem deploying " + option, exc);
        }
    }
View Full Code Here

TOP

Related Classes of org.ops4j.pax.exam.TestContainerException

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.