Package org.ops4j.pax.exam

Examples of org.ops4j.pax.exam.TestContainerException


            File moduleLoader = new File(installDir, "jboss-modules.jar");
            if (!moduleLoader.exists()) {
                String msg = String.format("%s exists, but %s does not. "
                    + "This does not look like a valid WildFly 8.0 installation.", wildFlyHome,
                    moduleLoader);
                throw new TestContainerException(msg);
            }
            File modulesDir = new File(installDir, "modules");
            File systemDir = new File(modulesDir, "system");
            if (!systemDir.exists()) {
                String msg = String.format("%s does not exist. "
                    + "This does not look like a valid WildFly 8.0 installation.", systemDir);
                throw new TestContainerException(msg);
            }

            LOG.info("using existing WildFly installation in {}", wildFlyHome);
            valid = true;
        }
View Full Code Here


     * Copies all files in a user-defined configuration directory to the JBoss AS
     * configuration directory.
     */
    private void installConfiguration() {
        if (!configSourceDir.exists()) {
            throw new TestContainerException("configuration directory " + configSourceDir
                + " does not exist");
        }

        configTargetDir = new File(wildFlyHome, "standalone/configuration");
        for (File configFile : configSourceDir.listFiles()) {
            if (!configFile.isDirectory()) {
                File targetFile = new File(configTargetDir, configFile.getName());
                try {
                    LOG.info("copying {} to {}", configFile, targetFile);
                    FileUtils.copyFile(configFile, targetFile, null);
                }
                catch (IOException exc) {
                    throw new TestContainerException("error copying config file " + configFile, exc);
                }
            }
        }
    }
View Full Code Here

    @Override
    public ProbeInvoker createProbeInvoker(Object context, String expr) {
        URI uri = TestDirectory.getInstance().getAccessPoint();
        if (uri == null) {
            throw new TestContainerException("servlet container context root is undefined");
        }
        String accessPoint = uri.toString();
        String encodedInstruction = expr + ";" + accessPoint;
        return new ServletBridgeProbeInvoker(encodedInstruction);
    }
View Full Code Here

            reactorStrategies.put(EXAM_REACTOR_STRATEGY_PER_SUITE, new PerSuite());
            reactorStrategies.put(EXAM_REACTOR_STRATEGY_PER_CLASS, new PerClass());
            reactorStrategies.put(EXAM_REACTOR_STRATEGY_PER_METHOD, new PerMethod());
        }
        catch (IOException exc) {
            throw new TestContainerException("cannot create Exam system", exc);
        }
    }
View Full Code Here

        testClasses.add(_testClass);
        try {
            addConfigurationsToReactor(_testClass, testClassInstance);
        }
        catch (IllegalAccessException | InvocationTargetException exc) {
            throw new TestContainerException(exc);
        }
        return reactor;
    }
View Full Code Here

                fact = strategy.value()[0].newInstance();
                return fact;
            }
        }
        catch (IllegalAccessException | InstantiationException exc) {
            throw new TestContainerException(exc);
        }

        if (strategyName == null) {
            if (systemType.equals(EXAM_SYSTEM_CDI) || systemType.equals(EXAM_SYSTEM_JAVAEE)) {
                strategyName = EXAM_REACTOR_STRATEGY_PER_SUITE;
View Full Code Here

                fact = PaxExamRuntime.getTestContainerFactory();
            }
            return fact;
        }
        catch (InstantiationException | IllegalAccessException exc) {
            throw new TestContainerException(exc);
        }
    }
View Full Code Here

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

            uri = new URI(anyUri);
            File file = new File(uri);
            return file;
        }
        catch (URISyntaxException exc) {
            throw new TestContainerException(exc);
        }
        catch (IllegalArgumentException exc) {
            InputStream is = uri.toURL().openStream();
            File tempFile = File.createTempFile("paxexam", ".jar");
            OutputStream os = new FileOutputStream(tempFile);
View Full Code Here

                StreamUtils.copyStream(is, os, true);
                return tempFile;
            }
        }
        catch (URISyntaxException exc) {
            throw new TestContainerException(exc);
        }
        catch (IOException exc) {
            throw new TestContainerException(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.