Package org.jboss.weld.environment.se

Examples of org.jboss.weld.environment.se.WeldContainer


*/
public class ShowcaseBundleExtractor {

    public static void main(String[] args) throws Exception {
        // First of all, init the CDI container.
        WeldContainer weldContainer = new Weld().initialize();
        CDIBeanLocator.beanManager = weldContainer.getBeanManager();

        // Mock up the app directories.
        String rootDir = System.getProperty("user.dir") + "/modules/dashboard-samples";
        Application.lookup().setBaseAppDirectory(rootDir + "/src/main/webapp");
        Application.lookup().setBaseCfgDirectory(rootDir + "/src/main/webapp/WEB-INF/etc");
View Full Code Here


public class CDIExampleWithInclusionTest {

    @Test
    public void testGo() {
        Weld w = new Weld();
        WeldContainer wc = w.initialize();

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        PrintStream ps = new PrintStream(baos);

        CDIExampleWithInclusion bean = wc.instance().select(CDIExampleWithInclusion.class).get();
        bean.go(ps);

        ps.close();

        String actual = new String(baos.toByteArray());
View Full Code Here

    public JCDIInjectionContext createManagedObject(Class            managedClass,
                                                    BundleDescriptor bundle,
                                                    boolean          invokePostConstruct) {
        JCDIInjectionContext context = null;

        WeldContainer wc = getWeldContainer();
        if (wc != null) {
            BeanManager beanManager = wc.getBeanManager();

            AnnotatedType annotatedType = beanManager.createAnnotatedType(managedClass);
            InjectionTarget target = beanManager.createInjectionTarget(annotatedType);

            CreationalContext cc = beanManager.createCreationalContext(null);
View Full Code Here


    @Override
    @SuppressWarnings("unchecked")
    public void injectManagedObject(Object managedObject, BundleDescriptor bundle) {
        WeldContainer wc = getWeldContainer();

        if (wc != null) {
            BeanManager beanManager = wc.getBeanManager();

            AnnotatedType annotatedType = beanManager.createAnnotatedType(managedObject.getClass());
            InjectionTarget target = beanManager.createInjectionTarget(annotatedType);

            CreationalContext cc = beanManager.createCreationalContext(null);
View Full Code Here

    }

    @Test
    public void shouldRunWhenShouldRunIsTrue() {
        System.setProperty("liquibase.shouldRun", "true");
        WeldContainer weld = new Weld().initialize();
        CDILiquibase cdiLiquibase = weld.instance().select(CDILiquibase.class).get();
        assertNotNull(cdiLiquibase);
        assertTrue(cdiLiquibase.isInitialized());
        assertTrue(cdiLiquibase.isUpdateSuccessful());
    }
View Full Code Here

    }

    @Test
    public void shouldntRunWhenShouldRunIsFalse() {
        System.setProperty("liquibase.shouldRun", "false");
        WeldContainer weld = new Weld().initialize();
        CDILiquibase cdiLiquibase = weld.instance().select(CDILiquibase.class).get();
        assertNotNull(cdiLiquibase);
        assertFalse(cdiLiquibase.isInitialized());
        assertFalse(cdiLiquibase.isUpdateSuccessful());
    }
View Full Code Here

                                                    boolean          invokePostConstruct) {
        JCDIInjectionContext context = null;

        BeanManager beanManager = null;

        WeldContainer wc = getWeldContainer();
        if (wc != null) {
            beanManager = wc.getBeanManager();

            AnnotatedType annotatedType = beanManager.createAnnotatedType(managedClass);
            InjectionTarget target = beanManager.createInjectionTarget(annotatedType);

            CreationalContext cc = beanManager.createCreationalContext(null);
View Full Code Here


    @Override
    @SuppressWarnings("unchecked")
    public void injectManagedObject(Object managedObject, BundleDescriptor bundle) {
        WeldContainer wc = getWeldContainer();

        if (wc != null) {
            BeanManager beanManager = wc.getBeanManager();

            AnnotatedType annotatedType = beanManager.createAnnotatedType(managedObject.getClass());
            InjectionTarget target = beanManager.createInjectionTarget(annotatedType);

            CreationalContext cc = beanManager.createCreationalContext(null);
View Full Code Here

TOP

Related Classes of org.jboss.weld.environment.se.WeldContainer

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.