Package org.pojava.persistence.jndi

Objects that aid in unit testing-- currently, by providing an InitialContext normally created by your application server for JNDI.

See:
          Description

Class Summary
DriverManagerDataSource DriverManagerDataSource provides a simple DataSource object useful for unit testing.
JNDIRegistry A helper class for stubbing out an InitialContext for unit tests.
TestingContext An implementation of a Context for the purpose of unit testing.
TestingContextFactory Factory class for instantiating an InitialContext for unit testing.
 

Package org.pojava.persistence.jndi Description

Objects that aid in unit testing-- currently, by providing an InitialContext normally created by your application server for JNDI. It is common for a DataSource to be retrieved from a JNDI registry. The registry is usually configured by the application server, so that when your unit tests are running standalone, there is no JNDI registry. This package addresses that problem by creating an in-memory mockup of JNDI that your unit tests can have at. Example: context=JNDIRegistry.getInitialContext(); Class.forName("org.postgresql.Driver"); DataSource ds=new DriverManagerDataSource("jdbc:postgresql://localhost:5432/postgres", "pojava", "popojava"); context.bind("java:/comp/env/jdbc/example", ds);



Copyright © 2011. All Rights Reserved.