[jboss-cvs] jboss-seam/src/test/unit/org/jboss/seam/test/unit ...

Norman Richards norman.richards at jboss.com
Mon Nov 12 13:54:03 EST 2007


  User: nrichards
  Date: 07/11/12 13:54:03

  Modified:    src/test/unit/org/jboss/seam/test/unit    NamespaceTest.java
                        testng.xml
  Added:       src/test/unit/org/jboss/seam/test/unit    ImportTest.java
  Log:
  JBSEAM-2188
  
  Revision  Changes    Path
  1.2       +14 -12    jboss-seam/src/test/unit/org/jboss/seam/test/unit/NamespaceTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NamespaceTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/test/unit/org/jboss/seam/test/unit/NamespaceTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- NamespaceTest.java	12 Oct 2007 05:08:00 -0000	1.1
  +++ NamespaceTest.java	12 Nov 2007 18:54:03 -0000	1.2
  @@ -27,7 +27,7 @@
           new ComponentTest() {
               @Override
               protected void testComponents() throws Exception {
  -                assert getValue("#{elTest.fooFactory}") != null;
  +                assert getValue("#{namespaceTest.fooFactory}") != null;
               }
           }.run();
       }
  @@ -39,7 +39,7 @@
           new ComponentTest() {
               @Override
               protected void testComponents() throws Exception {
  -                assert getValue("#{elTest.ns1.factory}") != null;
  +                assert getValue("#{namespaceTest.ns1.factory}") != null;
               }
           }.run();
       }
  @@ -52,9 +52,9 @@
           new ComponentTest() {
               @Override
               protected void testComponents() throws Exception {
  -                FooFactory factory = (FooFactory) getValue("#{elTest.fooFactory}");
  +                FooFactory factory = (FooFactory) getValue("#{namespaceTest.fooFactory}");
                   factory.someMethod();
  -                assert getValue("#{elTest.ns2.outject}") != null;
  +                assert getValue("#{namespaceTest.ns2.outject}") != null;
               }
           }.run();
       }
  @@ -68,9 +68,9 @@
               @Override
               protected void testComponents() throws Exception {
                   Init init = Init.instance();
  -                init.addFactoryMethodExpression("elTest.ns3.factory", "#{elTest.fooFactory.createFoo}", ScopeType.SESSION);
  +                init.addFactoryMethodExpression("namespaceTest.ns3.factory", "#{namespaceTest.fooFactory.createFoo}", ScopeType.SESSION);
                   
  -                assert getValue("#{elTest.ns3.factory}") != null;
  +                assert getValue("#{namespaceTest.ns3.factory}") != null;
               }
           }.run();
       }
  @@ -83,24 +83,24 @@
               @Override
               protected void testComponents() throws Exception {
                   Init init = Init.instance();
  -                init.addFactoryValueExpression("elTest.ns4.factory", "#{elTest.fooFactory.createFoo()}", ScopeType.SESSION);
  +                init.addFactoryValueExpression("namespaceTest.ns4.factory", "#{namespaceTest.fooFactory.createFoo()}", ScopeType.SESSION);
                   
  -                assert getValue("#{elTest.ns4.factory}") != null;
  +                assert getValue("#{namespaceTest.ns4.factory}") != null;
               }
           }.run();
       }
   
   
  -    @Name("elTest.fooFactory")
  +    @Name("namespaceTest.fooFactory")
       static public class FooFactory {
           public class Foo {}
           
  -        @Factory("elTest.ns1.factory")
  +        @Factory("namespaceTest.ns1.factory")
           public Foo createFoo() {
               return new Foo();
           }        
   
  -        @Out("elTest.ns2.outject")
  +        @Out("namespaceTest.ns2.outject")
           public Foo outjectFoo() {
               return new Foo();
           }
  @@ -109,4 +109,6 @@
           }
       }
      
  +
  +
   }
  
  
  
  1.5       +1 -0      jboss-seam/src/test/unit/org/jboss/seam/test/unit/testng.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: testng.xml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/test/unit/org/jboss/seam/test/unit/testng.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- testng.xml	15 Oct 2007 11:02:48 -0000	1.4
  +++ testng.xml	12 Nov 2007 18:54:03 -0000	1.5
  @@ -22,6 +22,7 @@
          <class name="org.jboss.seam.test.unit.PageActionsTest" />
          <class name="org.jboss.seam.test.unit.HomeTest" />
          <class name="org.jboss.seam.test.unit.NamespaceTest" />
  +       <class name="org.jboss.seam.test.unit.ImportTest"/>
          <class name="org.jboss.seam.test.unit.web.MultipartRequestTest" />
        </classes>
      </test>
  
  
  
  1.1      date: 2007/11/12 18:54:03;  author: nrichards;  state: Exp;jboss-seam/src/test/unit/org/jboss/seam/test/unit/ImportTest.java
  
  Index: ImportTest.java
  ===================================================================
  package org.jboss.seam.test.unit;
  
  import org.jboss.seam.annotations.Factory;
  import org.jboss.seam.annotations.Import;
  import org.jboss.seam.annotations.In;
  import org.jboss.seam.annotations.Name;
  import org.jboss.seam.mock.SeamTest;
  import org.testng.annotations.Test;
  
  public class ImportTest
      extends SeamTest
  {
  
      @Override
      protected void startJbossEmbeddedIfNecessary() 
            throws org.jboss.deployers.spi.DeploymentException,
                   java.io.IOException 
      {
         // don't deploy
      }
      
      @Test
      public void testImport() 
          throws Exception 
      {
          
          new FacesRequest() {
              @Override
              protected void invokeApplication()
                  throws Exception
              {
                  assert getValue("#{importTest.otherValue}").equals("foobar2");                 
              }        
          }.run();
      }
     
      
      @Name("importTest")
      @Import("importTest.ns2")
      public static class Importer {
          @In
          String otherValue;
  
          public String getOtherValue() {
              return otherValue;
          }
  
          @Factory(value="importTest.ns2.otherValue", autoCreate=true)
          public String createOtherValue() {
              return "foobar2";
          }
      }
  
  }
  
  
  



More information about the jboss-cvs-commits mailing list