Package org.apache.webbeans.test.component

Examples of org.apache.webbeans.test.component.IPayment


        beanClasses.add(ProducerNewComponent.class);
        beanClasses.add(NewComponent.class);

        startContainer(beanClasses, null);

        IPayment payment = getInstance(IPayment.class);
        Assert.assertNotNull(payment);
        Assert.assertTrue(payment instanceof CheckWithCheckPayment);

        shutDownContainer();
    }
View Full Code Here


        Object object = getManager().getInstance(comps.get(2));
        Assert.assertNotNull(object);
        Assert.assertTrue(object instanceof PaymentProcessorComponent);

        PaymentProcessorComponent uc = (PaymentProcessorComponent) object;
        IPayment p = uc.getPaymentCheck();

        Assert.assertTrue(p instanceof CheckWithCheckPayment);
        Assert.assertEquals("CHECK", p.pay());

        p = uc.getPaymentMoney();

        Assert.assertTrue(p instanceof CheckWithMoneyPayment);

        Assert.assertEquals("MONEY", p.pay());

        ContextFactory.destroyRequestContext(null);
    }
View Full Code Here

        defineSimpleWebBean(ProducerNewComponent.class);

        ContextFactory.initRequestContext(null);
        Assert.assertEquals(5, getDeployedComponents());

        IPayment payment = (IPayment) getManager().getInstanceByName("paymentProducer");
        Assert.assertNotNull(payment);

        IPayment payment2 = (IPayment) getManager().getInstanceByName("paymentProducer");

        Assert.assertNotSame(payment, payment2);
    }
View Full Code Here

        Object object = getManager().getInstance(comps.get(2));
        Assert.assertNotNull(object);
        Assert.assertTrue(object instanceof PaymentProcessorComponent);

        PaymentProcessorComponent uc = (PaymentProcessorComponent) object;
        IPayment p = uc.getPaymentCheck();

        Assert.assertTrue(p instanceof CheckWithCheckPayment);
        Assert.assertEquals("CHECK", p.pay());

        p = uc.getPaymentMoney();

        Assert.assertTrue(p instanceof CheckWithMoneyPayment);

        Assert.assertEquals("MONEY", p.pay());

        ContextFactory.destroyRequestContext(null);
    }
View Full Code Here

        defineManagedBean(ProducerNewComponent.class);

        ContextFactory.initRequestContext(null);
        Assert.assertEquals(5, getDeployedComponents());

        IPayment payment = (IPayment) getManager().getInstanceByName("paymentProducer");
        Assert.assertNotNull(payment);

        IPayment payment2 = (IPayment) getManager().getInstanceByName("paymentProducer");

        Assert.assertNotSame(payment, payment2);
    }
View Full Code Here

        Object object = getManager().getInstance(comps.get(2));
        Assert.assertNotNull(object);
        Assert.assertTrue(object instanceof PaymentProcessorComponent);

        PaymentProcessorComponent uc = (PaymentProcessorComponent) object;
        IPayment p = uc.getPaymentCheck();

        Assert.assertTrue(p instanceof CheckWithCheckPayment);
        Assert.assertEquals("CHECK", p.pay());

        p = uc.getPaymentMoney();

        Assert.assertTrue(p instanceof CheckWithMoneyPayment);

        Assert.assertEquals("MONEY", p.pay());

        ContextFactory.destroyRequestContext(null);
    }
View Full Code Here

        defineManagedBean(ProducerNewComponent.class);

        ContextFactory.initRequestContext(null);
        Assert.assertEquals(5, getDeployedComponents());

        IPayment payment = (IPayment) getManager().getInstanceByName("paymentProducer");
        Assert.assertNotNull(payment);

        IPayment payment2 = (IPayment) getManager().getInstanceByName("paymentProducer");

        Assert.assertNotSame(payment, payment2);
    }
View Full Code Here

        Object object = getManager().getInstance(comps.get(2));
        Assert.assertNotNull(object);
        Assert.assertTrue(object instanceof PaymentProcessorComponent);

        PaymentProcessorComponent uc = (PaymentProcessorComponent) object;
        IPayment p = uc.getPaymentCheck();

        Assert.assertTrue(p instanceof CheckWithCheckPayment);
        Assert.assertEquals("CHECK", p.pay());

        p = uc.getPaymentMoney();

        Assert.assertTrue(p instanceof CheckWithMoneyPayment);

        Assert.assertEquals("MONEY", p.pay());

        ContextFactory.destroyRequestContext(null);
    }
View Full Code Here

        defineSimpleWebBean(ProducerNewComponent.class);

        ContextFactory.initRequestContext(null);
        Assert.assertEquals(5, getDeployedComponents());

        IPayment payment = (IPayment) getManager().getInstanceByName("paymentProducer");
        Assert.assertNotNull(payment);

        IPayment payment2 = (IPayment) getManager().getInstanceByName("paymentProducer");

        Assert.assertNotSame(payment, payment2);
    }
View Full Code Here

        Object object = getContext(RequestScoped.class).get(comps.get(2), new CreationalContextImpl());
        Assert.assertNotNull(object);
        Assert.assertTrue(object instanceof PaymentProcessorComponent);

        PaymentProcessorComponent uc = (PaymentProcessorComponent) object;
        IPayment p = uc.getPaymentCheck();

        Assert.assertTrue(p instanceof CheckWithCheckPayment);
        Assert.assertEquals("CHECK", p.pay());

        p = uc.getPaymentMoney();

        Assert.assertTrue(p instanceof CheckWithMoneyPayment);

        Assert.assertEquals("MONEY", p.pay());

        ContextFactory.destroyRequestContext(null);
    }
View Full Code Here

TOP

Related Classes of org.apache.webbeans.test.component.IPayment

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.