org.logicalcobwebs.proxool
Class TestHelper

java.lang.Object
  extended by org.logicalcobwebs.proxool.TestHelper

public class TestHelper
extends java.lang.Object

Helper for all tests

Version:
$Revision: 1.21 $, $Date: 2003/09/30 18:39:50 $
Author:
bill, $Author: billhorsman $ (current maintainer)

Field Summary
private static Log LOG
           
 
Constructor Summary
TestHelper()
           
 
Method Summary
static java.util.Properties buildCompleteAlternativeProperties()
          Builds a complete set of proxool properties, with all values set to something different than the default vaule.
static java.lang.String buildProxoolUrl(java.lang.String alias)
          Build a valid Proxool URL
static java.lang.String buildProxoolUrl(java.lang.String alias, java.lang.String driver, java.lang.String delegateUrl)
          Build a valid Proxool URL
private static void checkProperty(java.lang.String name, int correctValue, int candidateValue)
           
private static void checkProperty(java.lang.String name, java.lang.String correctValue, java.lang.String candidateValue)
           
static void equalsCompleteAlternativeProperties(ConnectionPoolDefinitionIF connectionPoolDefinition)
          Test that the given ConnectionPoolDefinitionIF contains all the properties as defined in buildCompleteAlternativeProperties().
static java.sql.Connection getDirectConnection()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG
Constructor Detail

TestHelper

public TestHelper()
Method Detail

buildCompleteAlternativeProperties

public static java.util.Properties buildCompleteAlternativeProperties()
Builds a complete set of proxool properties, with all values set to something different than the default vaule.

Returns:
the properties that was buildt.

equalsCompleteAlternativeProperties

public static void equalsCompleteAlternativeProperties(ConnectionPoolDefinitionIF connectionPoolDefinition)
                                                throws ProxoolException
Test that the given ConnectionPoolDefinitionIF contains all the properties as defined in buildCompleteAlternativeProperties().

Parameters:
connectionPoolDefinition - the ConnectionPoolDefinitionIF to be tested.
Throws:
ProxoolException - if any properties are missing or have the wrong value.

checkProperty

private static void checkProperty(java.lang.String name,
                                  java.lang.String correctValue,
                                  java.lang.String candidateValue)
                           throws ProxoolException
Throws:
ProxoolException

checkProperty

private static void checkProperty(java.lang.String name,
                                  int correctValue,
                                  int candidateValue)
                           throws ProxoolException
Throws:
ProxoolException

buildProxoolUrl

public static java.lang.String buildProxoolUrl(java.lang.String alias,
                                               java.lang.String driver,
                                               java.lang.String delegateUrl)
Build a valid Proxool URL

Parameters:
alias - identifies the pool
driver - the delegate driver
delegateUrl - the url to send to the delegate driver
Returns:
proxool.alias:driver:delegateUrl

buildProxoolUrl

public static java.lang.String buildProxoolUrl(java.lang.String alias)
Build a valid Proxool URL

Parameters:
alias - identifies the pool
Returns:
proxool.alias

getDirectConnection

public static java.sql.Connection getDirectConnection()
                                               throws java.lang.ClassNotFoundException,
                                                      java.sql.SQLException
Throws:
java.lang.ClassNotFoundException
java.sql.SQLException