db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r1160095 [3/3] - in /db/derby/code/branches/10.8: ./ java/testing/org/apache/derbyTesting/functionTests/suites/ java/testing/org/apache/derbyTesting/functionTests/tests/largedata/ java/testing/org/apache/derbyTesting/functionTests/util/
Date Mon, 22 Aug 2011 03:09:30 GMT
Copied: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/_Suite.java
(from r1148429, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/_Suite.java)
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/_Suite.java?p2=db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/_Suite.java&p1=db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/_Suite.java&r1=1148429&r2=1160095&rev=1160095&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/_Suite.java
(original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/_Suite.java
Mon Aug 22 03:09:29 2011
@@ -47,11 +47,4 @@ public class _Suite extends BaseJDBCTest
     }
     
     
-    /**
-     * Just the lite test for running with suites.All
-     */
-    public static Test suiteLite() {
-        return LobLimitsLiteTest.suite();
-    }
-    
 }

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/build.xml?rev=1160095&r1=1160094&r2=1160095&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/build.xml
(original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/build.xml
Mon Aug 22 03:09:29 2011
@@ -16,79 +16,30 @@
   limitations under the License.
 -->
 
-<!-- ==================================================================== -->
-<!--                       Derby build file                          -->
-<!-- ==================================================================== -->
-
-<project default="FTOtestsubdir" basedir="../../../../../../../.." >
-
-<!-- ==================================================================== -->
-<!--                           Set properties                             -->
-<!-- ==================================================================== -->
+<project default="largedatatests" basedir="../../../../../../..">
+
+<!-- Properties -->
 
   <!-- User settings -->
   <property file="${user.home}/ant.properties"/>
-
   <!-- Set property lib dir -->
-  <property name="properties.dir" value="tools/ant/properties" />
-
+  <property name="properties.dir" value="tools/ant/properties"/>
   <!-- Significant dirs -->
   <property file="${properties.dir}/dirs.properties"/>
   <property file="${properties.dir}/derbytesting.properties"/>
-
+  <property file="${user.home}/properties/derbytesting.properties"/>
+  <property file="${ant.home}/properties/derbytesting.properties"/>
   <!-- Compiler settings -->
-  <property file="${properties.dir}/sane${sanity}.properties"/>
-  <property file="${properties.dir}/defaultcompiler.properties"/>
   <property file="${properties.dir}/${build.compiler}.properties"/>
-
-  <!-- Parser properties -->
-  <!--property file="${properties.dir}/parser.properties"/-->
-
   <!-- Compile-time classpath properties files -->
   <property file="${properties.dir}/extrapath.properties"/>
-  <property file="${properties.dir}/compilepath.properties"/>
-
-  <!-- Release and Version info -->
-  <property file="${properties.dir}/release.properties"/>
-
-  <!-- derby testing specific properties files -->
-  <property file="${ant.home}/properties/derbytesting.properties"/>
-  <property file="${user.home}/properties/derbytesting.properties"/>
-  <property name="this.dir" value="${derby.testing.functest.dir}/tests/largedata"/>
-
-<!--             ============ Begin Targets ==============                -->
- 
-  <target name="FTOtestsubdir" depends="compilet1,compilet2,copyfiles"/>
-
-  <!-- mkdir / init target may not be necessary, just here for reference... -->
-  <target name="init">
-    <mkdir dir="${out.dir}/${derby.testing.functest.dir}/tests/largedata"/>
-  </target>
-
-  <target name="compilet1">
-    <javac
-      source="1.4"
-      target="1.4"
-      bootclasspath="${empty}"
-      nowarn="on"
-      debug="true"
-      depend="${depend}"
-      deprecation="${deprecation}"
-      optimize="${optimize}"
-      proceed="${proceed}"
-      verbose="${verbose}" 
-      srcdir="${derby.testing.src.dir}"
-      destdir="${out.dir}">
-      <classpath>
-        <!--pathelement location="${oro}"/-->
-        <pathelement path="${compile.classpath}"/>
-      </classpath>
-      <include name="${this.dir}/*.java"/>
-      <exclude name="${this.dir}/LobLimits.java"/>
-    </javac>
-  </target>
+  <property file="${properties.dir}/derbytesting.properties"/> 
+  <property file="${properties.dir}/compilepath.properties"/> 
+  
+<!-- Targets -->
 
-  <target name="compilet2">
+  <target name="largedatatests"  depends="copyfiles" 
+          description="Build Derby largedata tests">
     <javac
       source="1.4"
       target="1.4"
@@ -104,22 +55,17 @@
       destdir="${out.dir}">
       <classpath>
         <pathelement path="${java14compile.classpath}"/>
+        <pathelement path="${junit}"/>
       </classpath>
-      <include name="${this.dir}/LobLimits.java"/>
+      <include name="${derby.testing.functest.dir}/tests/largedata/*.java"/>
     </javac>
   </target>
 
   <target name="copyfiles">
     <copy todir="${out.dir}/${derby.testing.functest.dir}/tests/largedata">
       <fileset dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/tests/largedata"

-        includesfile="${derby.testing.src.dir}/${derby.testing.functest.dir}/tests/largedata/copyfiles.ant"/>
 
+        includes="*.sql,*.properties,*.subsql,*.policy,*.jar,*.dat,*.tstlog,xmlTestFiles/*"/>
 
     </copy>
-  </target> 
-
-
-<!--             ============= End Targets ==============                -->
-
-<!--             ============= End Project ==============                -->
-
+  </target>   
 </project>
 

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/util/PrivilegedFileOpsForTests.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/util/PrivilegedFileOpsForTests.java?rev=1160095&r1=1160094&r2=1160095&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/util/PrivilegedFileOpsForTests.java
(original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/util/PrivilegedFileOpsForTests.java
Mon Aug 22 03:09:29 2011
@@ -25,6 +25,7 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.FileReader;
+import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -140,6 +141,27 @@ public class PrivilegedFileOpsForTests {
     }
 
     /**
+     * Delete a file
+     *
+     * @return {@code true} if file was deleted, {@code false} otherwise
+     * @throws SecurityException if the required permissions to read the file,
+     *      or the path it is in, are missing
+     * @see File#delete
+     */
+    public static boolean delete(final File file)
+            throws SecurityException {
+        if (file == null) {
+            throw new IllegalArgumentException("file cannot be <null>");
+        }
+        return ((Boolean)AccessController.doPrivileged(
+                    new PrivilegedAction() {
+                        public Object run() {
+                            return Boolean.valueOf(file.delete());
+                        }
+                    })).booleanValue();
+    }
+
+    /**
      * Obtains a reader for the specified file.
      *
      * @param file the file to obtain a reader for
@@ -166,6 +188,34 @@ public class PrivilegedFileOpsForTests {
         }
     }
 
+    /**
+     * Obtains a writer for the specified file.
+     *
+     * @param file the file to obtain a writer for
+     * @return An writer for the specified file.
+     * @throws IOException 
+     * @throws IOException if the file cannot be opened
+     * @throws SecurityException if the required permissions to write to the file,
+     *      or the path it is in, are missing
+     */
+    public static FileWriter getFileWriter(final File file)
+            throws IOException {
+        if (file == null) {
+            throw new IllegalArgumentException("file cannot be <null>");
+        }
+        try {
+            return (FileWriter)AccessController.doPrivileged(
+                    new PrivilegedExceptionAction() {
+                        public Object run()
+                                throws IOException {
+                            return new FileWriter(file);
+                        }
+                    });
+        } catch (PrivilegedActionException pae) {
+            throw (IOException)pae.getCause();
+        }
+    }
+
     
     /**
      * In a priv block, do a recursive copy from source to target.  
@@ -411,4 +461,6 @@ public class PrivilegedFileOpsForTests {
             }
         });
     }
-}
+    
+
+ }



Mime
View raw message