commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prick...@apache.org
Subject cvs commit: jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database DatabaseMDNullValueTests.java DatabaseMDSetGetTests.java
Date Fri, 29 Nov 2002 04:34:01 GMT
prickett    2002/11/28 20:34:01

  Modified:    periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database
                        DatabaseMetaData.java DatabaseMetaDataImpl.java
               periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database
                        DatabaseMDNullValueTests.java
                        DatabaseMDSetGetTests.java
  Log:
  Added getShortDescription, getDescription and getWebUrl() to DatabaseMetaData
  
  Added getShortDesdcription, setShortDescription, getDescription, setDescription
        getWebUrl and setWebURl to DatabaseMetaDataImpl.
  
  Added the newUrl parameter to the DatabaseMetaDataImpl constructor
  
  Fixed the test modules to use the new DatabaseMetaData constructor.
  
  Revision  Changes    Path
  1.3       +23 -3     jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DatabaseMetaData.java
  
  Index: DatabaseMetaData.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DatabaseMetaData.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DatabaseMetaData.java	20 Oct 2002 22:44:46 -0000	1.2
  +++ DatabaseMetaData.java	29 Nov 2002 04:34:01 -0000	1.3
  @@ -86,6 +86,26 @@
        * @return The database url as a string.
        */
       public String getUrl();
  +
  +    /**
  +     * The purpose of this method is to get the short description of this
  +     * database.
  +     * @return The short description as a string.
  +     */
  +    public String getShortDescription();
  +
  +    /**
  +     * The purpose of this method is to get the description of this database.
  +     * @return The description as a string.
  +     */
  +    public String getDescription();
  +
  +    /**
  +     * The purpose of this method is to get the web url of this database.
  +     * @return The web url of the database as a string.
  +     */
  +    public String getWebUrl(); 
  +
   }    
       
       
  
  
  
  1.5       +79 -5     jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DatabaseMetaDataImpl.java
  
  Index: DatabaseMetaDataImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DatabaseMetaDataImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DatabaseMetaDataImpl.java	22 Oct 2002 02:56:25 -0000	1.4
  +++ DatabaseMetaDataImpl.java	29 Nov 2002 04:34:01 -0000	1.5
  @@ -75,19 +75,30 @@
       /** A variable to hold the url of the database */
       private String dbUrl = null;
   
  +    /** A variable to hold the short description of the database */
  +    private String shortDescription = null;
  +
  +    /** A variable to hold the description of the database */
  +    private String description = null;
  +
  +    /** A variable to hold the web url of the database */
  +    private String webUrl = null;
  +    
  +
       /**
        * The purpose of this method is to create a new database meta data
        * implementation given a name and a type.
        * @param newName The name of the new database to create.
        * @param newType The type of the new database to create.
        */
  -    DatabaseMetaDataImpl(String newName, String newType) 
  +    DatabaseMetaDataImpl(String newName, String newType, String newUrl) 
              throws Exception
       {
  -        if(newName != null && newType != null)
  +        if(newName != null && newType != null && newUrl != null)
           {
               setName(newName);
               setType(newType);
  +            setUrl(newUrl);
           }
           else if(newName == null)
           {
  @@ -97,6 +108,10 @@
           {
               throw new Exception("newType == null");
           }
  +        else if(newUrl == null)
  +        {
  +            throw new Exception("newUrl == null");
  +        }    
           else
           {
               throw new Exception("UNEXPECTED - Unexpected Exception");
  @@ -180,5 +195,64 @@
           {
               throw new Exception("newval == null");
           }
  +    }
  +
  +    /**
  +     * The purpose of this method is to return the short description 
  +     * of the database.
  +     * @return The short description of the database as a string.
  +     */
  +    public String getShortDescription()
  +    {
  +        return shortDescription;
  +    }
  +
  +    /**
  +     * The purpose of this method is to set the short description of the 
  +     * database.
  +     * @param newval The new value for the short description of the database
  +     *        as a string.
  +     */
  +    void setShortDescription(String newval)
  +    {
  +        shortDescription = newval;
  +    }
  +
  +    /**
  +     * The purpose of this method is to get the description of the database.
  +     * @return The description of the database as a string.
  +     */
  +    public String getDescription()
  +    {
  +        return description;
  +    }
  +
  +    /**
  +     * The purpose of this method is to set the description of the database.
  +     * @param newval The new value of the description for the database as a
  +     *        string.
  +     */
  +    void setDescription(String newval)
  +    {
  +        description = newval;
  +    }
  +
  +    /**
  +     * The purpose of this method is to return the web url of the database.
  +     * @return The web url of the database as a string.
  +     */
  +    public String getWebUrl()
  +    {
  +        return webUrl;
  +    }
  +
  +    /**
  +     * The purpose of this method is to set the value of the web url for this
  +     * database.
  +     * @param newval The new value for the web url as a string.
  +     */
  +    void setWebUrl(String newval)
  +    {
  +        webUrl = newval;
       }    
   }    
  
  
  
  1.2       +21 -6     jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database/DatabaseMDNullValueTests.java
  
  Index: DatabaseMDNullValueTests.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database/DatabaseMDNullValueTests.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DatabaseMDNullValueTests.java	21 Nov 2002 21:53:43 -0000	1.1
  +++ DatabaseMDNullValueTests.java	29 Nov 2002 04:34:01 -0000	1.2
  @@ -73,6 +73,8 @@
   
       public static final String VALID_DB_TYPE = "valid_db_type";
   
  +    public static final String VALID_DB_URL = "jdbc:db:db";
  +
       public static final String EXPECT_EXCEPTION_WHEN_NEW_NAME_AND_TYPE_NULL =
              "An exception is expected when both the name and type are null.";
       
  @@ -93,7 +95,7 @@
           try
           {
               DatabaseMetaDataImpl dbmeta = new DatabaseMetaDataImpl(
  -                   null, null);
  +                   null, null, null);
               fail(EXPECT_EXCEPTION_WHEN_NEW_NAME_AND_TYPE_NULL);
           }
           catch(Exception e)
  @@ -106,7 +108,7 @@
           try
           {
               DatabaseMetaDataImpl dbmeta = new DatabaseMetaDataImpl(
  -                   VALID_DB_NAME, null);
  +                   VALID_DB_NAME, null, null);
               fail(EXPECT_EXCEPTION_WHEN_NEW_TYPE_NULL);
           }
           catch(Exception e)
  @@ -119,7 +121,20 @@
           try
           {
               DatabaseMetaDataImpl dbmeta = new DatabaseMetaDataImpl(
  -                   null, VALID_DB_TYPE);
  +                   null, VALID_DB_TYPE, null);
  +            fail(EXPECT_EXCEPTION_WHEN_NEW_NAME_NULL);
  +        }
  +        catch(Exception e)
  +        {
  +            if(getLogger() != null)
  +            {
  +                getLogger().info("Expected Exception", e);
  +            }
  +        }
  +        try
  +        {
  +            DatabaseMetaDataImpl dbmeta = new DatabaseMetaDataImpl(
  +                   null, null, VALID_DB_URL);
               fail(EXPECT_EXCEPTION_WHEN_NEW_NAME_NULL);
           }
           catch(Exception e)
  
  
  
  1.2       +6 -4      jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database/DatabaseMDSetGetTests.java
  
  Index: DatabaseMDSetGetTests.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database/DatabaseMDSetGetTests.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DatabaseMDSetGetTests.java	21 Nov 2002 21:53:43 -0000	1.1
  +++ DatabaseMDSetGetTests.java	29 Nov 2002 04:34:01 -0000	1.2
  @@ -74,6 +74,8 @@
   
       public static final String VALID_DB_TYPE = "valid_db_type";
   
  +    public static final String VALID_DB_URL = "jdbc:db:db";
  +
       public DatabaseMDSetGetTests()
       {
           super(TEST_NAME);
  @@ -84,7 +86,7 @@
           try
           {
               DatabaseMetaDataImpl dbmeta = new DatabaseMetaDataImpl(
  -                   VALID_DB_NAME, VALID_DB_TYPE);
  +                   VALID_DB_NAME, VALID_DB_TYPE, VALID_DB_URL);
               String name = dbmeta.getName();
               assertEquals("The name that was set does not match the name " +
                      "that was retrieved.", VALID_DB_NAME, name);
  
  
  

--
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