db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fuzzylo...@apache.org
Subject svn commit: r532853 [1/2] - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/ master/DerbyNet/ master/DerbyNet/ibm14/ master/DerbyNet/ibm15/ master/DerbyNet/jdk14/ master/DerbyNet/jdk15/ master/DerbyNet/jdk16/ master/D...
Date Thu, 26 Apr 2007 20:41:18 GMT
Author: fuzzylogic
Date: Thu Apr 26 13:41:16 2007
New Revision: 532853

URL: http://svn.apache.org/viewvc?view=rev&rev=532853
Log:
Convert ieptests, iepnegativetests, and checkSecMgr to JUnit. Remove unneeded
masters and empty directories, minor improvement to SQLToJunit to prevent
multiple line SQL statements from becoming malformed in conversion.

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/CheckSecurityManager.java
      - copied, changed from r532833, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/checkSecMgr.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ImportExportProcedureTest.java
  (with props)
Removed:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ibm14/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ibm15/checkSecMgr.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ieptests.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk14/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk15/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/ibm14/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/ibm15/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/ieptests.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk15/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkSecMgr.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/iepnegativetests.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ieptests.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk14/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk15/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/checkSecMgr.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/iepnegativetests.sql
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/iepnegativetests_app.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ieptests.sql
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ieptests_app.properties
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientRemote.exclude
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetRemote.exclude
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/_Suite.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/_Suite.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/SQLToJUnit.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientRemote.exclude
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientRemote.exclude?view=diff&rev=532853&r1=532852&r2=532853
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientRemote.exclude
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientRemote.exclude
Thu Apr 26 13:41:16 2007
@@ -19,7 +19,6 @@
 # derbynet/testProperties - tries to use NetworkServerControl statements
 # derbynet/timeslice - tries to use NetworkServerControl statements
 # derbynet/DerbyNetAutoStart - tries to start networkserver
-# tools/ieptests - names files in extin dir, but they are on the server
 # lang/wisconsin - optimization is quite different when running remote server.
 # junitTests/derbyNet/CompatibilityTest.java - tries to start and shutdown the server.
 # stress/stress.multi - attempts to connect to localhost.
@@ -35,7 +34,6 @@
 derbynet/testProperties.java
 derbynet/timeslice.java
 derbynet/DerbyNetAutoStart.java
-tools/ieptests.sql
 lang/wisconsin.java
 junitTests/derbyNet/CompatibilityTest.java
 stress/stress.multi

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetRemote.exclude
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetRemote.exclude?view=diff&rev=532853&r1=532852&r2=532853
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetRemote.exclude
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetRemote.exclude
Thu Apr 26 13:41:16 2007
@@ -19,7 +19,6 @@
 # derbynet/DerbyNetAutoStart - tries to start networkserver
 # derbynet/sysinfo_withproperties - tries to use NetworkServerControl statements and test
requires server to 
 # be started with a specific property. see DERBY-928 for reference
-# tools/ieptests - names files in extin dir, but they are on the server
 # lang/wisconsin - optimization is quite different when running remote server.
 # junitTests/derbyNet/CompatibilityTest.java - tries to start and shutdown the server
 # 
@@ -34,6 +33,5 @@
 derbynet/testProperties.java
 derbynet/timeslice.java
 derbynet/DerbyNetAutoStart.java
-tools/ieptests.sql
 lang/wisconsin.java
 junitTests/derbyNet/CompatibilityTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall?view=diff&rev=532853&r1=532852&r2=532853
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall
Thu Apr 26 13:41:16 2007
@@ -1,5 +1,4 @@
 derbynet/NSinSameJVM.java
-derbynet/checkSecMgr.java
 derbynet/dblook_test_net.java
 derbynet/DerbyNetAutoStart.java
 derbynet/getCurrentProperties.java
@@ -22,5 +21,4 @@
 lang/ShutdownDatabase.java
 store/holdCursorExternalSortJDBC30.sql
 store/holdCursorJDBC30.sql
-tools/ieptests.sql
 derbynet/OutBufferedStream.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall?view=diff&rev=532853&r1=532852&r2=532853
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall
Thu Apr 26 13:41:16 2007
@@ -1,8 +1,6 @@
 tools/dblook_test.java
 tools/derbyrunjartest.java
 tools/importExportThruIJ.sql
