Return-Path: Delivered-To: apmail-db-ddlutils-dev-archive@www.apache.org Received: (qmail 13383 invoked from network); 8 Nov 2005 23:39:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Nov 2005 23:39:34 -0000 Received: (qmail 39969 invoked by uid 500); 8 Nov 2005 23:39:34 -0000 Delivered-To: apmail-db-ddlutils-dev-archive@db.apache.org Received: (qmail 39932 invoked by uid 500); 8 Nov 2005 23:39:33 -0000 Mailing-List: contact ddlutils-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ddlutils-dev@db.apache.org Delivered-To: mailing list ddlutils-dev@db.apache.org Received: (qmail 39921 invoked by uid 500); 8 Nov 2005 23:39:33 -0000 Delivered-To: apmail-db-ddlutils-commits@db.apache.org Received: (qmail 39918 invoked by uid 99); 8 Nov 2005 23:39:33 -0000 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 08 Nov 2005 15:39:33 -0800 Received: (qmail 13318 invoked by uid 65534); 8 Nov 2005 23:39:13 -0000 Message-ID: <20051108233913.13317.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r331926 - /db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestPlatformImplBase.java Date: Tue, 08 Nov 2005 23:39:12 -0000 To: ddlutils-commits@db.apache.org From: mvdb@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: mvdb Date: Tue Nov 8 15:39:02 2005 New Revision: 331926 URL: http://svn.apache.org/viewcvs?rev=331926&view=rev Log: Add test for abstract PlatformImplBase. Added: db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestPlatformImplBase.java Added: db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestPlatformImplBase.java URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestPlatformImplBase.java?rev=331926&view=auto ============================================================================== --- db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestPlatformImplBase.java (added) +++ db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestPlatformImplBase.java Tue Nov 8 15:39:02 2005 @@ -0,0 +1,81 @@ +package org.apache.ddlutils.platform; + +/* + * Copyright 1999-2005 The Apache Software Foundation. + * + * 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. + */ + +import java.util.Map; + +import org.apache.commons.beanutils.DynaBean; +import org.apache.ddlutils.TestPlatformBase; +import org.apache.ddlutils.dynabean.SqlDynaBean; +import org.apache.ddlutils.dynabean.SqlDynaClass; +import org.apache.ddlutils.model.Database; +import org.apache.ddlutils.model.Table; + +/** + * Tests the {@link org.apache.ddlutils.PlatformImplBase} (abstract) class. + * + * @author Martin van den Bemt + * @version $Revision: 279421 $ + */ +public class TestPlatformImplBase extends TestPlatformBase +{ + + String xml = "\n"+ + "\n"+ + " \n"+ + " \n"+ + " \n"+ + "
\n"+ + "
"; + + public void setUp() + { + } + + /** + * Test the toColumnValues method + */ + public void testToColumnValues() + { + Database database = parseDatabaseFromString(xml); + PlatformImplBase platform = new PlatformBase(); + Table table = database.getTable(0); + SqlDynaClass clz = SqlDynaClass.newInstance(table); + DynaBean db = new SqlDynaBean(SqlDynaClass.newInstance(table)); + db.set("name", "name"); + Map map = platform.toColumnValues(clz.getSqlDynaProperties(), db); + + assertEquals("name", map.get("name")); + assertEquals(true, map.containsKey("id")); + } + + + public class PlatformBase extends PlatformImplBase + { + public String getName() + { + return null; + } + } + + + protected String getDatabaseName() { + return null; + } + + +}