db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r692254 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/importExportIJ.out suites/derbytools.runall tests/tools/ImportExportIJTest.java tests/tools/_Suite.java tests/tools/importExportIJ_app.properties
Date Thu, 04 Sep 2008 21:25:58 GMT
Author: myrnavl
Date: Thu Sep  4 14:25:57 2008
New Revision: 692254

URL: http://svn.apache.org/viewvc?rev=692254&view=rev
Log:
DERBY-3863; improve import/export ij test - wrap in junit scripttestcase.

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ImportExportIJTest.java
  (with props)
Removed:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportIJ_app.properties
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportIJ.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/_Suite.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportIJ.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportIJ.out?rev=692254&r1=692253&r2=692254&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportIJ.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportIJ.out
Thu Sep  4 14:25:57 2008
@@ -15,6 +15,7 @@
 --   limitations under the License.
 --
 -- test for import export thru command line interface
+
 -- first test basic import functionality
 -- ascii delimited default format
 drop table T1;
@@ -332,6 +333,7 @@
 -----------
 0          
 ij> -- this is sample data with some null (missing) fields
+
 drop table Alt3;
 ERROR 42Y55: 'DROP TABLE' cannot be performed on 'ALT3' because it does not exist.
 ij> create table Alt3 (	Account	int,
@@ -633,6 +635,7 @@
 ij> ----
 ---- test export 
 ----
+
 call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'T1' , 'extinout/t1.dump' , 
                                     '|','''', 'ASCII') ;
 0 rows inserted/updated/deleted
@@ -688,6 +691,7 @@
 ij> -- test case for derby-1854/derby-1641
 -- perform import into a table that has same column 
 -- as a primary key and a foreign key (ADMINS table).  
+
 create table users (
  user_id int not null generated by default as identity,
  user_login varchar(255) not null,
@@ -728,11 +732,13 @@
 ij> drop table users;
 0 rows inserted/updated/deleted
 ij> -- end derby-1854/derby-1641 test case. 
+
 --
 -- begin test case for derby-2193:
 --
 -- Field comprised of all blank space should become a null
 --
+
 create table derby_2193_tab
 (
     a  varchar( 50 ),
@@ -772,11 +778,13 @@
 ij> --
 -- end test case for derby-2193:
 --
+
 --
 -- begin test case for derby-2925:
 --
 -- Prevent export from overwriting existing files 
 --
+
 create table derby_2925_tab
 (
     a  varchar( 50 ),
@@ -786,6 +794,7 @@
 ij> --
 -- Testing SYSCS_UTIL.SYSCS_EXPORT_TABLE
 --
+
 CALL SYSCS_UTIL.SYSCS_EXPORT_TABLE
 ( null, 'DERBY_2925_TAB', 'extout/derby-2925.txt', null, null, null);
 0 rows inserted/updated/deleted
@@ -800,6 +809,7 @@
 ij> --
 -- Testing SYSCS_UTIL.SYSCS_EXPORT_QUERY
 --
+
 CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY
 ('select * from DERBY_2925_TAB', 'extout/derby-2925-query.dat', null , null , null ) ;
 0 rows inserted/updated/deleted
@@ -814,6 +824,7 @@
 ij> --
 -- Testing SYSCS_UTIL.SYSCS_EXPORT_QUERY_LOBS_TO_EXTFILE
 --
+
 create table derby_2925_lob
 (
 	id 	int,
@@ -826,6 +837,7 @@
 -- Testing SYSCS_UTIL.SYSCS_EXPORT_QUERY_LOBS_TO_EXTFILE
 -- where data file exists.
 --
+
 CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY_LOBS_TO_EXTFILE
 ('SELECT * FROM DERBY_2925_LOB','extout/derby-2925_data.dat', '\t' ,'|','UTF-16','extout/derby-2925_lobs.dat');
 0 rows inserted/updated/deleted
@@ -845,10 +857,11 @@
 -- call to SYSCS_UTIL.SYSCS_EXPORT_QUERY_LOBS_TO_EXTFILE
 -- since extout/derby-2925_lobs.dat already exists.
 --
+
 CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY_LOBS_TO_EXTFILE
 ('SELECT * FROM DERBY_2925_LOB','extout/derby-2925_data1.dat', '\t' ,'|','UTF-16','extout/derby-2925_lobs.dat');
 ERROR XIE0T: The export operation was not performed, because the specified large object auxiliary
file (extout/derby-2925_lobs.dat) already exists. Export processing will not overwrite an
existing file, even if the process has permissions to write to that file, due to security
concerns, and to avoid accidental file damage. Please either change the large object auxiliary
file name in the export procedure arguments to specify a file which does not exist, or delete
the existing file, then retry the export operation.
 ij> --
 -- end test case for derby-2925:
 ;
-ij> 
+ij> 
\ No newline at end of file

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?rev=692254&r1=692253&r2=692254&view=diff
==============================================================================
--- 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 Sep  4 14:25:57 2008
@@ -1,7 +1,6 @@
 tools/dblook_test.java
 tools/dblook_test_territory.java
 tools/derbyrunjartest.java
-tools/importExportIJ.sql
 tools/ij.sql
 tools/ij2.sql
 tools/ij3.sql

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ImportExportIJTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ImportExportIJTest.java?rev=692254&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ImportExportIJTest.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ImportExportIJTest.java
Thu Sep  4 14:25:57 2008
@@ -0,0 +1,79 @@
+/*
+ * Derby - Class 
+ * org.apache.derbyTesting.functionTests.tests.tools.ImportExportIJTest
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, 
+ * software distributed under the License is distributed on an 
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
+ * either express or implied. See the License for the specific 
+ * language governing permissions and limitations under the License.
+ */
+
+package org.apache.derbyTesting.functionTests.tests.tools;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.derbyTesting.functionTests.util.ScriptTestCase;
+import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
+import org.apache.derbyTesting.junit.SupportFilesSetup;
+
+/**
+ *	Test that runs the importExportThruIJ.sql script and compares the output 
+ *	to importExportThruIJ.out.
+ */
+public final class ImportExportIJTest extends ScriptTestCase {
+	
+	/**
+	 * Constructor that runs a single script.
+	 * 
+	 * @param script - the name of the script
+	 */
+	private ImportExportIJTest(String script) {
+		super(script);
+	}
+
+	
+	/**
+	 * Return the suite that runs the script.
+	 */
+	public static Test suite() {
+		TestSuite suite = new TestSuite("importExportIJ");
+        // only run with embedded
+        // network server makes slightly different output
+        // ('statement executed' instead of '# rows inserted/deteled', etc.)
+        // and this test would never work if the server were on 
+        // a remote system because the export file would be on the
+        // server side, and import would be looking on the client.
+        // Also, running client & embedded would require some cleanup magic to
+        // remove the exported files (see e.g. ImportExportTest).
+        suite.addTest(new CleanDatabaseTestSetup(
+                        new ImportExportIJTest("importExportIJ")));
+        Test tst = new SupportFilesSetup(suite, new String[] {
+            "functionTests/testData/ImportExport/TwoLineBadEOF.dat",
+            "functionTests/testData/ImportExport/NoEOR.dat",
+            "functionTests/testData/ImportExport/Access1.txt",
+            "functionTests/testData/ImportExport/AccountData_defaultformat.dat",
+            "functionTests/testData/ImportExport/AccountData_format1.dat",
+            "functionTests/testData/ImportExport/AccountData_format2.dat",
+            "functionTests/testData/ImportExport/AccountData_format2oops.dat",
+            "functionTests/testData/ImportExport/AccountData_NullFields.dat",
+            "functionTests/testData/ImportExport/UnsupportedFormat1.dat",
+            "functionTests/testData/ImportExport/UnsupportedFormat2.dat",
+            "functionTests/testData/ImportExport/derby-2193.txt",
+            "functionTests/testData/ImportExport/derby-2193-linenumber.txt"
+            }
+        );
+        return tst;
+//		return suite;
+	}
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ImportExportIJTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/_Suite.java?rev=692254&r1=692253&r2=692254&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/_Suite.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/_Suite.java
Thu Sep  4 14:25:57 2008
@@ -50,6 +50,7 @@
         suite.addTest(ImportExportBinaryDataTest.suite());
         suite.addTest(ImportExportLobTest.suite());
         suite.addTest(ImportExportProcedureTest.suite());
+        suite.addTest(ImportExportIJTest.suite());
         suite.addTest(ToolScripts.suite());
         suite.addTest(SysinfoCPCheckTest.suite());
         suite.addTest(SysinfoLocaleTest.suite());



Mime
View raw message