-tools/ieptests.sql
-tools/iepnegativetests.sql
 tools/ij.sql
 tools/ij2.sql
 tools/ij3.sql

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall?view=diff&rev=532853&r1=532852&r2=532853
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall
Thu Apr 26 13:41:16 2007
@@ -14,4 +14,3 @@
 lang/holdCursorIJ.sql
 store/holdCursorExternalSortJDBC30.sql
 store/holdCursorJDBC30.sql
-tools/ieptests.sql

Copied: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/CheckSecurityManager.java
(from r532833, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/checkSecMgr.java)
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/CheckSecurityManager.java?view=diff&rev=532853&p1=db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/checkSecMgr.java&r1=532833&p2=db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/CheckSecurityManager.java&r2=532853
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/checkSecMgr.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/CheckSecurityManager.java
Thu Apr 26 13:41:16 2007
@@ -28,35 +28,38 @@
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
 import org.apache.derbyTesting.functionTests.util.JDBCTestDisplayUtil;
 import org.apache.derby.impl.tools.ij.util;
 import org.apache.derbyTesting.functionTests.util.TestUtil;
+import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.TestConfiguration;
 
 /**
 	This tests to see if the security manager is running.
 */
 
-public class checkSecMgr
+public class CheckSecurityManager extends BaseJDBCTestCase
 {
 
-	public static void main (String args[])
+	public static Test suite()
 	{
-		try
-		{
-			Connection conn = null;
-			util.getPropertyArg(args);
-			conn = util.startJBMS();
-			// bug 6021
-			// testIllegalDBCreate();
-			testIllegalPropertySet(conn);
-			cleanUp(conn);
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-		}
+		// only run testIllegalPropertySet,
+		// testIllegalDBCreate disabled, see comments
+	    return TestConfiguration.defaultSuite(CheckSecurityManager.class);
+	}
+	
+	public CheckSecurityManager(String name)
+	{
+		super(name);
 	}
 
+	/*
+	 * 
+	 
 	public static void testIllegalDBCreate() throws Exception
 	{
 			System.out.println("Security Manager Test Starts");
@@ -98,27 +101,24 @@
 				JDBCTestDisplayUtil.ShowCommonSQLException(System.out, se);			
 			}
 	}
+	*/
 
 	
 	/** Try to set a property in a stored procedure for which there is not
 	 *  adequate permissions in the policy file
 	 */
-	public static void testIllegalPropertySet(Connection conn)
+	public void testIllegalPropertySet() throws SQLException
 	{
-		System.out.println("testIllegalPropertySet");
-		try {
+			Connection conn = getConnection();
 			String createproc = "CREATE PROCEDURE setIllegalPropertyProc() DYNAMIC RESULT SETS 0 LANGUAGE
JAVA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.derbynet.checkSecMgr.setIllegalPropertyProc'
PARAMETER STYLE JAVA";
 			PreparedStatement pstmt = conn.prepareStatement(createproc);
 			pstmt.executeUpdate();
 			CallableStatement cstmt = conn.prepareCall("{call setIllegalPropertyProc()}");
-			System.out.println("execute the procedure setting illegal property");
-			cstmt.executeUpdate();
-			System.out.println("FAILED: Should have gotten security Exception");
-		} catch (SQLException se)
-		{
-			System.out.println("Expected Security Exception");
-			JDBCTestDisplayUtil.ShowCommonSQLException(System.out, se);
-		}
+			try {
+				cstmt.executeUpdate();
+			} catch (SQLException e) {
+				assertSQLState("38000", e);
+			}
 	}
 
 	public static void setIllegalPropertyProc()
@@ -126,13 +126,13 @@
 		System.setProperty("notAllowed", "somevalue");
 	}
 
-	public static void cleanUp(Connection conn) throws SQLException
+	public void tearDown() throws SQLException
 	{
-		Statement stmt = conn.createStatement();
+		Statement stmt = createStatement();
 		try {
 			stmt.executeUpdate("drop procedure setIllegalPropertyProc");
 		} catch (SQLException se) {
-			JDBCTestDisplayUtil.ShowCommonSQLException(System.out, se);
+			// ignore
 		}
 	}
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/_Suite.java?view=diff&rev=532853&r1=532852&r2=532853
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/_Suite.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/_Suite.java
Thu Apr 26 13:41:16 2007
@@ -47,6 +47,7 @@
         TestSuite suite = new TestSuite("derbynet");
              
         suite.addTest(PrepareStatementTest.suite());
+        suite.addTest(CheckSecurityManager.suite());
         suite.addTest(ShutDownDBWhenNSShutsDownTest.suite());
         suite.addTest(SuicideOfStreamingTest.suite());
         suite.addTest(DRDAProtocolTest.suite());



Mime
View raw message