Re: JUnit question

2008-11-20 Thread ericp56

I'll give it a whirl...:)

David Blevins wrote:
 
 
 On Nov 19, 2008, at 6:32 AM, ericp56 wrote:
 

 I wasn't paying attention to the package, only the class name.   
 Thanks for
 the clarification:)
 
 No worries.  I've often thought it would be neat to add some  
 functionality that would catch ClassNotFoundExceptions and print the  
 name of the jar that should be added to the classpath.  Wouldn't be  
 too hard as all we'd have to do is create a maven plugin (or any plain  
 java code we can run via the maven-ant-plugin at build time) that  
 squirted the indexes of each jar we depend on into a file that we  
 include in the openejb-core jar.  Then it'd simply be a quick read  
 through that file to find the jar name to add to the error message.
 
 Would be a cool contribution if you felt like giving it a whirl :)
 
 -David
 
 
 

-- 
View this message in context: 
http://www.nabble.com/JUnit-question-tp20306283p20606400.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: JUnit question

2008-11-19 Thread ericp56

I wasn't paying attention to the package, only the class name.  Thanks for
the clarification:)
-- 
View this message in context: 
http://www.nabble.com/JUnit-question-tp20306283p20580964.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: JUnit question

2008-11-05 Thread Jacek Laskowski
On Wed, Nov 5, 2008 at 12:05 AM, ericp56 [EMAIL PROTECTED] wrote:

 My current problem is caused by:
 Caused by: java.lang.NoClassDefFoundError:
 org/apache/commons/dbcp/BasicDataSource

Add commons-dbcp-*.jar to CLASSPATH and start it over.

Jacek

-- 
Jacek Laskowski
Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl


Re: JUnit question

2008-11-05 Thread ericp56

That's already included in my classpath via openejb-core-3.0.jar (in Geronimo
server).


-- 
View this message in context: 
http://www.nabble.com/JUnit-question-tp20306283p20351506.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: JUnit question

2008-11-05 Thread David Blevins


On Nov 5, 2008, at 2:50 PM, ericp56 wrote:

That's already included in my classpath via openejb-core-3.0.jar (in  
Geronimo

server).


Not sure I follow.  The embeddable EJB container functionality for  
unit testing doesn't use the Geronimo server.  Also Geronimo doesn't  
use commons-dbcp as it has it's own connection management code.


You could try something like this in your test case to see what is in  
our classpath, assuming the Eclipse classloader is a subclass of  
URLClassLoader (good chance of that).


  ClassLoader classLoader =  
Thread.currentThread().getContextClassLoader();

  System.out.println(classLoader + classLoader);
  System.out.println(classLoader.class +  
classLoader.getClass().getName());

  if (classLoader instanceof URLClassLoader) {
  URLClassLoader urlClassLoader = (URLClassLoader) classLoader;
  URL[] urls = urlClassLoader.getURLs();
  for (URL url : urls) {
  System.out.println(url =  + url.toExternalForm());
  }
  }

-David



JUnit question

2008-11-03 Thread ericp56

Hello,

In Eclipse, I'm able to test a simple EJB with Junit.

I'm having problems testing one slightly more complicated.

I had to create an ejb-jar.xml file, because the openejb-jar.xml file was
not recognized in junit.

Now, I am getting this:
FATAL - OpenEJB has encountered a fatal error and cannot be started:
Assembler failed to build the container system. ... NullPointerException...

I'm guessing it's perhaps one of my openejb-jar.xml dependencies is not
being loaded, like a console.dbpool resource.

Any suggestions on how to resolve it?

Thanks,

Eric
-- 
View this message in context: 
http://www.nabble.com/JUnit-question-tp20306283p20306283.html
Sent from the OpenEJB User mailing list archive at Nabble.com.