Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Contribution to the Code Barn

 
Stephen More
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have made some small improvements to the JUnit JNDI DataSource helper package: http://www.javaranch.com/CodeBarn/jrunittesthelper.zip

How can I contribute it back to the CodeBarn ?

Updates include:
- Built using maven2
- Opens the properties file using classpath
- Works with environment naming context ( see below example )




// Obtain our environment naming context
Context initCtx = new InitialContext();
Context envCtx = (Context)initCtx.lookup("java:comp/env");

// Look up our data source
DataSource ds = (DataSource)envCtx.lookup("jdbc/EmployeeDB");
 
paul wheaton
Trailboss
Pie
Posts: 21504
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for my delay in getting back to you on this. I've been sick.

In looking just at the name of this, it appears to be something to help a person test JRun? There's a name I have not heard in a long time. Without me opening it up, can you tell me more about it? Do we have a web page about it somewhere?
 
Stephen More
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The title is: "JUnit JNDI DataSource helper package"

The description is: can be used to Simulate JNDI lookups for Database Connections.

and can be found here: http://www.javaranch.com/codebarn.jsp


It allows me to run tests against my code without deploying it to a servlet container. Perhaps there is something else that already does this, but I found this and made it work. It does exactly what I need it to do.
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe we should rename the zip file using CamelCase to jrUnitTestHelper.zip
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic