Package org.ops4j.pax.exam

Examples of org.ops4j.pax.exam.TestContainer


    public static void main(String[] args) throws Exception {
        ExamSystem system = createServerSystem(options(
            systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN"),
            mavenBundle().groupId("org.ops4j.pax.tinybundles").artifactId("pax-tinybundles-core")
                .version("1.0.0-SNAPSHOT"), workingDirectory("/Users/tonit/server")));
        TestContainer container = createContainer(system);
        container.start();

        // container.install( bundle( withBnd() ).add( Probe2.class ).set( "Bundle-Activator",
        // Probe2.class.getName() ).build() );

    }
View Full Code Here


    }

    public void invoke(TestAddress address) throws Exception {
        assert (address != null) : "TestAddress must not be null.";

        TestContainer testContainer = testToContainerMap.get(address);
        if (testContainer == null) {
            throw new IllegalArgumentException("TestAddress " + address
                + " not from this reactor? Got it from getTargets() really?");
        }
        testContainer.call(address);
    }
View Full Code Here

    }

    public void invoke(TestAddress address) throws Exception {
        assert (address != null) : "TestAddress must not be null.";
        // you can directly invoke:
        TestContainer container = map.get(address);
        if (container == null) {
            throw new IllegalArgumentException("TestAddress " + address
                + " not from this reactor? Got it from getTargets() really?");
        }
        container.start();
        try {
            for (TestProbeBuilder builder : probes) {
                container.installProbe(builder.build().getStream());
            }
            container.call(address);
        }
        finally {
            container.stop();
        }

    }
View Full Code Here

    }

    public void invoke(TestAddress address) throws Exception {
        assert (address != null) : "TestAddress must not be null.";

        TestContainer testContainer = map.get(address);
        if (testContainer == null) {
            throw new IllegalArgumentException("TestAddress " + address
                + " not from this reactor? Got it from getTargets() really?");
        }
        testContainer.call(address);
    }
View Full Code Here

     * @throws Exception when options cannot be parsed
     */
    public static TestContainer createContainer(String configurationClassName) throws Exception {
        Option[] options = getConfigurationOptions(configurationClassName);
        ExamSystem system = DefaultExamSystem.create(options);
        TestContainer testContainer = PaxExamRuntime.createContainer(system);
        testContainer.start();
        return testContainer;
    }
View Full Code Here

    public static void main(String[] args) throws Exception {
        if (args.length != 2) {
            throw new IllegalArgumentException(
                "required arguments: <configuration class name> <shutdown port>");
        }
        TestContainer testContainer = createContainer(args[0]);
        waitForStop(testContainer, Integer.parseInt(args[1]));
    }
View Full Code Here

TOP

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

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.