You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by mi...@apache.org on 2009/05/19 20:51:21 UTC

svn commit: r776411 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query: TestNativeQueryProcedures.java procedure/AbstractProcedureList.java procedure/DerbyProcedureList.java procedure/ProcedureList.java

Author: mikedd
Date: Tue May 19 18:51:21 2009
New Revision: 776411

URL: http://svn.apache.org/viewvc?rev=776411&view=rev
Log:
OPENJPA-918. Committing testcases based on patch provided by B.J. Reed

Added:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/AbstractProcedureList.java
      - copied, changed from r775966, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/ProcedureList.java
Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestNativeQueryProcedures.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/DerbyProcedureList.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/ProcedureList.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestNativeQueryProcedures.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestNativeQueryProcedures.java?rev=776411&r1=776410&r2=776411&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestNativeQueryProcedures.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestNativeQueryProcedures.java Tue May 19 18:51:21 2009
@@ -27,8 +27,9 @@
 import org.apache.openjpa.jdbc.sql.DerbyDictionary;
 import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
 import org.apache.openjpa.persistence.jdbc.query.domain.Applicant;
+import org.apache.openjpa.persistence.jdbc.query.domain.Game;
 import org.apache.openjpa.persistence.jdbc.query.procedure.DerbyProcedureList;
-import org.apache.openjpa.persistence.jdbc.query.procedure.ProcedureList;
+import org.apache.openjpa.persistence.jdbc.query.procedure.AbstractProcedureList;
 import org.apache.openjpa.persistence.test.SingleEMFTestCase;
 
 /**
@@ -36,27 +37,24 @@
  * disallows named parameters.
  * 
  * Originally reported in 
- * <A HRE="http://issues.apache.org/jira/browse/OPENJPA-112>OPENJPA-112</A>
+ * <A HRE="http://issues.apache.org/jira/browse/OPENJPA-918>OPENJPA-918</A>
  *  
- * @author B.J. Reed
- *
  */
 public class TestNativeQueryProcedures extends SingleEMFTestCase {
-    ProcedureList procedureList = null;
+    AbstractProcedureList procedureList = null;
     
     @Override
     public void setUp() throws Exception {
-        super.setUp(Applicant.class, CLEAR_TABLES);
+        super.setUp(Applicant.class, Game.class, CLEAR_TABLES);
 
         // Figure out which DB we have and get the proper DB Procedure List
-        OpenJPAEntityManagerFactorySPI ojpaEmf = 
+        OpenJPAEntityManagerFactorySPI ojpaEmf =
             (OpenJPAEntityManagerFactorySPI) emf;
         JDBCConfiguration conf = (JDBCConfiguration) ojpaEmf.getConfiguration();
-        
         if (conf.getDBDictionaryInstance() instanceof DerbyDictionary) {
             procedureList = new DerbyProcedureList();
         }
-
+        
         if (procedureList != null) {
             EntityManager em = emf.createEntityManager();
             List<String> createList = procedureList.getCreateProcedureList();
@@ -96,7 +94,7 @@
         }
         super.tearDown();
     }
-    
+
     public void testNoReturnNoParamProcedure() {
         if (procedureList != null) {
             EntityManager em = emf.createEntityManager();
@@ -114,15 +112,16 @@
             String sql = procedureList.callAddXToCharlie();
 
             // query.getSingleResult() and query.getResultList() both throw an
-            // exception: Statement.executeQuery() cannot be called with a
-            // statement that returns a row count
+            // exception:
+            // Statement.executeQuery() cannot be called with a statement that
+            // returns a row count
             try {
                 em.getTransaction().begin();
                 Query query = em.createNativeQuery(sql);
                 query.getSingleResult();
                 em.getTransaction().commit();
-                fail("Expected exception. getSingleResult() with no returns "+ 
-                    "should fail.");
+                fail("Expected exception. getSingleResult() with no returns " +
+                		"should fail.");
             } catch (Exception e) {
                 //Expected exception
                 em.getTransaction().rollback();
@@ -132,8 +131,8 @@
                 Query query = em.createNativeQuery(sql);
                 query.getResultList();
                 em.getTransaction().commit();
-                fail("Expected exception. getResultList() with no returns " + 
-                    "should fail.");
+                fail("Expected exception. getResultList() with no returns " +
+                		"should fail.");
             } catch (Exception e) {
                 //Expected exception
                 em.getTransaction().rollback();
@@ -146,13 +145,91 @@
                 query.executeUpdate();
                 em.getTransaction().commit();
             } catch (Exception e) {
+                em.getTransaction().rollback();
                 fail("Caught unexpected exception executing stored procedure: "
                     + e.getMessage());
-                em.getTransaction().commit();
             }
+
+            // refresh the data
+            em.clear();
+            em.close();
+            em = emf.createEntityManager();
+            applicant1 = em.find(Applicant.class, applicant1.getId());
+            applicant2 = em.find(Applicant.class, applicant2.getId());
+
+            // verify one changed and one didn't
+            assertEquals("Charliex", applicant1.getName());
+            assertEquals("Snoopy", applicant2.getName());
         
             em.clear();
             em.close();
+        }
+    }
+
+    public void testNoReturnMultiParamProcedure() {
+        if (procedureList != null) {
+            EntityManager em = emf.createEntityManager();
+
+            Applicant applicant1 = new Applicant();
+            applicant1.setName("Charlie");
+            Applicant applicant2 = new Applicant();
+            applicant2.setName("Snoopy");
+
+            em.getTransaction().begin();
+            em.persist(applicant1);
+            em.persist(applicant2);
+            em.getTransaction().commit();
+
+            String sql = procedureList.callAddSuffixToName();
+
+            // query.getSingleResult() and query.getResultList() both throw an
+            // exception:
+            // Statement.executeQuery() cannot be called with a statement that
+            // returns a row count
+            try {
+                em.getTransaction().begin();
+                Query query = em.createNativeQuery(sql);
+                query.setParameter(1, "Charlie");
+                query.setParameter(2, "x");
+                query.getSingleResult();
+                em.getTransaction().commit();
+                fail("Expected exception. getSingleResult() with no returns " +
+                		"should fail.");
+            } catch (Exception e) {
+                //Expected exception
+                em.getTransaction().rollback();
+            }
+            try {
+                em.getTransaction().begin();
+                Query query = em.createNativeQuery(sql);
+                query.setParameter(1, "Charlie");
+                query.setParameter(2, "x");
+                query.getResultList();
+                em.getTransaction().commit();
+                fail("Expected exception. getResultList() with no returns " +
+                		"should fail.");
+            } catch (Exception e) {
+                //Expected exception
+                em.getTransaction().rollback();
+            }
+
+            // This one should work properly
+            try {
+                em.getTransaction().begin();
+                Query query = em.createNativeQuery(sql);
+                query.setParameter(1, "Charlie");
+                query.setParameter(2, "x");
+                query.executeUpdate();
+                em.getTransaction().commit();
+            } catch (Exception e) {
+                em.getTransaction().rollback();
+                fail("Caught unexpected exception executing stored procedure: "
+                    + e.getMessage());
+            }
+
+            // refresh the data
+            em.clear();
+            em.close();
             em = emf.createEntityManager();
             applicant1 = em.find(Applicant.class, applicant1.getId());
             applicant2 = em.find(Applicant.class, applicant2.getId());
@@ -165,4 +242,152 @@
             em.close();
         }
     }
-}
\ No newline at end of file
+
+    public void testOneReturnNoParamProcedure() {
+        if (procedureList != null) {
+            EntityManager em = emf.createEntityManager();
+
+            Applicant applicant1 = new Applicant();
+            applicant1.setName("Charlie");
+            Applicant applicant2 = new Applicant();
+            applicant2.setName("Snoopy");
+
+            em.getTransaction().begin();
+            em.persist(applicant1);
+            em.getTransaction().commit();
+
+            String sql = procedureList.callGetAllApplicants();
+
+            try {
+                em.getTransaction().begin();
+                Query query = em.createNativeQuery(sql, Applicant.class);
+                Applicant app = (Applicant)query.getSingleResult();
+                em.getTransaction().commit();
+                assertEquals("Charlie", app.getName());
+            } catch (Exception e) {
+                em.getTransaction().rollback();
+                fail("Caught unexpected exception executing stored procedure: "
+                    + e.getMessage());
+            }
+
+            em.getTransaction().begin();
+            em.persist(applicant2);
+            em.getTransaction().commit();
+            
+            try {
+                em.getTransaction().begin();
+                Query query = em.createNativeQuery(sql, Applicant.class);
+                List<Applicant> appList = query.getResultList();
+                em.getTransaction().commit();
+                assertEquals(2, appList.size());
+                for (Applicant a : appList) {
+                    if (!a.getName().equals("Charlie")
+                        && !a.getName().equals("Snoopy"))
+                        fail("found invalid applicant " + a.getName());
+                }
+            } catch (Exception e) {
+                em.getTransaction().rollback();
+                fail("Caught unexpected exception executing stored procedure: "
+                    + e.getMessage());
+            }
+
+            // This one should fail since we are doing select in stead of update
+            try {
+                em.getTransaction().begin();
+                Query query = em.createNativeQuery(sql, Applicant.class);
+                query.executeUpdate();
+                em.getTransaction().commit();
+                fail("Expected exception. executeUpdate() with query procedure "
+                    + "should fail.");
+            } catch (Exception e) {
+                // Expected exception
+                em.getTransaction().rollback();
+            }
+
+            // refresh the data
+            em.clear();
+            em.close();
+            em = emf.createEntityManager();
+        }
+    }
+
+    public void testOneReturnMultiParamProcedure() {
+        if (procedureList != null) {
+            EntityManager em = emf.createEntityManager();
+
+            Applicant applicant1 = new Applicant();
+            applicant1.setName("Charlie");
+            Applicant applicant2 = new Applicant();
+            applicant2.setName("Snoopy");
+            Applicant applicant3 = new Applicant();
+            applicant3.setName("Linus");
+            Applicant applicant4 = new Applicant();
+            applicant4.setName("Lucy");
+
+            em.getTransaction().begin();
+            em.persist(applicant1);
+            em.persist(applicant3);
+            em.persist(applicant4);
+            em.getTransaction().commit();
+
+            String sql = procedureList.callGetTwoApplicants();
+
+            try {
+                em.getTransaction().begin();
+                Query query = em.createNativeQuery(sql, Applicant.class);
+                query.setParameter(1, "Charlie");
+                query.setParameter(2, "Snoopy");
+                Applicant app = (Applicant)query.getSingleResult();
+                em.getTransaction().commit();
+                assertEquals("Charlie", app.getName());
+            } catch (Exception e) {
+                em.getTransaction().rollback();
+                fail("Caught unexpected exception executing stored procedure: "
+                    + e.getMessage());
+            }
+
+            em.getTransaction().begin();
+            em.persist(applicant2);
+            em.getTransaction().commit();
+            
+            try {
+                em.getTransaction().begin();
+                Query query = em.createNativeQuery(sql, Applicant.class);
+                query.setParameter(1, "Charlie");
+                query.setParameter(2, "Snoopy");
+                List<Applicant> appList = query.getResultList();
+                em.getTransaction().commit();
+                assertEquals(2, appList.size());
+                for (Applicant a : appList) {
+                    if (!a.getName().equals("Charlie")
+                        && !a.getName().equals("Snoopy"))
+                        fail("found invalid applicant " + a.getName());
+                }
+            } catch (Exception e) {
+                em.getTransaction().rollback();
+                fail("Caught unexpected exception executing stored procedure: "
+                    + e.getMessage());
+            }
+
+            // This one should fail since we are doing select in stead of update
+            try {
+                em.getTransaction().begin();
+                Query query = em.createNativeQuery(sql, Applicant.class);
+                query.setParameter(1, "Charlie");
+                query.setParameter(2, "Snoopy");
+                query.executeUpdate();
+                em.getTransaction().commit();
+                fail("Expected exception. executeUpdate() with query procedure "
+                    + "should fail.");
+            } catch (Exception e) {
+                // Expected exception
+                em.getTransaction().rollback();
+            }
+
+            // refresh the data
+            em.clear();
+            em.close();
+            em = emf.createEntityManager();
+        }
+    }
+}

