[jboss-cvs] jboss-seam/src/test/integration/src/org/jboss/seam/test/integration/bpm ...

Peter Muir peter at bleepbleep.org.uk
Wed Nov 28 13:03:56 EST 2007


  User: pmuir   
  Date: 07/11/28 13:03:56

  Modified:    src/test/integration/src/org/jboss/seam/test/integration/bpm  
                        SeamExpressionEvaluatorTestController.java
                        SeamExpressionEvaluatorTest.java
  Log:
  JBSEAM-2152 - ugh
  
  Revision  Changes    Path
  1.2       +6 -1      jboss-seam/src/test/integration/src/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTestController.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SeamExpressionEvaluatorTestController.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/test/integration/src/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTestController.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- SeamExpressionEvaluatorTestController.java	24 Nov 2007 23:25:11 -0000	1.1
  +++ SeamExpressionEvaluatorTestController.java	28 Nov 2007 18:03:56 -0000	1.2
  @@ -10,7 +10,12 @@
      
      
      @CreateProcess(definition="TestProcess2") 
  -   public void createProcess() 
  +   public void createProcess2() 
  +   {            
  +   }
  +   
  +   @CreateProcess(definition="TestProcess3") 
  +   public void createProcess3() 
      {            
      }
      
  
  
  
  1.2       +42 -2     jboss-seam/src/test/integration/src/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SeamExpressionEvaluatorTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/test/integration/src/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- SeamExpressionEvaluatorTest.java	24 Nov 2007 23:25:11 -0000	1.1
  +++ SeamExpressionEvaluatorTest.java	28 Nov 2007 18:03:56 -0000	1.2
  @@ -1,6 +1,7 @@
   package org.jboss.seam.test.integration.bpm;
   
   import org.jboss.seam.mock.SeamTest;
  +import org.jbpm.jpdl.el.ELException;
   import org.testng.annotations.Test;
   
   /**
  @@ -12,7 +13,7 @@
   
      // Test for JBSEAM-1937
      @Test
  -   public void testEvaluate() throws Exception
  +   public void testValueExpression() throws Exception
      {
         String cid = new FacesRequest()
         {
  @@ -20,10 +21,49 @@
            @Override
            protected void invokeApplication() throws Exception
            {
  -            invokeAction("#{seamExpressionEvaluatorTestController.createProcess}");
  +            invokeAction("#{seamExpressionEvaluatorTestController.createProcess2}");
            }
             
         }.run();
      }
      
  +   // Test for JBSEAM-2152
  +   @Test
  +   public void testMissingMethod() throws Exception
  +   {
  +      String cid = new FacesRequest()
  +      {
  +
  +         @Override
  +         protected void invokeApplication() throws Exception
  +         {
  +            try
  +            {
  +               invokeAction("#{seamExpressionEvaluatorTestController.createProcess3}");
  +            }
  +            catch (Exception e)
  +            {
  +               if (!isRootCause(e, ELException.class))
  +               {
  +                  e.printStackTrace();
  +                  assert false;
  +               }
  +            }
  +         }
  +          
  +      }.run();
  +   }
  +   
  +   private static boolean isRootCause(Throwable t, Class clazz)
  +   {
  +      for (Throwable cause = t.getCause(); cause != null && cause != cause.getCause(); cause = cause.getCause())
  +      {
  +         if (clazz.isAssignableFrom(cause.getClass()))
  +         {
  +            return true;
  +         }
  +      }
  +      return false;
  +   }
  +   
   }
  
  
  



More information about the jboss-cvs-commits mailing list