package org.apache.webbeans.test.producer.broken;

import javax.enterprise.inject.spi.DefinitionException;

import org.apache.webbeans.test.AbstractUnitTest;
import org.junit.Test;

/**
 * Test a few situations where producer methods are not allowed
 */
public class BrokenProducesTest extends AbstractUnitTest
{

    @Test(expected = DefinitionException.class)
    public void testProducerMethodInDecorator() throws Exception
    {
        addDecorator(DecoratorWithProducerMethod.class);
        startContainer();
    }

    @Test(expected = DefinitionException.class)
    public void testProducerMethodInInterceptor() throws Exception
    {
        addInterceptor(InterceptorWithProducerMethod.class);
        startContainer();
    }
    @Test(expected = DefinitionException.class)
    public void testProducerFieldInDecorator() throws Exception
    {
        addDecorator(DecoratorWithProducerField.class);
        startContainer();
    }

    @Test(expected = DefinitionException.class)
    public void testProducerFieldInInterceptor() throws Exception
    {
        addInterceptor(InterceptorWithProducerField.class);
        startContainer();
    }
}
