openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r916375 - in /openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests: AbstractUnitTest.java profields/GetterStringInjectorTest.java
Date Thu, 25 Feb 2010 17:52:24 GMT
Author: gerdogdu
Date: Thu Feb 25 17:52:24 2010
New Revision: 916375

URL: http://svn.apache.org/viewvc?rev=916375&view=rev
Log:
[OWB-304] Test is imlemented in a wrong way. Test is corrected and no problem has observed.

Modified:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/GetterStringInjectorTest.java

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java?rev=916375&r1=916374&r2=916375&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java
Thu Feb 25 17:52:24 2010
@@ -103,7 +103,7 @@
     {
         Set<Bean<?>> beans = getBeanManager().getBeans(type, qualifiers);
         Assert.assertNotNull(beans);
-        Assert.assertTrue("resolving bean with type" + type + " is ambiguous!", beans.size()
== 1);
+        Assert.assertTrue("resolving bean with type" + type + " is ambiguous or bean is not
found!", beans.size() == 1);
         
         Bean<T> bean = (Bean<T>) beans.iterator().next();
         

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/GetterStringInjectorTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/GetterStringInjectorTest.java?rev=916375&r1=916374&r2=916375&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/GetterStringInjectorTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/profields/GetterStringInjectorTest.java
Thu Feb 25 17:52:24 2010
@@ -26,11 +26,13 @@
 
 import junit.framework.Assert;
 
+import org.apache.webbeans.annotation.DefaultLiteral;
 import org.apache.webbeans.annotation.NamedLiteral;
 import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.newtests.profields.beans.GetterStringFieldInjector;
 import org.apache.webbeans.newtests.profields.beans.GetterStringProducerBean;
 import org.apache.webbeans.newtests.profields.beans.InformationConsumerBean;
+import org.apache.webbeans.newtests.profields.beans.StringProducerBean;
 import org.junit.Test;
 
 public class GetterStringInjectorTest extends AbstractUnitTest
@@ -44,6 +46,7 @@
         Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
         beanClasses.add(GetterStringProducerBean.class);
         beanClasses.add(GetterStringFieldInjector.class);
+        beanClasses.add(StringProducerBean.class);
         beanClasses.add(InformationConsumerBean.class);
         
         startContainer(beanClasses, beanXmls);   
@@ -53,7 +56,13 @@
         
         Assert.assertEquals("Sucess from getProducts",injector.getTestNamed3());
         
-        InformationConsumerBean icb = getInstance(InformationConsumerBean.class, new NamedLiteral("ProMethodNamed1"));
+        String icb = getInstance(String.class, new NamedLiteral("ProMethodNamed1"));
+        Assert.assertEquals(icb, "Sucess from ProMethodNamed1");
+        
+        InformationConsumerBean cb = getInstance(InformationConsumerBean.class, new DefaultLiteral());
+        Assert.assertNotNull(cb);
+        
+        Assert.assertEquals(cb.getProMethodString(), "Sucess from ProMethodNamed1");
         
         shutDownContainer();
     }



Mime
View raw message