You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by ge...@apache.org on 2010/01/06 22:02:16 UTC
svn commit: r896668 - in /openwebbeans/trunk: ./
webbeans-impl/src/main/java/org/apache/webbeans/component/
webbeans-impl/src/main/java/org/apache/webbeans/component/creation/
webbeans-impl/src/main/java/org/apache/webbeans/config/
webbeans-impl/src/ma...
Author: gerdogdu
Date: Wed Jan 6 21:02:10 2010
New Revision: 896668
URL: http://svn.apache.org/viewvc?rev=896668&view=rev
Log:
[OWB-219] Work on (Section 2.6 - Alternatives) of coverege-cdi.html of RI TCK
Added:
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/Pen.java (with props)
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/Pencil.java (with props)
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/PencilProducerBean.java (with props)
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/tests/
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.java (with props)
openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/concepts/
openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/concepts/alternatives/
openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/concepts/alternatives/tests/
openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.xml (with props)
Modified:
openwebbeans/trunk/TCK-STANDALONE
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanCreator.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AlternativesManager.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/managed/ProxyFactoryTest.java
Modified: openwebbeans/trunk/TCK-STANDALONE
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/TCK-STANDALONE?rev=896668&r1=896667&r2=896668&view=diff
==============================================================================
--- openwebbeans/trunk/TCK-STANDALONE (original)
+++ openwebbeans/trunk/TCK-STANDALONE Wed Jan 6 21:02:10 2010
@@ -70,4 +70,7 @@
Section 2.5.1 - Declaring the bean EL name (PASSED)
Section 2.5.2 - Default bean EL names (PASSED)
Section 2.5.3 - Beans with no EL name (PASSED)
+Section 2.6 - Alternatives (PASSED)
+Section 2.6.1 - Declaring an alternative (PASSED But it seems some errors in TCK)
+ # CDITCK JIRA --> https://jira.jboss.org/jira/browse/CDITCK-89
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java?rev=896668&r1=896667&r2=896668&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java Wed Jan 6 21:02:10 2010
@@ -21,7 +21,6 @@
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.Producer;
-import org.apache.webbeans.config.OpenWebBeansConfiguration;
import org.apache.webbeans.util.WebBeansUtil;
/**
@@ -49,8 +48,6 @@
{
super(type, returnType);
this.ownerComponent = ownerComponent;
-
- setEnabled(ownerComponent.isEnabled());
}
/**
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanCreator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanCreator.java?rev=896668&r1=896667&r2=896668&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanCreator.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanCreator.java Wed Jan 6 21:02:10 2010
@@ -23,7 +23,6 @@
import org.apache.webbeans.component.AbstractBean;
import org.apache.webbeans.config.DefinitionUtil;
-import org.apache.webbeans.config.OpenWebBeansConfiguration;
import org.apache.webbeans.util.WebBeansUtil;
/**
@@ -59,9 +58,7 @@
public AbstractBeanCreator(AbstractBean<T> bean, Annotation[] beanAnnotations)
{
this.bean = bean;
- this.beanAnnotations = beanAnnotations;
-
- WebBeansUtil.setBeanEnableFlag(bean);
+ this.beanAnnotations = beanAnnotations;
}
/**
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=896668&r1=896667&r2=896668&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java Wed Jan 6 21:02:10 2010
@@ -38,6 +38,7 @@
import javax.interceptor.Interceptor;
import org.apache.webbeans.WebBeansConstants;
+import org.apache.webbeans.component.AbstractBean;
import org.apache.webbeans.component.ManagedBean;
import org.apache.webbeans.component.ProducerFieldBean;
import org.apache.webbeans.component.ProducerMethodBean;
@@ -655,6 +656,10 @@
//Define meta-data
managedBeanCreator.defineSerializable();
managedBeanCreator.defineStereoTypes();
+
+ //Check for Enabled via Alternative
+ WebBeansUtil.setBeanEnableFlag(managedBean);
+
managedBeanCreator.defineApiType();
managedBeanCreator.defineScopeType(logger.getTokenString(OWBLogConst.TEXT_MB_IMPL) + clazz.getName() + logger.getTokenString(OWBLogConst.TEXT_SAME_SCOPE));
managedBeanCreator.defineQualifier();
@@ -767,6 +772,7 @@
*/
protected <T> void defineEnterpriseWebBean(Class<T> clazz)
{
- EJBWebBeansConfigurator.defineEjbBean(clazz);
+ AbstractBean<T> bean = (AbstractBean<T>) EJBWebBeansConfigurator.defineEjbBean(clazz);
+ WebBeansUtil.setBeanEnableFlag(bean);
}
}
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java?rev=896668&r1=896667&r2=896668&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java Wed Jan 6 21:02:10 2010
@@ -625,6 +625,8 @@
defineStereoTypes(component, method.getDeclaredAnnotations());
Annotation[] methodAnns = method.getDeclaredAnnotations();
+
+ WebBeansUtil.setBeanEnableFlagForProducerBean(parent, component, methodAnns);
DefinitionUtil.defineProducerMethodApiTypes(component, method.getGenericReturnType(), methodAnns);
DefinitionUtil.defineScopeType(component, methodAnns, "WebBeans producer method : " + method.getName() + " in class " + parent.getReturnType().getName() + " must declare default @Scope annotation");
@@ -671,6 +673,8 @@
defineStereoTypes(component, field.getDeclaredAnnotations());
Annotation[] fieldAnns = field.getDeclaredAnnotations();
+
+ WebBeansUtil.setBeanEnableFlagForProducerBean(parent, component, fieldAnns);
DefinitionUtil.defineProducerMethodApiTypes(component, field.getGenericType(), fieldAnns);
DefinitionUtil.defineScopeType(component, fieldAnns, "WebBeans producer method : " + field.getName() + " in class " + parent.getReturnType().getName() + " must declare default @Scope annotation");
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AlternativesManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AlternativesManager.java?rev=896668&r1=896667&r2=896668&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AlternativesManager.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AlternativesManager.java Wed Jan 6 21:02:10 2010
@@ -90,6 +90,26 @@
}
}
+ public boolean isClassAlternative(Class<?> clazz)
+ {
+ if(this.alternatives.contains(clazz))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public boolean isStereoAlternative(Class<? extends Annotation> stereo)
+ {
+ if(this.stereoAlternatives.contains(stereo))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
public boolean isBeanHasAlternative(Bean<?> bean)
{
Class<?> returnType = bean.getBeanClass();
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=896668&r1=896667&r2=896668&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java Wed Jan 6 21:02:10 2010
@@ -79,6 +79,7 @@
import org.apache.webbeans.annotation.RequestedScopeLiteral;
import org.apache.webbeans.component.AbstractBean;
import org.apache.webbeans.component.AbstractInjectionTargetBean;
+import org.apache.webbeans.component.AbstractProducerBean;
import org.apache.webbeans.component.BaseBean;
import org.apache.webbeans.component.BeanManagerBean;
import org.apache.webbeans.component.ConversationBean;
@@ -2051,16 +2052,72 @@
}
+ /**
+ * Sets bean enabled flag.
+ * @param bean bean instance
+ */
public static void setBeanEnableFlag(AbstractBean<?> bean)
{
Asserts.assertNotNull(bean, "bean can not be null");
+ boolean alternative = false;
+
if(AnnotationUtil.hasClassAnnotation(bean.getBeanClass(), Alternative.class))
{
+ alternative = true;
+ }
+
+ if(!alternative)
+ {
+ Set<Class<? extends Annotation>> stereotypes = bean.getStereotypes();
+ for(Class<? extends Annotation> stereoType : stereotypes)
+ {
+ if(AnnotationUtil.hasClassAnnotation(stereoType, Alternative.class))
+ {
+ alternative = true;
+ break;
+ }
+ }
+
+ }
+
+ if(alternative)
+ {
if(!AlternativesManager.getInstance().isBeanHasAlternative(bean))
{
bean.setEnabled(false);
}
}
}
+
+ public static void setBeanEnableFlagForProducerBean(AbstractBean<?> parent,AbstractProducerBean<?> producer, Annotation[] annotations)
+ {
+ Asserts.assertNotNull(parent, "parent can not be null");
+ Asserts.assertNotNull(producer, "producer can not be null");
+
+ boolean alternative = false;
+
+ if(AnnotationUtil.hasAnnotation(annotations, Alternative.class))
+ {
+ alternative = true;
+ }
+
+ if(!alternative)
+ {
+ Set<Class<? extends Annotation>> stereotypes = producer.getStereotypes();
+ for(Class<? extends Annotation> stereoType : stereotypes)
+ {
+ if(AnnotationUtil.hasClassAnnotation(stereoType, Alternative.class))
+ {
+ alternative = true;
+ break;
+ }
+ }
+ }
+
+ if(alternative)
+ {
+ producer.setEnabled(parent.isEnabled());
+ }
+ }
}
\ No newline at end of file
Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/Pen.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/Pen.java?rev=896668&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/Pen.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/Pen.java Wed Jan 6 21:02:10 2010
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.newtests.concepts.alternatives.common;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@Qualifier
+public @interface Pen
+{
+
+}
Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/Pen.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/Pencil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/Pencil.java?rev=896668&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/Pencil.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/Pencil.java Wed Jan 6 21:02:10 2010
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.newtests.concepts.alternatives.common;
+
+public class Pencil
+{
+
+}
Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/Pencil.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/PencilProducerBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/PencilProducerBean.java?rev=896668&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/PencilProducerBean.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/PencilProducerBean.java Wed Jan 6 21:02:10 2010
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.newtests.concepts.alternatives.common;
+
+import javax.enterprise.inject.Alternative;
+import javax.enterprise.inject.Produces;
+
+public class PencilProducerBean
+{
+ @Produces @Alternative @Pen
+ public static Pencil pencil = new Pencil();
+}
Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/PencilProducerBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.java?rev=896668&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.java Wed Jan 6 21:02:10 2010
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.newtests.concepts.alternatives.tests;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.util.AnnotationLiteral;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.newtests.AbstractUnitTest;
+import org.apache.webbeans.newtests.concepts.alternatives.common.Pen;
+import org.apache.webbeans.newtests.concepts.alternatives.common.Pencil;
+import org.apache.webbeans.newtests.concepts.alternatives.common.PencilProducerBean;
+import org.junit.Test;
+
+public class AlternativeOnProducerFieldTest extends AbstractUnitTest
+{
+ private static final String PACKAGE_NAME = AlternativeOnProducerFieldTest.class.getPackage().getName();
+
+ public AlternativeOnProducerFieldTest()
+ {
+
+ }
+
+ @Test
+ public void testProducerFieldAlternativeNotEnabled()
+ {
+ Collection<URL> beanXmls = new ArrayList<URL>();
+
+ Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
+ beanClasses.add(PencilProducerBean.class);
+ beanClasses.add(Pencil.class);
+
+ startContainer(beanClasses, beanXmls);
+
+ Set<Bean<?>> beans = getBeanManager().getBeans(Pencil.class, new AnnotationLiteral<Pen>(){});
+ Assert.assertEquals(1, beans.size());
+
+ shutDownContainer();
+ }
+
+}
Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/managed/ProxyFactoryTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/managed/ProxyFactoryTest.java?rev=896668&r1=896667&r2=896668&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/managed/ProxyFactoryTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/managed/ProxyFactoryTest.java Wed Jan 6 21:02:10 2010
@@ -48,7 +48,6 @@
Set<Bean<?>> beans = getBeanManager().getBeans(MyEntityServiceImpl.class);
Assert.assertNotNull(beans);
- @SuppressWarnings("unchecked")
Bean<MyEntityServiceImpl> bean = (Bean<MyEntityServiceImpl>) beans.iterator().next();
Assert.assertNotNull(bean);
@@ -56,5 +55,7 @@
Object reference = getBeanManager().getReference(bean, MyEntityServiceImpl.class, ctx);
Assert.assertNotNull(reference);
+
+ shutDownContainer();
}
}
Added: openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.xml?rev=896668&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.xml (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.xml Wed Jan 6 21:02:10 2010
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<beans>
+ <alternatives>
+ <class>org.apache.webbeans.newtests.concepts.alternatives.common.PencilProducerBean</class>
+ </alternatives>
+</beans>
Propchange: openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.xml
------------------------------------------------------------------------------
svn:eol-style = native