db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fuzzylo...@apache.org
Subject svn commit: r525649 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: tests/derbynet/NetIjTest.java tests/derbynet/NetIjTests.java tests/derbynet/_Suite.java util/IjTestCase.java util/derby_tests.policy
Date Thu, 05 Apr 2007 00:04:32 GMT
Author: fuzzylogic
Date: Wed Apr  4 17:04:31 2007
New Revision: 525649

URL: http://svn.apache.org/viewvc?view=rev&rev=525649
Log:
DERBY-2505: Convert derbynet/testij.java to JUnit. Updates the policy file
to allow ij to read/write/delete from the extinout dir and added a comment
about why ij needs PropertyPermission * read.

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetIjTest.java
      - copied, changed from r525600, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetIjTests.java
Removed:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetIjTests.java
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/_Suite.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/IjTestCase.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy

Copied: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetIjTest.java
(from r525600, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetIjTests.java)
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetIjTest.java?view=diff&rev=525649&p1=db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetIjTests.java&r1=525600&p2=db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetIjTest.java&r2=525649
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetIjTests.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetIjTest.java
Wed Apr  4 17:04:31 2007
@@ -24,22 +24,24 @@
 import junit.framework.TestSuite;
 
 import org.apache.derbyTesting.functionTests.util.IjTestCase;
+import org.apache.derbyTesting.junit.SupportFilesSetup;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
 /**
  * Network client .sql tests to run via ij.
  */
-public class NetIjTests extends IjTestCase {
+public class NetIjTest extends IjTestCase {
 	
-	private NetIjTests(String name) {
+	private NetIjTest(String name) {
 		super(name);
 	}
 	
 	public static Test suite() {
         
         TestSuite suite = new TestSuite("NetIjTests");
-        suite.addTest(TestConfiguration.clientServerDecorator(
-        		new NetIjTests("testclientij")));
+        suite.addTest(new SupportFilesSetup(
+        		TestConfiguration.clientServerDecorator(
+        		new NetIjTest("testclientij"))));
         
         return suite;
     }

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=525649&r1=525648&r2=525649
==============================================================================
--- 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
Wed Apr  4 17:04:31 2007
@@ -54,6 +54,7 @@
         suite.addTest(BadConnectionTest.suite());
         suite.addTest(NetHarnessJavaTest.suite());
         suite.addTest(SecureServerTest.suite());
+        suite.addTest(NetIjTest.suite());
         
         // this test refers to ConnectionPooledDataSource class
         // thus causing class not found exceptions with JSR169

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/IjTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/IjTestCase.java?view=diff&rev=525649&r1=525648&r2=525649
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/IjTestCase.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/IjTestCase.java
Wed Apr  4 17:04:31 2007
@@ -27,9 +27,15 @@
 import java.security.PrivilegedAction;
 
 import org.apache.derby.tools.ij;
+import org.apache.derbyTesting.junit.SupportFilesSetup;
+
 
 /**
  * Run a .sql script via ij's main method and compare with a canon.
+ * 
+ * Tests that extend this class should always wrap their suite with
+ * a SupportFilesSetup so that the extinout directory where ij will
+ * write the test output is created. 
  */
 public class IjTestCase extends ScriptTestCase {
 
@@ -44,7 +50,7 @@
 	public IjTestCase(String name) {
 		super(name);
 		scriptName = getName() + ".sql";
-		outfileName = "system" + File.separator + getName() + ".out";
+		outfileName = SupportFilesSetup.EXTINOUT + File.separator + getName() + ".out";
 		outfile = new File(outfileName);
 	}
 	

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy?view=diff&rev=525649&r1=525648&r2=525649
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
Wed Apr  4 17:04:31 2007
@@ -100,12 +100,18 @@
 // focus is on getting the engine & network server secure.
 //
 grant codeBase "${derbyTesting.codejar}derbytools.jar" {
-  // Access all properties using System.getProperties
+  // Access all properties using System.getProperties -
+  // ij enumerates the properties in order to open connections
+  // for any property set in ij.connection.* and set protocols
+  // for any property in ij.protocol.*
   permission java.util.PropertyPermission "*", "read, write";
   
   // Read all files under ${user.dir}
   permission java.io.FilePermission "${user.dir}${/}-", "read";
   
+  // IjTestCases read, write, and delete ij's output in the extinout dir
+  permission java.io.FilePermission "${user.dir}${/}extinout${/}-", "read, write, delete";
+ 
   // ij needs permission to read the sql files in this jar
   permission java.io.FilePermission "${derbyTesting.testjarpath}", "read";
   



Mime
View raw message