Package org.ops4j.pax.exam

Examples of org.ops4j.pax.exam.TestProbeBuilder


        }
        system.clear();
    }

    private TestProbeProvider makeProbe(ExamSystem system) throws IOException {
        TestProbeBuilder probe = system.createProbe();
        probe.addTests(Probe.class, getAllMethods(Probe.class));
        return probe.build();
    }
View Full Code Here


        TestContainerFactory factory = getFactory();
        Option[] options = new Option[] { regressionDefaults() };

        ExamSystem system = PaxExamRuntime.createTestSystem(options);
        ExamReactor reactor = new DefaultExamReactor(system, factory);
        TestProbeBuilder probe = makeProbe(system);

        reactor.addProbe(probe);
        reactor.addConfiguration(options);

        StagedExamReactor stagedReactor = reactor.stage(strategy);
View Full Code Here

        }

    }

    private TestProbeBuilder makeProbe(ExamSystem system) throws IOException {
        TestProbeBuilder probe = system.createProbe();
        probe.addTests(SingleTestProbe.class, getAllMethods(SingleTestProbe.class));
        return probe;
    }
View Full Code Here

            }
        }
    }

    private TestProbeProvider makeProbe(ExamSystem system) throws IOException {
        TestProbeBuilder probe = system.createProbe();
        probe.addTests(SingleTestProbe.class, getAllMethods(SingleTestProbe.class));
        return probe.build();
    }
View Full Code Here

     * @throws IOException
     * @throws ExamConfigurationException
     */
    private void addTestsToReactor(ExamReactor reactor, Object testClassInstance,
        List<ITestNGMethod> testMethods) throws IOException, ExamConfigurationException {
        TestProbeBuilder probe = manager.createProbeBuilder(testClassInstance);
        for (ITestNGMethod m : testMethods) {
            TestAddress address = probe.addTest(m.getRealClass(), m.getMethodName());
            manager.storeTestMethod(address, m);
        }
        reactor.addProbe(probe);
    }
View Full Code Here

     * @throws IOException
     * @throws ExamConfigurationException
     */
    private void addTestsToReactor(ExamReactor reactor, Class<?> testClass, Object testClassInstance)
        throws IOException, ExamConfigurationException {
        TestProbeBuilder probe = manager.createProbeBuilder(testClassInstance);

        // probe.setAnchor( testClass );
        for (FrameworkMethod s : super.getChildren()) {
            // record the method -> adress matching
            TestAddress address = delegateTest(testClassInstance, probe, s);
            if (address == null) {
                address = probe.addTest(testClass, s.getMethod().getName());
            }
            manager.storeTestMethod(address, s);
        }
        reactor.addProbe(probe);
    }
View Full Code Here

    public TestProbeBuilder createProbeBuilder(Object testClassInstance) throws IOException,
        ExamConfigurationException {
        if (defaultProbeBuilder == null) {
            defaultProbeBuilder = system.createProbe();
        }
        TestProbeBuilder probeBuilder = overwriteWithUserDefinition(currentTestClass,
            testClassInstance);
        if (probeBuilder.getTempDir() == null) {
            probeBuilder.setTempDir(defaultProbeBuilder.getTempDir());
        }
        return probeBuilder;
    }
View Full Code Here

        throws ExamConfigurationException {
        Method[] methods = testClass.getMethods();
        for (Method m : methods) {
            if (isProbeBuilder(m)) {
                LOG.debug("User defined probe hook found: " + m.getName());
                TestProbeBuilder probeBuilder;
                try {
                    probeBuilder = (TestProbeBuilder) m.invoke(testInstance, defaultProbeBuilder);
                }
                // CHECKSTYLE:SKIP : catch all wanted
                catch (Exception e) {
View Full Code Here

     * @throws IOException
     * @throws ExamConfigurationException
     */
    private void addTestsToReactor(ExamReactor reactor, Class<?> testClass, Object testClassInstance)
        throws IOException, ExamConfigurationException {
        TestProbeBuilder probe = manager.createProbeBuilder(testClassInstance);

        Iterator<Object[]> it = null;
        int index = 0;
        try {
            it = allParameters().iterator();
        }
        // CHECKSTYLE:SKIP : JUnit API
        catch (Throwable t) {
            throw new ExamConfigurationException(t.getMessage());
        }

        while (it.hasNext()) {
            parameters = it.next();
            // probe.setAnchor( testClass );
            for (FrameworkMethod s : super.getChildren()) {
                // record the method -> adress matching
                TestAddress address = probe.addTest(testClass, s.getMethod().getName(), index);
                manager.storeTestMethod(address, s);
            }
            index++;
        }
        reactor.addProbe(probe);
View Full Code Here

        assertThat(war.getEntry("WEB-INF/lib/pax-exam-spi-" + Info.getPaxExamVersion() + ".jar"),
            is(notNullValue()));
    }

    private ZipFile localCopy(WarProbeOption option) throws IOException {
        TestProbeBuilder builder = builder(option);
        builder.setTempDir(tempDir);
        TestProbeProvider provider = builder.build();
        InputStream is = provider.getStream();
        File out = new File("target/out.war");
        StreamUtils.copyStream(is, new FileOutputStream(out), true);
        return new ZipFile(out);
    }
View Full Code Here

TOP

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

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.