|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.javaranch.unittest.helper.sql.pool.JNDIUnitTestHelper
Title: JNDIUnitTestHelper
Description: Simple class used to simulate a JNDI DataSource for use in UnitTests
Usage is Simple in setUp for your UnitTest:if(JNDIUnitTestHelper.notInitialized()){ JNDIUnitTestHelper.init("jndi_unit_test_helper.properties"); }
com.javaranch.unittest.helper.sql.pool.JNDIName=java/TestDB com.javaranch.unittest.helper.sql.pool.dbDriver=org.gjt.mm.mysql.Driver com.javaranch.unittest.helper.sql.pool.dbServer=jdbc:mysql://localhost/jugsoft com.javaranch.unittest.helper.sql.pool.DbConnectionBrokerPool.dbLogin=juguser com.javaranch.unittest.helper.sql.pool.DbConnectionBrokerPool.dbPassword=jugsoft
Copyright: Copyright (c) 2002
- - - - - - - - - - - - - - - - -You are welcome to do whatever you want to with this source file provided that you maintain this comment fragment (between the dashed lines). Modify it, change the package name, change the class name ... personal or business use ... sell it, share it ... add a copyright for the portions you add ...
My goal in giving this away and maintaining the copyright is to hopefully direct developers back to JavaRanch.
The original source can be found at JavaRanch
- - - - - - - - - - - - - - - - -
Company: JavaRanch
Method Summary | |
static java.lang.String |
getJndiName()
Gets the name of the datasource, useful in test because this is configurable for the tests ran. |
static void |
init(java.lang.String fileName)
Intializes the pool and sets it in the InitialContext |
static boolean |
notInitialized()
determines if the pool was successfully initialized or not. |
static void |
shutdown()
shutdowns down the pool and ends the Thread that DbConnectionBroker starts. |
Methods inherited from class java.lang.Object |
|
Method Detail |
public static void init(java.lang.String fileName) throws java.io.IOException, javax.naming.NamingException
fileName
- Name of the properties filejava.io.IOException
- public static boolean notInitialized()
public static void shutdown() throws javax.naming.NamingException
javax.naming.NamingException
- public static java.lang.String getJndiName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |