Package org.ops4j.pax.exam

Examples of org.ops4j.pax.exam.TestContainerException


    public ServletBridgeProbeInvoker(String encodedInstruction) {
        try {
            // parse class and method out of expression:
            String[] parts = encodedInstruction.split(";");
            if (parts.length != 3) {
                throw new TestContainerException("invalid test instruction: " + encodedInstruction);
            }
            clazz = parts[0];
            method = parts[1];
            URI contextRoot = new URI(parts[2]);
            this.testRunner = getTestRunner(contextRoot);
        }
        catch (URISyntaxException exc) {
            throw new TestContainerException(exc);
        }
    }
View Full Code Here


        Class<?> testClass;
        try {
            testClass = getClass().getClassLoader().loadClass(clazz);
        }
        catch (ClassNotFoundException e) {
            throw new TestContainerException(e);
        }

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

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

        ObjectInputStream ois = new ObjectInputStream(is);
        Object object = ois.readObject();
        if (object instanceof Throwable) {
            Throwable t = (Throwable) object;
            throw new TestContainerException(t);
        }
        else if (object instanceof String) {
            // ok
        }
        else {
View Full Code Here

    private Exception parametersMethodReturnedWrongType() throws Exception {
        String className = getTestClass().getName();
        String methodName = getParametersMethod().getName();
        String message = MessageFormat.format("{0}.{1}() must return an Iterable of arrays.",
            className, methodName);
        return new TestContainerException(message);
    }
View Full Code Here

            URI warUri = probeJar.toURI();
            LOG.info("JAR probe = {}", warUri);
            return warUri;
        }
        catch (IOException exc) {
            throw new TestContainerException(exc);
        }
    }
View Full Code Here

            ExamSystem sys = new DefaultExamSystem(combine(combinedOptions, options));
            subsystems.add(sys);
            return sys;
        }
        catch (IOException exc) {
            throw new TestContainerException(exc);
        }
    }
View Full Code Here

                try {
                    container.installProbe(builder.build().getStream());
                }
                catch (IOException e) {
                    throw new TestContainerException("Unable to build the probe.", e);
                }
            }
        }
    }
View Full Code Here

        Class<?> testClass;
        try {
            testClass = ctx.getBundle().loadClass(clazz);
        }
        catch (ClassNotFoundException e) {
            throw new TestContainerException(e);
        }

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

            BundleReference bundleRef = BundleReference.class.cast(klass.getClassLoader());
            Bundle bundle = bundleRef.getBundle();
            return getBundleContext(bundle, timeout);
        }
        catch (ClassCastException exc) {
            throw new TestContainerException("class " + klass.getName()
                + " is not loaded from an OSGi bundle");
        }
    }
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.