Package org.ops4j.pax.exam

Examples of org.ops4j.pax.exam.TestAddress


     */
    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


        if (!useProbeInvoker) {
            callBack.runTestMethod(testResult);
            return;
        }

        TestAddress address = methodToAddressMap.get(testResult.getName());
        TestAddress root = address.root();

        LOG.debug("Invoke " + testResult.getName() + " @ " + address + " Arguments: "
            + root.arguments());
        try {
            stagedReactor.invoke(address);
            testResult.setStatus(ITestResult.SUCCESS);
        }
        // CHECKSTYLE:SKIP : StagedExamReactor API
View Full Code Here

        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);
        }
View Full Code Here

        return new Statement() {

            @Override
            // CHECKSTYLE:SKIP : Statement API
            public void evaluate() throws Throwable {
                TestAddress address = methodToTestAddressMap.get(method);
                TestAddress root = address.root();

                LOG.debug("Invoke " + method.getName() + " @ " + address + " Arguments: "
                    + root.arguments());
                try {
                    stagedReactor.invoke(address);
                }
                // CHECKSTYLE:SKIP : StagedExamReactor API
                catch (Exception e) {
View Full Code Here

        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

        return new Statement() {

            @Override
            // CHECKSTYLE:SKIP : Statement API
            public void evaluate() throws Throwable {
                TestAddress address = methodToTestAddressMap.get(method);
                TestAddress root = address.root();

                LOG.debug("Invoke " + method.getName() + " @ " + address + " Arguments: "
                    + root.arguments());
                try {
                    stagedReactor.invoke(address);
                }
                // CHECKSTYLE:SKIP : StagedExamReactor API
                catch (Exception e) {
View Full Code Here

        this.option = option;
    }

    @Override
    public TestAddress addTest(Class<?> clazz, String methodName, Object... args) {
        TestAddress address = new DefaultTestAddress(clazz.getSimpleName() + "." + methodName, args);
        String instruction = clazz.getName() + ";" + methodName;
        /*
         * args are only used for parameterized tests. A single integer argument is the parameter index.
         */
        if (args.length > 0) {
View Full Code Here

    public void testInvokeInvalid() throws Exception {
        List<TestContainer> containers = new ArrayList<TestContainer>();
        List<TestProbeBuilder> providers = new ArrayList<TestProbeBuilder>();

        StagedExamReactor reactor = getReactor(containers, providers);
        TestAddress dummy = mock(TestAddress.class);
        reactor.invoke(dummy);
    }
View Full Code Here

        this.store = store;
        extraProperties = new Properties();
    }

    public TestAddress addTest(Class<?> clazz, String methodName, Object... args) {
        TestAddress address = new DefaultTestAddress(clazz.getName() + "." + methodName, args);
        probeCalls.put(address,
            new TestInstantiationInstruction(clazz.getName() + ";" + methodName));
        addAnchor(clazz);
        return address;
    }
View Full Code Here

TOP

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

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.