[weld-commits] Weld SVN: r5476 - in servlet/trunk: tests/src/test/java/org/jboss/weld/test/tomcat/examples and 1 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Fri Jan 15 08:41:31 EST 2010


Author: shane.bryzak at jboss.com
Date: 2010-01-15 08:41:30 -0500 (Fri, 15 Jan 2010)
New Revision: 5476

Modified:
   servlet/trunk/pom.xml
   servlet/trunk/tests/src/test/java/org/jboss/weld/test/tomcat/examples/ExampleTest.java
   servlet/trunk/tests/src/test/java/org/jboss/weld/test/tomcat/examples/MockExampleTest.java
   servlet/trunk/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/LookupTest.java
Log:
fixed tests, use weld 1.0.0-SNAPSHOT


Modified: servlet/trunk/pom.xml
===================================================================
--- servlet/trunk/pom.xml	2010-01-15 12:32:58 UTC (rev 5475)
+++ servlet/trunk/pom.xml	2010-01-15 13:41:30 UTC (rev 5476)
@@ -49,7 +49,7 @@
 
    <properties>
       <weld.api.version>1.0</weld.api.version>
-      <weld.core.version>1.0.0</weld.core.version>
+      <weld.core.version>1.0.1-SNAPSHOT</weld.core.version>
       <!-- Use JSF 2 for all extensions support, despite core using JSF 1.2 -->
       <jsf.version>2.0.0-RC</jsf.version>
       <tomcat.version>6.0.20</tomcat.version>

Modified: servlet/trunk/tests/src/test/java/org/jboss/weld/test/tomcat/examples/ExampleTest.java
===================================================================
--- servlet/trunk/tests/src/test/java/org/jboss/weld/test/tomcat/examples/ExampleTest.java	2010-01-15 12:32:58 UTC (rev 5475)
+++ servlet/trunk/tests/src/test/java/org/jboss/weld/test/tomcat/examples/ExampleTest.java	2010-01-15 13:41:30 UTC (rev 5476)
@@ -2,6 +2,7 @@
 
 import org.jboss.testharness.impl.packaging.Artifact;
 import org.jboss.weld.test.AbstractWeldTest;
+import org.jboss.weld.test.Utils;
 import org.jboss.weld.test.harness.ServletLifecycleContainersImpl;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
@@ -13,12 +14,12 @@
    @Test
    public void testGameGenerator() throws Exception 
    {
-      Game game1 = getCurrentManager().getInstanceByType(Game.class);
-      Game game2 = getCurrentManager().getInstanceByType(Game.class);
+      Game game1 = Utils.getReference(getCurrentManager(), Game.class);
+      Game game2 = Utils.getReference(getCurrentManager(), Game.class);
       assert game1!=game2;
       assert game1.getNumber()!=game2.getNumber();
-      Generator gen1 = getCurrentManager().getInstanceByType(Generator.class);
-      Generator gen2 = getCurrentManager().getInstanceByType(Generator.class);
+      Generator gen1 = Utils.getReference(getCurrentManager(), Generator.class);
+      Generator gen2 = Utils.getReference(getCurrentManager(), Generator.class);
       assert gen1.getRandom()!=null;
       assert gen1.getRandom()==gen2.getRandom();
    }
@@ -27,7 +28,7 @@
    public void testSentenceTranslator() throws Exception 
    {
         
-      TextTranslator tt1 = getCurrentManager().getInstanceByType(TextTranslator.class);
+      TextTranslator tt1 = Utils.getReference(getCurrentManager(), TextTranslator.class);
       try 
       {
          tt1.translate("hello world");

Modified: servlet/trunk/tests/src/test/java/org/jboss/weld/test/tomcat/examples/MockExampleTest.java
===================================================================
--- servlet/trunk/tests/src/test/java/org/jboss/weld/test/tomcat/examples/MockExampleTest.java	2010-01-15 12:32:58 UTC (rev 5475)
+++ servlet/trunk/tests/src/test/java/org/jboss/weld/test/tomcat/examples/MockExampleTest.java	2010-01-15 13:41:30 UTC (rev 5476)
@@ -3,6 +3,7 @@
 import org.jboss.testharness.impl.packaging.Artifact;
 import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
 import org.jboss.weld.test.AbstractWeldTest;
+import org.jboss.weld.test.Utils;
 import org.testng.annotations.Test;
 
 @Artifact
@@ -13,7 +14,7 @@
    @Test
    public void testMockSentenceTranslator() throws Exception 
    {   
-      TextTranslator tt2 = getCurrentManager().getInstanceByType(TextTranslator.class);
+      TextTranslator tt2 = Utils.getReference(getCurrentManager(), TextTranslator.class);
       assert "Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.".equals( tt2.translate("Hello world. How's tricks?") );
    }
    

Modified: servlet/trunk/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/LookupTest.java
===================================================================
--- servlet/trunk/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/LookupTest.java	2010-01-15 12:32:58 UTC (rev 5475)
+++ servlet/trunk/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/LookupTest.java	2010-01-15 13:41:30 UTC (rev 5476)
@@ -8,6 +8,7 @@
 import org.jboss.testharness.impl.packaging.Resource;
 import org.jboss.testharness.impl.packaging.Resources;
 import org.jboss.weld.test.AbstractWeldTest;
+import org.jboss.weld.test.Utils;
 import org.testng.annotations.Test;
 
 @Artifact(addCurrentPackage=false)
@@ -22,15 +23,15 @@
    @Test
    public void testManagerInJndi() throws Exception 
    {
-      assert getCurrentManager().getInstanceByType(Mouse.class).getManager() != null;
-      assert getCurrentManager().getInstanceByType(Mouse.class).getManager().equals(getCurrentManager());
+      assert Utils.getReference(getCurrentManager(),Mouse.class).getManager() != null;
+      assert Utils.getReference(getCurrentManager(),Mouse.class).getManager().equals(getCurrentManager());
    }
      
    @Test
    public void testResource() throws Exception 
    {
-      assert getCurrentManager().getInstanceByType(Vole.class).getManager() != null;
-      assert getCurrentManager().getInstanceByType(Vole.class).getManager().equals(getCurrentManager());
+      assert Utils.getReference(getCurrentManager(),Vole.class).getManager() != null;
+      assert Utils.getReference(getCurrentManager(),Vole.class).getManager().equals(getCurrentManager());
    }
    
 }



More information about the weld-commits mailing list