db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r505039 - in /db/derby/code/trunk: build.xml java/testing/org/apache/derbyTesting/functionTests/suites/All.java java/testing/org/apache/derbyTesting/functionTests/suites/EncryptionSuite.java
Date Thu, 08 Feb 2007 21:15:47 GMT
Author: djd
Date: Thu Feb  8 13:15:46 2007
New Revision: 505039

URL: http://svn.apache.org/viewvc?view=rev&rev=505039
Log:
Add the top level EncryptionSuite to suites.All. This is meant to replace the encryption suites
from the old harness.
Currently does not contain any real tests but does create a number of databases using different
encryption algorithms. Also added to the ant juni-all target.
Made sure no tests are run in J2ME.
Removed LobStreamstest as that test was not previously run with encryption, I got confused
between encoding and encryption from the suites.

Modified:
    db/derby/code/trunk/build.xml
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/All.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/EncryptionSuite.java

Modified: db/derby/code/trunk/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/build.xml?view=diff&rev=505039&r1=505038&r2=505039
==============================================================================
--- db/derby/code/trunk/build.xml (original)
+++ db/derby/code/trunk/build.xml Thu Feb  8 13:15:46 2007
@@ -1721,6 +1721,10 @@
       <param name="derby.junit.testname"
              value="org.apache.derbyTesting.functionTests.tests.store._Suite"/>
     </antcall>
+    <antcall target="junit-oneclass">
+      <param name="derby.junit.testname"
+             value="org.apache.derbyTesting.functionTests.suites.EncryptionSuite"/>
+    </antcall>
   </target>
 	
   <!--

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/All.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/All.java?view=diff&rev=505039&r1=505038&r2=505039
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/All.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/All.java
Thu Feb  8 13:15:46 2007
@@ -41,6 +41,9 @@
         // All package tests
         suite.addTest(AllPackages.suite());
         
+        // Encrypted tests
+        suite.addTest(EncryptionSuite.suite());
+        
         return suite;
     }
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/EncryptionSuite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/EncryptionSuite.java?view=diff&rev=505039&r1=505038&r2=505039
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/EncryptionSuite.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/EncryptionSuite.java
Thu Feb  8 13:15:46 2007
@@ -20,8 +20,12 @@
  */
 package org.apache.derbyTesting.functionTests.suites;
 
+import java.sql.SQLException;
+
 import org.apache.derbyTesting.functionTests.tests.jdbcapi.LobStreamsTest;
+import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.Decorator;
+import org.apache.derbyTesting.junit.JDBC;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -47,11 +51,11 @@
  * @see Decorator#encryptedDatabase(Test, String)
  *
  */
-public final class EncryptionSuite {
+public final class EncryptionSuite extends BaseJDBCTestCase {
     
 
-    private EncryptionSuite() {
-        super();
+    public EncryptionSuite(String name) {
+        super(name);
     }
     
     /**
@@ -63,13 +67,18 @@
     {
         TestSuite suite = new TestSuite("Encrpytion Suite");
         
-        suite.addTest(Decorator.encryptedDatabase(baseSuite("default")));
-        suite.addTest(encryptedSuite("AES/CBC/NoPadding"));
-        suite.addTest(encryptedSuite("DES/ECB/NoPadding"));
-        suite.addTest(encryptedSuite("DESede/CFB/NoPadding"));
-        suite.addTest(encryptedSuite("DES/CBC/NoPadding"));
-        suite.addTest(encryptedSuite("Blowfish/CBC/NoPadding"));
-        suite.addTest(encryptedSuite("AES/CBC/NoPadding"));
+        // Encryption only supported for Derby in J2SE/J2EE environments.
+        // J2ME (JSR169) does not support encryption.
+        if (JDBC.vmSupportsJDBC3()) {
+        
+          suite.addTest(Decorator.encryptedDatabase(baseSuite("default")));
+          suite.addTest(encryptedSuite("AES/CBC/NoPadding"));
+          suite.addTest(encryptedSuite("DES/ECB/NoPadding"));
+          suite.addTest(encryptedSuite("DESede/CFB/NoPadding"));
+          suite.addTest(encryptedSuite("DES/CBC/NoPadding"));
+          suite.addTest(encryptedSuite("Blowfish/CBC/NoPadding"));
+          suite.addTest(encryptedSuite("AES/CBC/NoPadding"));
+        }
         
         return suite;
     }
@@ -86,8 +95,20 @@
     {
         TestSuite suite = new TestSuite("Encryption Algorithm: " + algorithm);
         
-        // LobStreamsTest was in the encrpytion suite for the old harness. 
-        suite.addTest(LobStreamsTest.suite());
+        // Very simple test to get the setup working while we have
+        // no tests that were previously run under encryption converted.
+        suite.addTestSuite(EncryptionSuite.class);
+        
         return suite;
+    }
+    
+    /**
+     * Very simple test that ensures we can get a connection to
+     * the booted encrypted database.
+     * @throws SQLException
+     */
+    public void testConnection() throws SQLException
+    {
+        getConnection().close();
     }
 }



Mime
View raw message