You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by fu...@apache.org on 2006/04/20 01:20:25 UTC
svn commit: r395434 - in /db/derby/code/trunk/java:
testing/org/apache/derbyTesting/functionTests/master/
testing/org/apache/derbyTesting/functionTests/tests/tools/
tools/org/apache/derby/iapi/tools/ tools/org/apache/derby/loc/
Author: fuzzylogic
Date: Wed Apr 19 16:20:23 2006
New Revision: 395434
URL: http://svn.apache.org/viewcvs?rev=395434&view=rev
Log:
DERBY-1063: Change server command in derbyrun.jar to server instead of
NetworkServerControl. Touch up the javadoc.
Added:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out (with props)
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/derbyrunjartest.java (with props)
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/derbyrunjartest_app.properties (with props)
Removed:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/copyfiles.ant
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/build.xml
db/derby/code/trunk/java/tools/org/apache/derby/iapi/tools/run.java
db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages.properties
Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out?rev=395434&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out Wed Apr 19 16:20:23 2006
@@ -0,0 +1,41 @@
+java -jar C:/derby-trunk/jars/sane/derbyrun.jar ij --help:
+Usage: java org.apache.derby.tools.ij [-p propertyfile] [-ca connectionAttributePropertyFile] [inputfile]
+java -jar C:/derby-trunk/jars/sane/derbyrun.jar sysinfo -cp help:
+USAGE: java org.apache.derby.tools.sysinfo -cp [ [ embedded ][ server ][ client] [ tools ] [ anyClass.class ] ]
+java -jar C:/derby-trunk/jars/sane/derbyrun.jar dblook:
+ USAGE:
+ java org.apache.derby.tools.dblook -d <sourceDBUrl> [OPTIONS]
+ where the source URL is the full URL, including the connection protocol
+ and any connection attributes that might apply. For example, use
+ 'jdbc:derby:myDB', or 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/myDB;user=usr;'.
+ options include:
+ -z <schemaName> to specify a schema to which the DDL generation
+ should be limited. Only database objects with that schema will have
+ their DDL generated.
+ -t <tableOne> <tableTwo> ... to specify a list of tables for which
+ the DDL will be generated; any tables not in the list will be ignored.
+ -td <value> to specify what should be appended to the end
+ of each DDL statement.
+ This defaults to ';'.
+ -noview to prevent the generation of DDL for views.
+ -append to keep from overwriting the output files.
+ -verbose to have error messages printed to the console (in addition
+ to the log file). If not specified, errors will only be printed to the
+ log file.
+ -o <filename> to specify the file name to which the generated DDL
+ will be written.
+ If not specified, default is the console.
+java -jar C:/derby-trunk/jars/sane/derbyrun.jar server:
+No arguments given.
+Usage: NetworkServerControl <commands>
+Commands:
+start [-h <host>] [-p <portnumber>]
+shutdown [-h <host>][-p <portnumber>]
+ping [-h <host>][-p <portnumber>]
+sysinfo [-h <host>][-p <portnumber>]
+runtimeinfo [-h <host>][-p <portnumber>]
+logconnections {on|off}[-h <host>][-p <portnumber>]
+maxthreads <max>[-h <host>][-p <portnumber>]
+timeslice <milliseconds>[-h <host>][-p <portnumber>]
+trace {on|off} [-s <session id>][-h <host>][-p <portnumber>]
+tracedirectory <traceDirectory>[-h <host>][-p <portnumber>]
Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyrunjartest.out
------------------------------------------------------------------------------
svn:eol-style = native
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/build.xml
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/build.xml?rev=395434&r1=395433&r2=395434&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/build.xml (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/build.xml Wed Apr 19 16:20:23 2006
@@ -114,7 +114,7 @@
<target name="copyfiles">
<copy todir="${out.dir}/${derby.testing.functest.dir}/tests/tools">
<fileset dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/tests/tools"
- includesfile="${derby.testing.src.dir}/${derby.testing.functest.dir}/tests/tools/copyfiles.ant"/>
+ includes="*.jar,*.sql,*.properties"/>
</copy>
</target>
Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/derbyrunjartest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/derbyrunjartest.java?rev=395434&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/derbyrunjartest.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/derbyrunjartest.java Wed Apr 19 16:20:23 2006
@@ -0,0 +1,84 @@
+/*
+
+ Derby - Class org.apache.derbyTesting.functionTests.tests.tools.derbyrunjartest
+
+ Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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 java.lang.Process;
+import java.lang.Runtime;
+import java.lang.SecurityException;
+import java.net.URL;
+import java.security.CodeSource;
+
+import org.apache.derbyTesting.functionTests.harness.BackgroundStreamSaver;
+
+public class derbyrunjartest {
+
+ public static void main(String[] args)
+ {
+ // get location of run class.
+ CodeSource cs = null;
+ try {
+ cs = org.apache.derby.iapi.tools.run.class.getProtectionDomain().getCodeSource();
+ } catch (SecurityException se) {
+ System.out.println("Security exception: " + se.getMessage());
+ }
+
+ URL result = cs.getLocation();
+
+ if (!result.toString().startsWith("file:")) { exitNow(); } else
+ {
+ String derbyrunloc = result.toString().substring(5);
+ if (System.getProperty("os.name").startsWith("Windows"))
+ derbyrunloc = derbyrunloc.substring(1);
+ runtool(derbyrunloc, "ij --help");
+ runtool(derbyrunloc, "sysinfo -cp help");
+ runtool(derbyrunloc, "dblook");
+ runtool(derbyrunloc, "server");
+ }
+ }
+
+ private static void runtool(String loc, String tool)
+ {
+ String command = "java -jar " + loc + ' ' + tool;
+ Process pr = null;
+
+ System.out.println(command + ':');
+ try
+ {
+ pr = Runtime.getRuntime().exec(command);
+ BackgroundStreamSaver saver =
+ new BackgroundStreamSaver(pr.getInputStream(), System.out);
+ pr.waitFor();
+ pr.destroy();
+ } catch(Throwable t) {
+ System.out.println("Process exception: " + t.getMessage());
+ if (pr != null)
+ {
+ pr.destroy();
+ pr = null;
+ }
+ }
+ }
+
+ public static void exitNow()
+ {
+ System.out.println("This test must be run from jar files. Exiting.");
+ }
+}
Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/derbyrunjartest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/derbyrunjartest_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/derbyrunjartest_app.properties?rev=395434&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/derbyrunjartest_app.properties (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/derbyrunjartest_app.properties Wed Apr 19 16:20:23 2006
@@ -0,0 +1,2 @@
+# Disabling processes because test spawns child threads using Runtime.exec().
+noSecurityManager=true
Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/derbyrunjartest_app.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: db/derby/code/trunk/java/tools/org/apache/derby/iapi/tools/run.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/tools/org/apache/derby/iapi/tools/run.java?rev=395434&r1=395433&r2=395434&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/iapi/tools/run.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/iapi/tools/run.java Wed Apr 19 16:20:23 2006
@@ -28,13 +28,14 @@
import org.apache.derby.iapi.tools.i18n.LocalizedResource;
/**
+ <p>
The run class facilitates running the various Derby utilities with the
java -jar command. For example:
-
- java -jar derbyrun.jar ij
- java -jar derbyrun.jar sysinfo
- java -jar derbyrun.jar dblook
- java -jar derbyrun.jar NetworkServerControl
+ <p>
+ java -jar derbyrun.jar ij [-p propertiesfile] [sql script]<br>
+ java -jar derbyrun.jar sysinfo [-cp ...] [-cp help]<br>
+ java -jar derbyrun.jar dblook [args] (or no arguments for usage)<br>
+ java -jar derbyrun.jar server [args] (or no arguments for usage)<br>
*/
public class run {
@@ -51,18 +52,18 @@
sysinfo.main(trimArgs(args));
} else if (args[0].equals("dblook")) {
dblook.main(trimArgs(args));
- } else if (args[0].equals("NetworkServerControl")) {
+ } else if (args[0].equals("server")) {
NetworkServerControl.main(trimArgs(args));
} else printUsage();
}
- /*
+ /**
Private constructor. No instances allowed.
*/
private run() {
}
- /*
+ /**
Utility method to trim one element off of the argument array.
@param args the arguments array
@return trimmed the trimmed array
@@ -74,7 +75,7 @@
return trimmed;
}
- /*
+ /**
Print the usage statement if the user didn't enter a valid choice
of tool.
*/
Modified: db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages.properties?rev=395434&r1=395433&r2=395434&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages.properties (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/loc/toolsmessages.properties Wed Apr 19 16:20:23 2006
@@ -240,4 +240,4 @@
java -jar derbyrun.jar ij [-p propertiesfile] [sql script]\n\
java -jar derbyrun.jar sysinfo [-cp ...] [-cp help] \n\
java -jar derbyrun.jar dblook [args] (or no arguments for usage)\n\
-java -jar derbyrun.jar NetworkServerControl [args] (or no arguments for usage)
+java -jar derbyrun.jar server [args] (or no arguments for usage)