Copied: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/AbstractProcedureList.java (from r775966, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/ProcedureList.java)
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/AbstractProcedureList.java?p2=openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/AbstractProcedureList.java&p1=openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/ProcedureList.java&r1=775966&r2=776411&rev=776411&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/ProcedureList.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/AbstractProcedureList.java Tue May 19 18:51:21 2009
@@ -18,24 +18,33 @@
  */
 package org.apache.openjpa.persistence.jdbc.query.procedure;
 
-import java.util.List;
-
 /*
  * holds the stored procedures that will be used by test cases
  */
-public abstract class ProcedureList {
+public abstract class AbstractProcedureList implements ProcedureList {
 
-    abstract public List<String> getCreateProcedureList ();
+    public static void addXToCharlie() throws Exception {
+        Exception e =
+            new Exception("Method not implemented by inheriting class");
+        throw e;
+    }
 
-    abstract public List<String> getDropProcedureList ();
+    public static void addSuffixToName(String name, String suffix)
+        throws Exception {
+        Exception e =
+            new Exception("Method not implemented by inheriting class");
+        throw e;
+    }
 
-    abstract public String callAddXToCharlie ();
+    public static void getAllApplicants() throws Exception {
+        Exception e =
+            new Exception("Method not implemented by inheriting class");
+        throw e;
+    }
 
-    // This method should also be overriden, but it needs to be static so 
-    // that it can be called as a stored procedure
-    public static void addXToCharlie () throws Exception {
-        Exception e = new Exception ("Method not implemented by inheriting " +
-        		"class");
+    public static void getTwoApplicants() throws Exception {
+        Exception e =
+            new Exception("Method not implemented by inheriting class");
         throw e;
     }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/DerbyProcedureList.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/DerbyProcedureList.java?rev=776411&r1=776410&r2=776411&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/DerbyProcedureList.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/DerbyProcedureList.java Tue May 19 18:51:21 2009
@@ -21,21 +21,47 @@
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.PreparedStatement;
+import java.sql.ResultSet;
 import java.util.ArrayList;
 import java.util.List;
 
 /*
  * holds the stored procedures that will be used by test cases
  */
-public class DerbyProcedureList extends ProcedureList {
+public class DerbyProcedureList extends AbstractProcedureList {
 
     public List<String> getCreateProcedureList () {
         ArrayList<String> retList = new ArrayList<String>();
 
-        retList.add ("create procedure ADD_X_TO_CHARLIE () " +
-                     "PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA " +
-                     "EXTERNAL NAME 'org.apache.openjpa.persistence.jdbc." +
-                     "query.procedure.DerbyProcedureList.addXToCharlie'");
+        retList.add("create procedure ADD_X_TO_CHARLIE () "
+            + "PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA "
+            + "EXTERNAL NAME '" + DerbyProcedureList.class.getName()
+            + ".addXToCharlie'");
+        retList.add("create procedure ADD_SUFFIX_TO_NAME (NAME VARCHAR(128), "
+            + "SUFFIX VARCHAR(128)) "
+            + "PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA "
+            + "EXTERNAL NAME '" + DerbyProcedureList.class.getName()
+            + ".addSuffixToName'");
+        retList.add("create procedure GET_ALL_APPLICANTS () "
+            + "PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC "
+            + "RESULT SETS 1 " + "EXTERNAL NAME '"
+            + DerbyProcedureList.class.getName() + ".getAllApplicants'");
+        retList.add("create procedure GET_TWO_APPLICANTS (NAME VARCHAR(128), "
+            + "SUFFIX VARCHAR(128)) "
+            + "PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC "
+            + "RESULT SETS 1 " + "EXTERNAL NAME '"
+            + DerbyProcedureList.class.getName() + ".getTwoApplicants'");
+        retList.add("create procedure GET_ALL_APPLICANTS_AND_GAMES () "
+            + "PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC "
+            + "RESULT SETS 2 " + "EXTERNAL NAME '"
+            + DerbyProcedureList.class.getName()
+            + ".getAllApplicantsAndGames'");
+        retList.add("create procedure GET_TWO_APPLICANTS_AND_GAMES "
+            + "(NAME VARCHAR(128), SUFFIX VARCHAR(128)) "
+            + "PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC "
+            + "RESULT SETS 2 " + "EXTERNAL NAME '"
+            + DerbyProcedureList.class.getName()
+            + ".getTwoApplicantsAndGames'");
 
         return retList;
     }
@@ -44,6 +70,11 @@
         ArrayList<String> retList = new ArrayList<String>();
 
         retList.add ("drop procedure ADD_X_TO_CHARLIE");
+        retList.add ("drop procedure ADD_SUFFIX_TO_NAME");
+        retList.add ("drop procedure GET_ALL_APPLICANTS");
+        retList.add ("drop procedure GET_TWO_APPLICANTS");
+        retList.add ("drop procedure GET_ALL_APPLICANTS_AND_GAMES");
+        retList.add ("drop procedure GET_TWO_APPLICANTS_AND_GAMES");
 
         return retList;
     }
@@ -52,13 +83,105 @@
         return "{ call ADD_X_TO_CHARLIE () }";
     }
 
-    public static void addXToCharlie () throws Exception {
-        Connection conn = DriverManager.getConnection("jdbc:default:" +
-        		"connection");
-        PreparedStatement ps1 = conn.prepareStatement("update APPLICANT set" +
-        		" name = 'Charliex' where name = 'Charlie'");
+    public static void addXToCharlie() throws Exception {
+        Connection conn =
+            DriverManager.getConnection("jdbc:default:connection");
+        PreparedStatement ps1 =
+            conn
+                .prepareStatement("update APPLICANT set name = 'Charliex' " 
+                    + "where name = 'Charlie'");
         ps1.executeUpdate();
 
         conn.close();
     }
+
+    public String callAddSuffixToName () {
+        return "{ call ADD_SUFFIX_TO_NAME (?, ?) }";
+    }
+
+    public static void addSuffixToName(String name, String suffix)
+        throws Exception {
+        Connection conn =
+            DriverManager.getConnection("jdbc:default:connection");
+        PreparedStatement ps1 =
+            conn.prepareStatement("update APPLICANT set name = ? "
+                + "where name = ?");
+        ps1.setString(1, name + suffix);
+        ps1.setString(2, name);
+        ps1.executeUpdate();
+
+        conn.close();
+    }
+
+    public String callGetAllApplicants () {
+        return "{ call GET_ALL_APPLICANTS () }";
+    }
+
+    public static void getAllApplicants(ResultSet[] rs1) throws Exception {
+        Connection conn =
+            DriverManager.getConnection("jdbc:default:connection");
+        PreparedStatement ps1 =
+            conn.prepareStatement("select * from APPLICANT");
+        rs1[0] = ps1.executeQuery();
+
+        conn.close();
+    }
+
+    public String callGetTwoApplicants () {
+        return "{ call GET_TWO_APPLICANTS (?, ?) }";
+    }
+
+    public static void getTwoApplicants(String name1, String name2,
+        ResultSet[] rs1) throws Exception {
+        Connection conn =
+            DriverManager.getConnection("jdbc:default:connection");
+        PreparedStatement ps1 =
+            conn.prepareStatement("select * from APPLICANT where name = ? "
+                + "or name = ?");
+        ps1.setString(1, name1);
+        ps1.setString(2, name2);
+        rs1[0] = ps1.executeQuery();
+
+        conn.close();
+    }
+
+    public String callGetAllApplicantsAndGames () {
+        return "{ call GET_ALL_APPLICANTS_AND_GAMES () }";
+    }
+
+    public static void getAllApplicantsAndGames(ResultSet[] rs1, 
+        ResultSet[] rs2)
+        throws Exception {
+        Connection conn =
+            DriverManager.getConnection("jdbc:default:connection");
+        PreparedStatement ps1 =
+            conn.prepareStatement("select * from APPLICANT");
+        rs1[0] = ps1.executeQuery();
+
+        PreparedStatement ps2 = conn.prepareStatement("select * from GAME");
+        rs2[0] = ps2.executeQuery();
+
+        conn.close();
+    }
+
+//    public String callGetTwoApplicantsAndGames () {
+//        return "{ call GET_TWO_APPLICANTS_AND_GAMES (?, ?) }";
+//    }
+//
+//    public static void getTwoApplicantsAndGames(String name1, String name2,
+//        ResultSet[] rs1, ResultSet[] rs2) throws Exception {
+//        Connection conn =
+//            DriverManager.getConnection("jdbc:default:connection");
+//        PreparedStatement ps1 =
+//            conn.prepareStatement("select * from APPLICANT where name = ?");
+//        ps1.setString(1, name1);
+//        rs1[0] = ps1.executeQuery();
+//
+//        PreparedStatement ps2 =
+//            conn.prepareStatement("select * from GAME where name = ?");
+//        ps2.setString(2, name2);
+//        rs2[0] = ps2.executeQuery();
+//
+//        conn.close();
+//    }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/ProcedureList.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/ProcedureList.java?rev=776411&r1=776410&r2=776411&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/ProcedureList.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/procedure/ProcedureList.java Tue May 19 18:51:21 2009
@@ -20,22 +20,16 @@
 
 import java.util.List;
 
-/*
- * holds the stored procedures that will be used by test cases
- */
-public abstract class ProcedureList {
-
-    abstract public List<String> getCreateProcedureList ();
-
-    abstract public List<String> getDropProcedureList ();
-
-    abstract public String callAddXToCharlie ();
-
-    // This method should also be overriden, but it needs to be static so 
-    // that it can be called as a stored procedure
-    public static void addXToCharlie () throws Exception {
-        Exception e = new Exception ("Method not implemented by inheriting " +
-        		"class");
-        throw e;
-    }
+public interface ProcedureList {
+    public List<String> getCreateProcedureList();
+
+    public List<String> getDropProcedureList();
+
+    public String callAddXToCharlie();
+
+    public String callAddSuffixToName();
+
+    public String callGetAllApplicants();
+
+    public String callGetTwoApplicants();
 }