From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6929 invoked by alias); 29 Jan 2003 21:10:35 -0000 Mailing-List: contact mauve-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-discuss-owner@sources.redhat.com Received: (qmail 6911 invoked from network); 29 Jan 2003 21:10:35 -0000 Received: from unknown (HELO merc62.na.sas.com) (149.173.6.49) by 172.16.49.205 with SMTP; 29 Jan 2003 21:10:35 -0000 Received: from merc18.na.sas.com ([10.16.12.224]) by merc62.na.sas.com with InterScan Messaging Security Suite for SMTP; Wed, 29 Jan 2003 16:10:34 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.0.6344.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: Purpose of .net.SocketTest test_BasicServer #12 Date: Wed, 29 Jan 2003 21:10:00 -0000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Steve Murry" To: X-SW-Source: 2003-q1/txt/msg00011.txt.bz2 Can someone examine the following testcase in the .net.Socket package and l= et me know what it is designed to test. I'm unsure about the garbage colle= ctor comment, but it would appear that the purpose of the test is to connec= t to the local Echo server at port #7, and then test the getInputStream() a= nd getOutputStream() methods. However, it then expects an IOException, and= why I'm not sure. On some of our unix hosts that I'm using, we *do* get a= n exception within the test, but the exception is on the 'new Socket("127.0= .0.1", 7)' statement because the Echo server wasn't running at the time. H= owever, in this case the Mauve harness check still reported this test as 'P= ASS' because of the catch code. My gut feeling is that the test is not des= igned to test the Echo server but rather to test the Input and Output metho= ds; however, I'll leave it up to bigger minds to make the final determinati= on. Thanks for the help Steve Murry SAS Institute, Inc.=20 // This test is incorrect. You cannot rely on System.gc() causing // the garbage collector to run. try { sock =3D new Socket("127.0.0.1", 7); InputStream sin =3D null; OutputStream sout =3D null; // create 10 refs and make sure finalize() is invoked. for (int i =3D 0; i < 10; i++) { sin =3D sock.getInputStream(); sout =3D sock.getOutputStream(); } harness.fail("Error : test_BasicServer failed - 12 " + "exception was not thrown"); } catch (IOException e) { harness.check(true); } finally { try { if (sock !=3D null) sock.close(); } catch(IOException ignored) {} } // invoke finalize() System.gc();