Package org.picocontainer

Examples of org.picocontainer.ComponentAdapter.verify()


                            + " available");
                }
            } else {
                for (final Iterator iter = componentAdapters.iterator(); iter.hasNext();) {
                    final ComponentAdapter componentAdapter = (ComponentAdapter) iter.next();
                    componentAdapter.verify(container);
                }
            }
        } else {
            throw new PicoIntrospectionException(expectedType.getName() + " is not a collective type");
        }
View Full Code Here


    final public void testDEF_verifyWithoutDependencyWorks() {
        final MutablePicoContainer picoContainer = new DefaultPicoContainer(createDefaultComponentAdapterFactory());
        final ComponentAdapter componentAdapter = prepDEF_verifyWithoutDependencyWorks(picoContainer);
        assertSame(getComponentAdapterType(), componentAdapter.getClass());
        componentAdapter.verify(picoContainer);
    }

    /**
     * Prepare the test <em>verifyDoesNotInstantiate</em>.
     *
 
View Full Code Here

        final MutablePicoContainer picoContainer = new DefaultPicoContainer(createDefaultComponentAdapterFactory());
        final ComponentAdapter componentAdapter = prepDEF_verifyDoesNotInstantiate(picoContainer);
        assertSame(getComponentAdapterType(), componentAdapter.getClass());
        final ComponentAdapter notInstantiatablecomponentAdapter = new NotInstantiatableComponentAdapter(componentAdapter);
        final PicoContainer wrappedPicoContainer = wrapComponentInstances(NotInstantiatableComponentAdapter.class, picoContainer, null);
        notInstantiatablecomponentAdapter.verify(wrappedPicoContainer);
    }

    /**
     * Prepare the test <em>visitable</em>.
     *
 
View Full Code Here

        if ((getComponentAdapterNature() & VERIFYING) > 0) {
            final MutablePicoContainer picoContainer = new DefaultPicoContainer(createDefaultComponentAdapterFactory());
            final ComponentAdapter componentAdapter = prepVER_verificationFails(picoContainer);
            assertSame(getComponentAdapterType(), componentAdapter.getClass());
            try {
                componentAdapter.verify(picoContainer);
                fail("PicoIntrospectionException expected");
            } catch (PicoIntrospectionException e) {
            } catch (Exception e) {
                fail("PicoIntrospectionException expected, but got " + e.getClass().getName());
            }
View Full Code Here

            final ComponentAdapter componentAdapter = prepRES_failingVerificationWithCyclicDependencyException(picoContainer);
            assertSame(getComponentAdapterType(), componentAdapter.getClass());
            assertTrue(picoContainer.getComponentAdapters().contains(componentAdapter));
            final PicoContainer wrappedPicoContainer = wrapComponentInstances(CycleDetectorComponentAdapter.class, picoContainer, wrapperDependencies);
            try {
                componentAdapter.verify(wrappedPicoContainer);
                fail("Thrown PicoVerificationException excpected");
            } catch (final CyclicDependencyException cycle) {
                final Class[] dependencies = cycle.getDependencies();
                assertSame(dependencies[0], dependencies[dependencies.length - 1]);
            }
View Full Code Here

        if (componentAdapter == null) {
            final HashSet set = new HashSet();
            set.add(Arrays.asList(new Class[] {expectedType}));
            throw new UnsatisfiableDependenciesException(adapter, set);
        }
        componentAdapter.verify(container);
    }

    /**
     * Visit the current {@link Parameter}.
     *
 
View Full Code Here

                            + " available");
                }
            } else {
                for (Object componentAdapter1 : componentAdapters) {
                    final ComponentAdapter componentAdapter = (ComponentAdapter) componentAdapter1;
                    componentAdapter.verify(container);
                }
            }
        } else {
            throw new PicoCompositionException(expectedType + " is not a collective type");
        }
View Full Code Here

        if (componentAdapter == null) {
            final Set<Type> set = new HashSet<Type>();
            set.add(expectedType);
            throw new AbstractInjector.UnsatisfiableDependenciesException(adapter, null, set, container);
        }
        componentAdapter.verify(container);
    }

    /**
     * Visit the current {@link Parameter}.
     *
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.