openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1308072 - in /openwebbeans/trunk/webbeans-impl/src/test: java/org/apache/webbeans/newtests/concepts/alternatives/common/ java/org/apache/webbeans/newtests/concepts/alternatives/tests/ resources/org/apache/webbeans/newtests/concepts/alterna...
Date Sun, 01 Apr 2012 11:03:26 GMT
Author: struberg
Date: Sun Apr  1 11:03:26 2012
New Revision: 1308072

URL: http://svn.apache.org/viewvc?rev=1308072&view=rev
Log:
OWB-658 further AlternativeTest cleanup

Modified:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/AlternativeBeanProducer3.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/AlternativeBeanProducer4.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/DefaultBeanProducerWithoutDisposes.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/IProducedBean.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/QualifierProducerBased.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/tests/Alternative2Test.java
    openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.xml

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/AlternativeBeanProducer3.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/AlternativeBeanProducer3.java?rev=1308072&r1=1308071&r2=1308072&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/AlternativeBeanProducer3.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/AlternativeBeanProducer3.java
Sun Apr  1 11:03:26 2012
@@ -22,18 +22,20 @@ import javax.enterprise.inject.Alternati
 import javax.enterprise.inject.Produces;
 
 @Alternative
-public class AlternativeBeanProducer3 {
-	
-	public @Produces
-	@Alternative
-	@QualifierProducerBased
-	IProducedBean generateBean3() {
-		return new ProducedBean("alternative3", this);
-	}
+public class AlternativeBeanProducer3
+{
 
-	/*
-	public void dumpBean3(@Disposes @QualifierProducerBased IProducedBean bean) {
-			System.out.println(bean + " is dumped in dumpBean3().");	
-	}
-	*/
+    public @Produces
+    @Alternative
+    @QualifierProducerBased
+    IProducedBean generateBean3()
+    {
+        return new ProducedBean("alternative3", this);
+    }
+
+    /*
+     public void dumpBean3(@Disposes @QualifierProducerBased IProducedBean bean) {
+             System.out.println(bean + " is dumped in dumpBean3().");
+     }
+     */
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/AlternativeBeanProducer4.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/AlternativeBeanProducer4.java?rev=1308072&r1=1308071&r2=1308072&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/AlternativeBeanProducer4.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/AlternativeBeanProducer4.java
Sun Apr  1 11:03:26 2012
@@ -21,20 +21,21 @@ package org.apache.webbeans.newtests.con
 import javax.enterprise.inject.Alternative;
 import javax.enterprise.inject.Produces;
 
-
 @Alternative
-public class AlternativeBeanProducer4 {
-	
-	public @Produces
-	@Alternative
-	@QualifierProducerBased
-	IProducedBean generateBean4() {
-		return new ProducedBean("alternative4", this);
-	}
+public class AlternativeBeanProducer4
+{
+
+    public @Produces
+    @Alternative
+    @QualifierProducerBased
+    IProducedBean generateBean4()
+    {
+        return new ProducedBean("alternative4", this);
+    }
 
-	/*
-	public void dumpBean4(@Disposes @QualifierProducerBased IProducedBean bean) {
-			System.out.println(bean + " is dumped in dumpBean4().");	
-	}
-	*/
+    /*
+     public void dumpBean4(@Disposes @QualifierProducerBased IProducedBean bean) {
+             System.out.println(bean + " is dumped in dumpBean4().");
+     }
+     */
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/DefaultBeanProducerWithoutDisposes.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/DefaultBeanProducerWithoutDisposes.java?rev=1308072&r1=1308071&r2=1308072&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/DefaultBeanProducerWithoutDisposes.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/DefaultBeanProducerWithoutDisposes.java
Sun Apr  1 11:03:26 2012
@@ -20,11 +20,13 @@ package org.apache.webbeans.newtests.con
 
 import javax.enterprise.inject.Produces;
 
-public class DefaultBeanProducerWithoutDisposes {
-	
-	public @Produces @QualifierProducerBased IProducedBean 
-	generateBean() {
-		return new ProducedBean("defaultwithoutdisposes", this);
-	}
+public class DefaultBeanProducerWithoutDisposes
+{
+
+    public @Produces @QualifierProducerBased
+    IProducedBean generateBean()
+    {
+        return new ProducedBean("defaultwithoutdisposes", this);
+    }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/IProducedBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/IProducedBean.java?rev=1308072&r1=1308071&r2=1308072&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/IProducedBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/IProducedBean.java
Sun Apr  1 11:03:26 2012
@@ -27,5 +27,4 @@ public interface IProducedBean
     public String getProducerID();
 
     public String getProducerType();
-
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/QualifierProducerBased.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/QualifierProducerBased.java?rev=1308072&r1=1308071&r2=1308072&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/QualifierProducerBased.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/common/QualifierProducerBased.java
Sun Apr  1 11:03:26 2012
@@ -28,6 +28,7 @@ import javax.inject.Qualifier;
 @Qualifier
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ElementType.TYPE, ElementType.PARAMETER, ElementType.METHOD,ElementType.CONSTRUCTOR,ElementType.FIELD})
-public @interface QualifierProducerBased {
+public @interface QualifierProducerBased
+{
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/tests/Alternative2Test.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/tests/Alternative2Test.java?rev=1308072&r1=1308071&r2=1308072&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/tests/Alternative2Test.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/alternatives/tests/Alternative2Test.java
Sun Apr  1 11:03:26 2012
@@ -39,13 +39,14 @@ import org.junit.Test;
 public class Alternative2Test  extends AbstractUnitTest {
 
     @Test
-    @SuppressWarnings("unchecked")
     public void testDisposerMethodInAlternativeBean()
     {
         Collection<String> beanXmls = new ArrayList<String>();
         
         Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
         beanClasses.add(DefaultBeanProducer.class);
+
+        // available but not enabled in beans.xml
         beanClasses.add(AlternativeBeanProducer2.class);
         
         startContainer(beanClasses, beanXmls);        
@@ -55,14 +56,11 @@ public class Alternative2Test  extends A
         {
         };
 
-        Set beans = getBeanManager().getBeans(IProducedBean.class, anns);
-        Bean<IProducedBean> bean = (Bean<IProducedBean>)beans.iterator().next();
-        CreationalContext<IProducedBean> cc = getBeanManager().createCreationalContext(bean);
-        IProducedBean producedBean = (IProducedBean) getBeanManager().getReference(bean,
IProducedBean.class, cc);
+        IProducedBean producedBean = getInstance(IProducedBean.class, anns);
+        Assert.assertNotNull(producedBean);
+        Assert.assertEquals("default", producedBean.getProducerType());
 
         shutDownContainer();
-        
-        Assert.assertTrue(Boolean.TRUE);
     }
 
 }

Modified: 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=1308072&r1=1308071&r2=1308072&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.xml
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/concepts/alternatives/tests/AlternativeOnProducerFieldTest.xml
Sun Apr  1 11:03:26 2012
@@ -18,7 +18,7 @@ specific language governing permissions 
 under the License.
 -->
 <beans>
-	<alternatives>
-		<class>org.apache.webbeans.newtests.concepts.alternatives.common.PencilProducerBean</class>
-	</alternatives>
+    <alternatives>
+        <class>org.apache.webbeans.newtests.concepts.alternatives.common.PencilProducerBean</class>
+    </alternatives>
 </beans>



Mime
View raw message