Return-Path: Delivered-To: apmail-jakarta-avalon-cvs-archive@apache.org Received: (qmail 80404 invoked from network); 4 Jan 2003 21:31:53 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 4 Jan 2003 21:31:53 -0000 Received: (qmail 4146 invoked by uid 97); 4 Jan 2003 21:33:14 -0000 Delivered-To: qmlist-jakarta-archive-avalon-cvs@jakarta.apache.org Received: (qmail 4128 invoked by uid 97); 4 Jan 2003 21:33:13 -0000 Mailing-List: contact avalon-cvs-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-cvs@jakarta.apache.org Received: (qmail 4116 invoked by uid 97); 4 Jan 2003 21:33:12 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: 4 Jan 2003 21:31:47 -0000 Message-ID: <20030104213147.93196.qmail@icarus.apache.org> From: hammant@apache.org To: jakarta-avalon-excalibur-cvs@apache.org Subject: cvs commit: jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/http JettyTestCase.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N hammant 2003/01/04 13:31:47 Modified: altrmi build.xml altrmi/src/java/org/apache/excalibur/altrmi/client/impl AbstractAltrmiFactory.java AbstractConnectionPinger.java ServerClassAltrmiFactory.java altrmi/src/java/org/apache/excalibur/altrmi/client/impl/callback/socket CallbackEnabledSocketCustomStreamInvocationHandler.java altrmi/src/java/org/apache/excalibur/altrmi/client/impl/http ClientHttpReadWriter.java altrmi/src/java/org/apache/excalibur/altrmi/client/impl/naming DefaultAltrmiContext.java DefaultAltrmiInitialContextFactory.java altrmi/src/java/org/apache/excalibur/altrmi/client/impl/stream ClientCustomStreamReadWriter.java StreamInvocationHandler.java altrmi/src/java/org/apache/excalibur/altrmi/common AltrmiConnectionException.java AltrmiInvocationException.java ClassLoaderObjectInputStream.java altrmi/src/java/org/apache/excalibur/altrmi/server PublicationDescriptionItem.java altrmi/src/java/org/apache/excalibur/altrmi/server/impl DefaultMethodInvocationHandler.java StreamServerConnection.java altrmi/src/java/org/apache/excalibur/altrmi/server/impl/adapters InvocationHandlerAdapter.java altrmi/src/java/org/apache/excalibur/altrmi/server/impl/classretrievers AbstractDynamicGeneratorClassRetriever.java altrmi/src/test/org/apache/excalibur/altrmi/test/http JettyTestCase.java Log: tidy up of sys.out, imports and exception handling. Revision Changes Path 1.59 +4 -1 jakarta-avalon-excalibur/altrmi/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/build.xml,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- build.xml 4 Jan 2003 19:57:54 -0000 1.58 +++ build.xml 4 Jan 2003 21:31:45 -0000 1.59 @@ -137,7 +137,6 @@ - Speed Test Iterations=${speedtest.iterations} @@ -287,7 +286,11 @@ + + + + 1) - { - System.out.println( "ClientCustomStreamWriter.readReply took " + cnt + - " reads to read all, " + byteArraySize + ", required bytes." ); - } - */ - return (AltrmiReply)SerializationHelper.getInstanceFromBytes( byteArray, mInterfacesClassLoader ); } 1.11 +1 -5 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/stream/StreamInvocationHandler.java Index: StreamInvocationHandler.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/stream/StreamInvocationHandler.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- StreamInvocationHandler.java 21 Dec 2002 21:43:54 -0000 1.10 +++ StreamInvocationHandler.java 4 Jan 2003 21:31:46 -0000 1.11 @@ -199,10 +199,6 @@ } catch( ClassNotFoundException e ) { - System.out.println( "--" ); - e.printStackTrace(); - System.out.println( "--" ); - throw new AltrmiInvocationException( "Class definition missing on Deserialization: " + e.getMessage() ); } 1.4 +21 -1 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/AltrmiConnectionException.java Index: AltrmiConnectionException.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/AltrmiConnectionException.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AltrmiConnectionException.java 23 May 2002 21:37:19 -0000 1.3 +++ AltrmiConnectionException.java 4 Jan 2003 21:31:46 -0000 1.4 @@ -17,6 +17,10 @@ public class AltrmiConnectionException extends Exception { + // For the time being, this is backwards compatible with 1.3. It could + // just as easily use the 1.4 constructors for Exception. + private Throwable throwableCause; + /** * Constructor AltrmiConnectionException * @@ -27,5 +31,21 @@ public AltrmiConnectionException( String msg ) { super( msg ); + } + + public AltrmiConnectionException(String message, Throwable cause) + { + super(message); + throwableCause = cause; + } + + public Throwable getCause() + { + return throwableCause; + } + + public String getMessage() + { + return super.getMessage() + (throwableCause != null ? " : " + throwableCause.getMessage() : ""); } } 1.4 +20 -1 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/AltrmiInvocationException.java Index: AltrmiInvocationException.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/AltrmiInvocationException.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AltrmiInvocationException.java 23 May 2002 21:37:19 -0000 1.3 +++ AltrmiInvocationException.java 4 Jan 2003 21:31:46 -0000 1.4 @@ -19,6 +19,8 @@ public class AltrmiInvocationException extends RuntimeException implements Serializable { + private Throwable throwableCause; + /** * Constructor AltrmiInvocationException * @@ -30,4 +32,21 @@ { super( msg ); } + + public AltrmiInvocationException(String message, Throwable cause) + { + super(message); + throwableCause = cause; + } + + public Throwable getCause() + { + return throwableCause; + } + + public String getMessage() + { + return super.getMessage() + (throwableCause != null ? " : " + throwableCause.getMessage() : ""); + } + } 1.6 +0 -16 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/ClassLoaderObjectInputStream.java Index: ClassLoaderObjectInputStream.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/common/ClassLoaderObjectInputStream.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ClassLoaderObjectInputStream.java 5 Sep 2002 22:22:36 -0000 1.5 +++ ClassLoaderObjectInputStream.java 4 Jan 2003 21:31:46 -0000 1.6 @@ -81,20 +81,4 @@ return super.resolveClass( objectStreamClass ); } } - - // for debugging - private void printCLs() - { - - ClassLoader cl = m_classLoader; - - System.out.println( "Cl1>" + cl ); - - while( cl != null ) - { - System.out.println( "Cl?>" + cl ); - - cl = cl.getParent(); - } - } } 1.9 +2 -1 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/PublicationDescriptionItem.java Index: PublicationDescriptionItem.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/PublicationDescriptionItem.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- PublicationDescriptionItem.java 27 Dec 2002 00:07:27 -0000 1.8 +++ PublicationDescriptionItem.java 4 Jan 2003 21:31:46 -0000 1.9 @@ -53,6 +53,7 @@ } catch (NoClassDefFoundError ncdfe) { + // TODO a soft check for Atributes / CommonsLogger missing? //System.out.println("--> ncdfe " + ncdfe.getMessage()); //ncdfe.printStackTrace(); // attribute jars are missing. 1.10 +1 -21 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/DefaultMethodInvocationHandler.java Index: DefaultMethodInvocationHandler.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/DefaultMethodInvocationHandler.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- DefaultMethodInvocationHandler.java 1 Nov 2002 16:35:43 -0000 1.9 +++ DefaultMethodInvocationHandler.java 4 Jan 2003 21:31:46 -0000 1.10 @@ -207,8 +207,6 @@ if( wr == null ) { - System.out.println( "missing weak reference for referenceID - " - + request.getReferenceID() + " pub " + m_publishedThing ); return new NoSuchReferenceReply( request.getReferenceID() ); } @@ -216,8 +214,6 @@ if( beanImpl == null ) { - System.out.println( "Missin beanImpl for " + request.getReferenceID() ); - return new NoSuchReferenceReply( request.getReferenceID() ); } @@ -279,22 +275,6 @@ args[ i ] = wr.get(); } } - } - - private void debug( Object[] args ) - { - - System.out.println( "*************************" ); - - for( int i = 0; i < args.length; i++ ) - { - Object arg = args[ i ]; - - System.out.println( "i = " + i + " class= " + args[ i ].getClass().getName() + " " - + args[ i ].toString() ); - } - - System.out.println( "*************************" ); } /** 1.10 +1 -5 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/StreamServerConnection.java Index: StreamServerConnection.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/StreamServerConnection.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- StreamServerConnection.java 26 Nov 2002 06:09:55 -0000 1.9 +++ StreamServerConnection.java 4 Jan 2003 21:31:46 -0000 1.10 @@ -20,8 +20,6 @@ import org.apache.excalibur.altrmi.common.BadConnectionException; import org.apache.excalibur.altrmi.server.AltrmiServerConnection; -import javax.swing.*; - /** * Class StreamServerConnection * @@ -120,14 +118,12 @@ if (ioe instanceof EOFException) { - getLogger().info("One Connection closed. (EOF)"); m_readWriter.close(); } else if (isSafeEnd(ioe)) { // TODO implement implementation indepandant logger - getLogger().info("One Connection closed."); m_readWriter.close(); } else 1.15 +4 -6 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/adapters/InvocationHandlerAdapter.java Index: InvocationHandlerAdapter.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/adapters/InvocationHandlerAdapter.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- InvocationHandlerAdapter.java 26 Nov 2002 06:09:55 -0000 1.14 +++ InvocationHandlerAdapter.java 4 Jan 2003 21:31:46 -0000 1.15 @@ -54,8 +54,6 @@ import org.apache.excalibur.altrmi.server.impl.DefaultMethodInvocationHandler; import org.apache.excalibur.altrmi.server.impl.classretrievers.NoClassRetriever; -import javax.swing.*; - /** * Class InvocationHandlerAdapter * @@ -498,14 +496,14 @@ new AltrmiInvocationException( "TODO - you dirty rat/hacker" ) ); } - AltrmiSession sess = (AltrmiSession)m_sessions.get( gcr.getSession() ); + AltrmiSession sess = (AltrmiSession) m_sessions.get( gcr.getSession() ); if( sess == null ) { - System.out.println( "DEBUG- GC on missing session -" + gcr.getSession() ); + System.err.println( "DEBUG- GC on missing session -" + gcr.getSession() ); } if( gcr.getReferenceID() == null ) { - System.out.println( "DEBUG- GC on missing referenceID -" + gcr.getReferenceID() ); + System.err.println( "DEBUG- GC on missing referenceID -" + gcr.getReferenceID() ); } sess.removeBeanInUse( gcr.getReferenceID() ); 1.7 +36 -29 jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/classretrievers/AbstractDynamicGeneratorClassRetriever.java Index: AbstractDynamicGeneratorClassRetriever.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/classretrievers/AbstractDynamicGeneratorClassRetriever.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- AbstractDynamicGeneratorClassRetriever.java 14 Nov 2002 23:49:28 -0000 1.6 +++ AbstractDynamicGeneratorClassRetriever.java 4 Jan 2003 21:31:46 -0000 1.7 @@ -12,7 +12,14 @@ import java.io.FileInputStream; import java.io.IOException; import org.apache.excalibur.altrmi.common.ProxyGenerator; -import org.apache.excalibur.altrmi.server.*; +import org.apache.excalibur.altrmi.server.AltrmiProxyGenerator; +import org.apache.excalibur.altrmi.server.ClassRetriever; +import org.apache.excalibur.altrmi.server.PublicationDescription; +import org.apache.excalibur.altrmi.server.ClassRetrievalException; +import org.apache.excalibur.altrmi.server.PublicationException; +import org.apache.excalibur.altrmi.server.PublicationDescriptionItem; +import org.apache.excalibur.altrmi.server.ProxyGenerationEnvironmentException; + /** * Class JarFileClassRetriever @@ -283,22 +290,22 @@ } catch( Throwable t ) { - System.out.println( "******" ); - System.out.println( "** Exception while making source : " ); - System.out.flush(); + System.err.println( "******" ); + System.err.println( "** Exception while making source : " ); + System.err.flush(); t.printStackTrace(); - System.out.println( "** Name=" + asName ); - System.out.println( "** Classes/Interfaces to Expose.." ); + System.err.println( "** Name=" + asName ); + System.err.println( "** Classes/Interfaces to Expose.." ); for( int i = 0; i < interfacesToExpose.length; i++ ) { String aString = interfacesToExpose[ i ].getFacadeClass().getName(); - System.out.println( "** .." + aString ); + System.err.println( "** .." + aString ); } - System.out.println( "******" ); - System.out.flush(); + System.err.println( "******" ); + System.err.flush(); } if( !deferred ) @@ -312,38 +319,38 @@ if( ( t instanceof NoClassDefFoundError ) && t.getMessage().equals( "sun/tools/javac/Main" ) ) { - System.out.println( "***************************************" ); - System.out.println( "* *" ); - System.out.println( "* AltRMI problem...... *" ); - System.out.println( "* Please copy JAVA_HOME/lib/tools.jar *" ); - System.out.println( "* to your applications classpath so *" ); - System.out.println( "* that proxys can be compiled. *" ); - System.out.println( "* *" ); - System.out.println( "***************************************" ); + System.err.println( "***************************************" ); + System.err.println( "* *" ); + System.err.println( "* AltRMI problem...... *" ); + System.err.println( "* Please copy JAVA_HOME/lib/tools.jar *" ); + System.err.println( "* to your applications classpath so *" ); + System.err.println( "* that proxys can be compiled. *" ); + System.err.println( "* *" ); + System.err.println( "***************************************" ); throw new ProxyGenerationEnvironmentException( "tools.jar not found in classpath." ); } - System.out.println( "******" ); - System.out.println( "** Exception while making String : " ); - System.out.flush(); + System.err.println( "******" ); + System.err.println( "** Exception while making String : " ); + System.err.flush(); t.printStackTrace(); - System.out.println( "** SrcDir=" + m_srcGenDir ); - System.out.println( "** ClassDir=" + m_classGenDir ); - System.out.println( "** Name=" + asName ); - System.out.println( "** CLasspath=" + m_altrmiClasspath ); - System.out.println( "** Classes/Interfaces to Expose.." ); + System.err.println( "** SrcDir=" + m_srcGenDir ); + System.err.println( "** ClassDir=" + m_classGenDir ); + System.err.println( "** Name=" + asName ); + System.err.println( "** CLasspath=" + m_altrmiClasspath ); + System.err.println( "** Classes/Interfaces to Expose.." ); for( int i = 0; i < interfacesToExpose.length; i++ ) { String aString = interfacesToExpose[ i ].getFacadeClass().getName(); - System.out.println( "** .." + aString ); + System.err.println( "** .." + aString ); } - System.out.println( "******" ); - System.out.flush(); + System.err.println( "******" ); + System.err.flush(); } } } 1.4 +5 -5 jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/http/JettyTestCase.java Index: JettyTestCase.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/http/JettyTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JettyTestCase.java 21 Dec 2002 22:24:07 -0000 1.3 +++ JettyTestCase.java 4 Jan 2003 21:31:47 -0000 1.4 @@ -64,7 +64,7 @@ } public void testURLConnectionGet() throws Exception { - URL url = new URL("http","localhost", HTTP_PORT,"/test/hi.txt"); + URL url = new URL("http","localhost", HTTP_PORT,"/test/Jetty.txt"); URLConnection connection = url.openConnection(); String contentType = connection.getContentType(); assertEquals("text/plain", contentType); @@ -81,9 +81,9 @@ // we shouldn't have to wait if a connection is available client.setHttpConnectionFactoryTimeout( 10 * 1000 ); - GetMethod getMethod = new GetMethod("/test/hi.txt"); + GetMethod getMethod = new GetMethod("/test/Jetty.txt"); client.executeMethod(getMethod); - assertEquals("hi",new String(getMethod.getResponseBody())); + assertEquals("Test For Jetty",new String(getMethod.getResponseBody())); } public void testHttpClientGet2() throws Exception { @@ -97,9 +97,9 @@ // we shouldn't have to wait if a connection is available client.setHttpConnectionFactoryTimeout( 10 * 1000 ); - PostMethod postMethod = new PostMethod("/test/hi.txt"); + PostMethod postMethod = new PostMethod("/test/Jetty.txt"); client.executeMethod(postMethod); - assertEquals("hi",new String(postMethod.getResponseBody())); + assertEquals("Test For Jetty",new String(postMethod.getResponseBody())); } public void testHttpClientPost2() throws Exception { -- To unsubscribe, e-mail: For additional commands, e-mail: