From derby-commits-return-515-apmail-db-derby-commits-archive=db.apache.org@db.apache.org Tue Apr 12 06:21:21 2005 Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 58956 invoked from network); 12 Apr 2005 06:21:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Apr 2005 06:21:21 -0000 Received: (qmail 81937 invoked by uid 500); 12 Apr 2005 06:21:21 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 81914 invoked by uid 500); 12 Apr 2005 06:21:21 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 81901 invoked by uid 500); 12 Apr 2005 06:21:21 -0000 Delivered-To: apmail-incubator-derby-cvs@incubator.apache.org Received: (qmail 81898 invoked by uid 99); 12 Apr 2005 06:21:21 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Mon, 11 Apr 2005 23:21:20 -0700 Received: (qmail 58950 invoked by uid 65534); 12 Apr 2005 06:21:19 -0000 Message-ID: <20050412062119.58949.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Tue, 12 Apr 2005 06:21:19 -0000 Subject: svn commit: r161022 - in incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: tests/derbynet/dataSourcePermissions_net.java util/TestUtil.java To: derby-cvs@incubator.apache.org From: kmarsden@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: kmarsden Date: Mon Apr 11 23:21:18 2005 New Revision: 161022 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D161022 Log: Test setDescription for network server Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/dataSourcePermissions_net.java incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/util/TestUtil.java Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/f= unctionTests/tests/derbynet/dataSourcePermissions_net.java URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/= org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_= net.java?view=3Ddiff&r1=3D161021&r2=3D161022 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/dataSourcePermissions_net.java (original) +++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/dataSourcePermissions_net.java Mon Apr 11 23:21:18 20= 05 @@ -245,6 +245,7 @@ public void testClientDataSourceProperties() throws SQLException { testRetrieveMessageText(); + testDescription(); } =20 /** @@ -280,6 +281,39 @@ catch (Exception e) { System.out.println("FAIL: testRetrieveMessageText() Unexpected Exceptio= n " + e.getMessage()); + e.printStackTrace(); + } + } + + /** + * Test description property + */ + public void testDescription() throws SQLException + { + String descriptionProperty =3D "description"; + Class[] argType =3D { String.class}; + String setterMethodName =3D TestUtil.getSetterName(descriptionProperty); + String getterMethodName =3D TestUtil.getGetterName(descriptionProperty); + + Object[] args; + + try { + String setDescription =3D "Everything you ever wanted to know about thi= s datasource"; + DataSource ds =3D getDS("wombat", "EDWARD", "noodle"); + // Set the description + Method sh =3D ds.getClass().getMethod(setterMethodName, argType); + args =3D new Object[] { new String(setDescription) }; + sh.invoke(ds, args); + // Now check it + sh =3D ds.getClass().getMethod(getterMethodName, null); + String getDescription =3D (String) sh.invoke(ds, null); + if (!setDescription.equals(getDescription)) + throw new Exception("getDescription() " + getDescription +=20 + " does not match setDescription() "); + } + catch (Exception e) + { + System.out.println("FAIL: testDescription() Unexpected Exception " + e.= getMessage()); e.printStackTrace(); } } Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/f= unctionTests/util/TestUtil.java URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/= org/apache/derbyTesting/functionTests/util/TestUtil.java?view=3Ddiff&r1=3D1= 61021&r2=3D161022 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/util/TestUtil.java (original) +++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/util/TestUtil.java Mon Apr 11 23:21:18 2005 @@ -376,6 +376,11 @@ } =20 =09 + public static String getGetterName(String attribute) + { + return "get" + Character.toUpperCase(attribute.charAt(0)) + attribute.su= bstring(1); + } + // Some methods for test output. public static void dumpSQLExceptions(SQLException sqle) { TestUtil.dumpSQLExceptions(sqle, false);