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 dj...@apache.org on 2006/07/31 23:35:23 UTC
svn commit: r427293 - in
/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij: Main.java
mtTestCase.java utilMain.java utilMain14.java
Author: djd
Date: Mon Jul 31 14:35:23 2006
New Revision: 427293
URL: http://svn.apache.org/viewvc?rev=427293&view=rev
Log:
DERBY-1609 (partial) Move initializing connections from system properties
in ij's utilMain into a separate method from the constructor. Allows ij's
runScript method to create a constructor without creating unrequired
connections based upon System properties.
Modified:
db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Main.java
db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtTestCase.java
db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java
db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain14.java
Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Main.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Main.java?rev=427293&r1=427292&r2=427293&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Main.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Main.java Mon Jul 31 14:35:23 2006
@@ -57,7 +57,6 @@
*
*/
public class Main {
- private LocalizedOutput out;
private utilMain utilInstance;
/**
@@ -197,7 +196,7 @@
Give a shortcut to go on the utilInstance so
we don't expose utilMain.
*/
- public void go(LocalizedInput in, LocalizedOutput out ,
+ private void go(LocalizedInput in, LocalizedOutput out ,
Properties connAttributeDefaults)
{
LocalizedInput[] inA = { in } ;
@@ -212,12 +211,11 @@
}
public Main(LocalizedOutput out) {
- if (out!=null) {
- this.out = out;
- } else {
- this.out = LocalizedResource.getInstance().getNewOutput(System.out);
+ if (out == null) {
+ out = LocalizedResource.getInstance().getNewOutput(System.out);
}
- utilInstance = getutilMain(1, this.out);
+ utilInstance = getutilMain(1, out);
+ utilInstance.initConnections();
}
/**
Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtTestCase.java?rev=427293&r1=427292&r2=427293&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtTestCase.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtTestCase.java Mon Jul 31 14:35:23 2006
@@ -240,6 +240,7 @@
out.println("--------------"+file+"-----------------");
utilInstance = new utilMain(1, out, ignoreErrors);
+ utilInstance.initConnections();
utilInstance.setMtUse(true);
utilInstance.go(in, out, (java.util.Properties) null);
log.flush();
Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java?rev=427293&r1=427292&r2=427293&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java Mon Jul 31 14:35:23 2006
@@ -69,7 +69,7 @@
ij ijParser;
ConnectionEnv[] connEnv;
private int currCE;
- private int numConnections;
+ private final int numConnections;
private boolean fileInput;
private boolean initialFileInput;
private boolean mtUse;
@@ -97,7 +97,7 @@
*
* @param numConnections The number of connections/users to test.
*/
- public utilMain(int numConnections, LocalizedOutput out)
+ utilMain(int numConnections, LocalizedOutput out)
throws ijFatalException
{
this(numConnections, out, (Hashtable)null);
@@ -115,7 +115,7 @@
* thrown. ignoreErrors is used for stress
* tests.
*/
- public utilMain(int numConnections, LocalizedOutput out, Hashtable ignoreErrors)
+ utilMain(int numConnections, LocalizedOutput out, Hashtable ignoreErrors)
throws ijFatalException
{
String framework_property = util.getSystemProperty("framework");
@@ -145,6 +145,23 @@
{
commandGrabber[ictr] = new StatementFinder(langUtil.getNewInput(System.in));
connEnv[ictr] = new ConnectionEnv(ictr, (numConnections > 1), (numConnections == 1));
+ }
+
+ /* Start with connection/user 0 */
+ currCE = 0;
+ fileInput = false;
+ initialFileInput = false;
+ firstRun = true;
+ }
+
+ /**
+ * Initialize the connections from the environment.
+ *
+ */
+ void initConnections()
+ {
+ for (int ictr = 0; ictr < numConnections; ictr++)
+ {
try {
connEnv[ictr].init(out);
} catch (SQLException s) {
@@ -157,12 +174,6 @@
JDBCDisplayUtil.ShowException(out, ia); // will continue past driver failure
}
}
-
- /* Start with connection/user 0 */
- currCE = 0;
- fileInput = false;
- initialFileInput = false;
- firstRun = true;
}
Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain14.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain14.java?rev=427293&r1=427292&r2=427293&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain14.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain14.java Mon Jul 31 14:35:23 2006
@@ -36,7 +36,7 @@
@author jerry
*/
-public class utilMain14 extends utilMain
+class utilMain14 extends utilMain
{
private static final String JDBC_NOTSUPPORTED = "JDBC 3 method called - not yet supported";
/**
@@ -45,7 +45,7 @@
* @param numConnections The number of connections/users to test.
*
*/
- public utilMain14(int numConnections, LocalizedOutput out)
+ utilMain14(int numConnections, LocalizedOutput out)
throws ijFatalException
{
super(numConnections, out, (Hashtable)null);
@@ -64,7 +64,7 @@
* tests.
*
*/
- public utilMain14(int numConnections, LocalizedOutput out, Hashtable ignoreErrors)
+ utilMain14(int numConnections, LocalizedOutput out, Hashtable ignoreErrors)
throws ijFatalException
{
super(numConnections, out, ignoreErrors);
Re: svn commit: r427293 - in /db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij:
Main.java mtTestCase.java utilMain.java utilMain14.java
Posted by Daniel John Debrunner <dj...@apache.org>.
Myrna van Lunteren wrote:
> So, Andrew, does this also mean you are looking into the wisconsin
> test failure? The test currently builds but fails - with jdk142 and
> others,
Fixed. Committed revision 427801.
Dan.
Re: svn commit: r427293 - in /db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij: Main.java mtTestCase.java utilMain.java utilMain14.java
Posted by Myrna van Lunteren <m....@gmail.com>.
On 7/31/06, Andrew McIntyre <mc...@gmail.com> wrote:
> On 7/31/06, Army <qo...@gmail.com> wrote:
> >
> > [javac] Compiling 2 source files to C:\p4clients\main_codeline\classes
> > [javac]
> > C:\p4clients\main_codeline\opensource\java\testing\org\apache\derbyTesting\functionTests\tests\lang\wisconsin.java:70:
> >
> > utilMain(int,org.apache.derby.iapi.tools.i18n.LocalizedOutput,java.util.Hashtable)
> > is not public in org.apache.derby.impl.tools.ij.utilMain; cannot be accessed
> > from outside package
> > [javac] utilInstance = new utilMain(1, out, (Hashtable)null);
> > [javac] ^
> > [javac] 1 error
> > [javac] Compile failed; see the compiler error output for details.
>
> Interestingly, the wisconsin test is usign this internal class to set
> ij's input and output streams. Since that's exactly what the public
> ij.runScript() is for, the test should probably be rewritten to use
> the new public api.
>
> > I also noticed (somewhat by chance) that if I try to run ij using Sun jdk131
> > with the latest codeline, I see the following:
> >
> > Exception in thread "main" java.lang.UnsupportedClassVersionError:
> > org/apache/derby/impl/tools/ij/Main14 (Unsupported major.minor version 48.0)
>
> I'll look into this.
>
> andrew
>
So, Andrew, does this also mean you are looking into the wisconsin
test failure? The test currently builds but fails - with jdk142 and
others, I think. Looks like it just can't make any connections,
haven't looked further into it. This I saw first when svn update-ing
up to 427354.
Or, Dan, that was a checkin by you, are you maybe looking at it?
Myrna
Re: svn commit: r427293 - in /db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij: Main.java mtTestCase.java utilMain.java utilMain14.java
Posted by Andrew McIntyre <mc...@gmail.com>.
On 7/31/06, Army <qo...@gmail.com> wrote:
>
> [javac] Compiling 2 source files to C:\p4clients\main_codeline\classes
> [javac]
> C:\p4clients\main_codeline\opensource\java\testing\org\apache\derbyTesting\functionTests\tests\lang\wisconsin.java:70:
>
> utilMain(int,org.apache.derby.iapi.tools.i18n.LocalizedOutput,java.util.Hashtable)
> is not public in org.apache.derby.impl.tools.ij.utilMain; cannot be accessed
> from outside package
> [javac] utilInstance = new utilMain(1, out, (Hashtable)null);
> [javac] ^
> [javac] 1 error
> [javac] Compile failed; see the compiler error output for details.
Interestingly, the wisconsin test is usign this internal class to set
ij's input and output streams. Since that's exactly what the public
ij.runScript() is for, the test should probably be rewritten to use
the new public api.
> I also noticed (somewhat by chance) that if I try to run ij using Sun jdk131
> with the latest codeline, I see the following:
>
> Exception in thread "main" java.lang.UnsupportedClassVersionError:
> org/apache/derby/impl/tools/ij/Main14 (Unsupported major.minor version 48.0)
I'll look into this.
andrew
Patches for DERBY-1609 (was: Re: svn commit: r427293 - in
/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij: Main.java
mtTestCase.java utilMain.java utilMain14.java)
Posted by John Embretsen <Jo...@Sun.COM>.
Daniel John Debrunner wrote:
> I think I fixed them, just checking in another codeline.
>
> I'malso changing wisconsin.java to use the new ij.runScript method so I
> didn't see that compile error. The change to use runScript isn't ready
> yet, some diffs exist ddue to a cursor name.
Dan,
Speaking of the new ij.runScript method, is there any chance you will
upload any patches to DERBY-1609 (Jira) in the future?
I'm not a big fan of the "commit-then-review-by-inspecting-svn-history"
process when it comes to new features like this. With patches attached
to Jira it is easier for members of the community to learn from the code
and/or spot mistakes, without having to subscribe to the derby-commits list.
--
John
Re: svn commit: r427293 - in /db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij:
Main.java mtTestCase.java utilMain.java utilMain14.java
Posted by Daniel John Debrunner <dj...@apache.org>.
Army wrote:
> djd@apache.org wrote:
>
>> Modified:
>>
>> db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Main.java
>>
>> db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtTestCase.java
>>
>>
>> db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java
>>
>>
>> db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain14.java
>>
>
>
> When I sync up to the latest codeline and do an ant clobber, I see the
> following compile errors:
I think I fixed them, just checking in another codeline.
I'malso changing wisconsin.java to use the new ij.runScript method so I
didn't see that compile error. The change to use runScript isn't ready
yet, some diffs exist ddue to a cursor name.
Sorry,
Dan.
Re: svn commit: r427293 - in /db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij:
Main.java mtTestCase.java utilMain.java utilMain14.java
Posted by Army <qo...@gmail.com>.
djd@apache.org wrote:
> Modified:
> db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/Main.java
> db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/mtTestCase.java
> db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java
> db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain14.java
When I sync up to the latest codeline and do an ant clobber, I see the following
compile errors:
[javac] Compiling 2 source files to C:\p4clients\main_codeline\classes
[javac]
C:\p4clients\main_codeline\opensource\java\testing\org\apache\derbyTesting\functionTests\tests\lang\wisconsin.java:70:
utilMain(int,org.apache.derby.iapi.tools.i18n.LocalizedOutput,java.util.Hashtable)
is not public in org.apache.derby.impl.tools.ij.utilMain; cannot be accessed
from outside package
[javac] utilInstance = new utilMain(1, out, (Hashtable)null);
[javac] ^
[javac] 1 error
[javac] Compile failed; see the compiler error output for details.
compile:
[javac] Compiling 4 source files to C:\p4clients\main_codeline\classes
[javac]
C:\p4clients\main_codeline\java\com\ibm\db2j\functionTests\smallDevice\IjTest.java:158:
go(org.apache.derby.iapi.tools.i18n.LocalizedInput,org.apache.derby.iapi.tools.i18n.LocalizedOutput,
java.util.Properties) has private access in org.apache.derby.impl.tools.ij.Main
[javac] me.go(in, out, (Properties) null);
[javac] ^
[javac] 1 error
[javac] Compile failed; see the compiler error output for details.
I also noticed (somewhat by chance) that if I try to run ij using Sun jdk131
with the latest codeline, I see the following:
Exception in thread "main" java.lang.UnsupportedClassVersionError:
org/apache/derby/impl/tools/ij/Main14 (Unsupported major.minor version 48.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:243)
at java.net.URLClassLoader.access$100(URLClassLoader.java:51)
at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:288)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
Are these errors caused by revision 427293?
svn info
Path: .
URL: http://svn.apache.org/repos/asf/db/derby/code/trunk
Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 427335
Node Kind: directory
Schedule: normal
Last Changed Author: djd
Last Changed Rev: 427298
Last Changed Date: 2006-07-31 14:42:26 -0700 (Mon, 31 Jul 2006)
Properties Last Updated: 2006-03-03 15:06:29 -0800 (Fri, 03 Mar 2006)
Army