[jboss-cvs] JBossAS SVN: r60664 - in branches/Branch_4_2/ejb3: src/test/org/jboss/ejb3/test/entityexception and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Feb 19 07:18:19 EST 2007


Author: wolfc
Date: 2007-02-19 07:18:19 -0500 (Mon, 19 Feb 2007)
New Revision: 60664

Modified:
   branches/Branch_4_2/ejb3/build-test.xml
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/entityexception/ExceptionTest.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/entityexception/ExceptionTestBean.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/entityexception/unit/EntityExceptionTestCase.java
Log:
Fixed entityexception, except testQuerySingleResultExceptions

Modified: branches/Branch_4_2/ejb3/build-test.xml
===================================================================
--- branches/Branch_4_2/ejb3/build-test.xml	2007-02-19 11:37:11 UTC (rev 60663)
+++ branches/Branch_4_2/ejb3/build-test.xml	2007-02-19 12:18:19 UTC (rev 60664)
@@ -252,7 +252,7 @@
       <pathelement path="${ejb3.dist}/client/ejb3-persistence.jar"/>
       <pathelement path="${ejb3.dist}/client/hibernate-annotations.jar"/>
       <pathelement path="${ejb3.dist}/client/trove.jar"/>
-      <pathelement path="${ejb3.dist}/client/antlr-2.7.6.jar"/>
+      <pathelement path="${ejb3.dist}/client/antlr.jar"/>
    </path>
 
    <!-- The "security" test needs JaasSecurityManagerServiceMBean -->
@@ -2876,6 +2876,7 @@
          </fileset>
       </jar>
 
+<!--
       <jar jarfile="${build.lib}/clusteredsession-test-scoped.jar">
          <fileset dir="${build.classes}">
             <include name="org/jboss/ejb3/test/clusteredsession/**/*.class"/>
@@ -2891,6 +2892,7 @@
              <include name="META-INF/*.xml"/>
          </fileset>
       </jar>
+-->
    </target>
    
    <target name="jars" depends="timestampentity, servicexmbean, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader, 

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/entityexception/ExceptionTest.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/entityexception/ExceptionTest.java	2007-02-19 11:37:11 UTC (rev 60663)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/entityexception/ExceptionTest.java	2007-02-19 12:18:19 UTC (rev 60664)
@@ -38,6 +38,7 @@
    void testEMCreateQueryExceptions();
    void testEMRefreshExceptions();
    void testEMContainsExceptions();
+   void testQueryNonEntity();
    void testQuerySingleResultExceptions();
    void testQuerySetHintAndParameter();
 }

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/entityexception/ExceptionTestBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/entityexception/ExceptionTestBean.java	2007-02-19 11:37:11 UTC (rev 60663)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/entityexception/ExceptionTestBean.java	2007-02-19 12:18:19 UTC (rev 60664)
@@ -274,6 +274,19 @@
       }
    }
    
+   public void testQueryNonEntity()
+   {
+      try
+      {
+         manager.createQuery("from NonEntity");
+         throw new RuntimeException("Expected IllegalArgumentException");
+      }
+      catch(IllegalArgumentException e)
+      {
+         
+      }
+   }
+   
    public void testQuerySetHintAndParameter()
    {
       
@@ -308,8 +321,8 @@
       }
       
       query = manager.createQuery("from Person where id=? and name=?");
-      query.setParameter(0, 1);
-      query.setParameter(1, "XXX");
+      query.setParameter(1, 1);
+      query.setParameter(2, "XXX");
       try
       {
          query.setParameter(-1, "HELLO");
@@ -317,7 +330,12 @@
       }
       catch(IllegalArgumentException e)
       {
+         // spec
       }
+      catch(IndexOutOfBoundsException e)
+      {
+         // current impl
+      }
 
       try
       {
@@ -326,7 +344,12 @@
       }
       catch(IllegalArgumentException e)
       {
+         // spec
       }
+      catch(IndexOutOfBoundsException e)
+      {
+         // current impl
+      }
    }
 
 }

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/entityexception/unit/EntityExceptionTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/entityexception/unit/EntityExceptionTestCase.java	2007-02-19 11:37:11 UTC (rev 60663)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/entityexception/unit/EntityExceptionTestCase.java	2007-02-19 12:18:19 UTC (rev 60664)
@@ -89,6 +89,13 @@
       test.testEMContainsExceptions();
    }
    
+   public void testQueryNonEntity() throws Exception
+   {
+      ExceptionTest test = 
+         (ExceptionTest)getInitialContext().lookup("ExceptionTestBean/remote");
+      test.testQueryNonEntity();
+   }
+   
    public void testQuerySingleResultExceptions()throws Exception
    {
       ExceptionTest test = 




More information about the jboss-cvs-commits mailing list