commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thorha...@apache.org
Subject cvs commit: jakarta-commons-sandbox/sql/src/test/org/apache/commons/sql/model TestColumn.java TestTypeMap.java
Date Fri, 20 Sep 2002 21:28:00 GMT
thorhauer    2002/09/20 14:28:00

  Added:       sql/src/test/org/apache/commons/sql/model TestColumn.java
                        TestTypeMap.java
  Log:
  adding unit tests
  
  Revision  Changes    Path
  1.1                  jakarta-commons-sandbox/sql/src/test/org/apache/commons/sql/model/TestColumn.java
  
  Index: TestColumn.java
  ===================================================================
  package org.apache.commons.sql.model;
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   *
   * $Id: TestColumn.java,v 1.1 2002/09/20 21:28:00 thorhauer Exp $
   */
  
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  import junit.textui.TestRunner;
  
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.apache.commons.logging.impl.SimpleLog;
  
  import org.apache.commons.sql.model.Column;
  
  /**
   * Test harness for Column Class
   *
   * @author <a href="mailto:john@zenplex.com">John Thorhauer</a>
   * @version $Revision: 1.1 $
   */
  public class TestColumn
       extends TestCase
  {
  
      /**
       * A unit test suite for JUnit
       */
      public static Test suite()
      {
          return new TestSuite(TestColumn.class);
      }
  
      /**
       * Constructor for the TestColumn
       *
       * @param testName
       */
      public TestColumn(String testName)
      {
          super(testName);
      }
  
      /**
       * The JUnit setup method
       */
      protected void setUp()
          throws Exception
      {
          super.setUp();
      }
  
      /**
       * A unit test for JUnit
       */
      public void testColumn()
          throws Exception
      {
          Column column = new Column("Test1","INTEGER",255,true,true,true);
          assertTrue("Column is null", column != null);
          assertTrue("Column toString does not end with [name=Test1;type=INTEGER]", 
                 ((String)column.toString()).endsWith("[name=Test1;type=INTEGER]"));
      }
  
  }
  
  
  
  
  1.1                  jakarta-commons-sandbox/sql/src/test/org/apache/commons/sql/model/TestTypeMap.java
  
  Index: TestTypeMap.java
  ===================================================================
  package org.apache.commons.sql.model;
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   *
   * $Id: TestTypeMap.java,v 1.1 2002/09/20 21:28:00 thorhauer Exp $
   */
  
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  import junit.textui.TestRunner;
  
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.apache.commons.logging.impl.SimpleLog;
  
  /**
   * Test harness for TypeMap Class
   *
   * @author <a href="mailto:john@zenplex.com">John Thorhauer</a>
   * @version $Revision: 1.1 $
   */
  public class TestTypeMap
       extends TestCase
  {
  
      /**
       * A unit test suite for JUnit
       */
      public static Test suite()
      {
          return new TestSuite(TestTypeMap.class);
      }
  
      /**
       * Constructor for the TestTypeMap
       *
       * @param testName
       */
      public TestTypeMap(String testName)
      {
          super(testName);
      }
  
      /**
       * The JUnit setup method
       */
      protected void setUp()
          throws Exception
      {
          super.setUp();
      }
  
      /**
       * A unit test for JUnit
       */
      public void testTextType()
          throws Exception
      {
          assertTrue("VARCHAR should be a text type", TypeMap.isTextType("VARCHAR"));
          assertTrue("FLOAT should not be a text type", !TypeMap.isTextType("FLOAT"));
      }
  
  }
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message